資源簡(jiǎn)介
自己寫的畢業(yè)設(shè)計(jì),基于openCV車牌識(shí)別的小區(qū)門禁系統(tǒng),軟件已經(jīng)全部完成,所有功能都已完善,直接載入圖片就可以識(shí)別車牌,字符的識(shí)別準(zhǔn)確率98%以上,可以識(shí)別中文
代碼片段和文件信息
#include?“base.h“
void?Run_pthread::customEvent(QEvent?*pEvent)
{
}
CWinEvent::CWinEvent(int?msgtype?const?char?*path)?:?QEvent(QEvent::Type(QEvent::User+1))
{
????m_Type?=?msgtype;
????strcpy(m_Path?path);
}
CWinEvent::CWinEvent(int?msgtype?QString?plate?QString?time)?:?QEvent(QEvent::Type(QEvent::User+1))
{
????m_Type?=?msgtype;
????m_Plate?=?plate;
????m_Time?=?time;
}
CWinEvent::~CWinEvent()
{
}
int?CWinEvent::GetType()
{
????return?m_Type;
}
char?*CWinEvent::GetPath()
{
????return?m_Path;
}
QString?CWinEvent::GetPlate()
{
????return?m_Plate;
}
QString?CWinEvent::GetTime()
{
????return?m_Time;
}
void?update_log(char?*msg)
{
????int?ret;
????char?log[512]?=?{0};
????FILE?*file?=?NULL;
????file?=?fopen(“l(fā)og.txt“?“a+“);
????if(file?==?NULL)
????????qDebug()?<“open?error“;
????QDateTime?curtime?=?QDateTime::currentDateTime();
????sprintf(log?“[%s]?%s“?curtime.toString(QString::fromUtf8(?“yyyy年MM月dd日?hh:mm:ss:zzz?ddd“)).toUtf8().data()
?????????????msg);
????ret?=?fprintf(file?“%s\n“?log);
????if(ret?==?-1)
????????qDebug()?<????fclose(file);
}
int?charge_type(QString?plate)
{
????sqlite3?*db;
????sqlite3_stmt?*stmt;
????int?ret;
????ret?=?sqlite3_open(“mysqlite.DB3“?&db);
????if(ret?!=?SQLITE_OK)
????{
????????qDebug()?<????????qDebug()?<????????return?0;
????}
????char?sql[64]?=?“select?*?from?OwnersInfo;“;
????sqlite3_prepare_v2(db?sql?-1?&stmt?NULL);
????ret?=?sqlite3_step(stmt);
????const?unsigned?char?*?pplate;
????while(?ret?!=?SQLITE_DONE?)
????{
??????pplate?=?sqlite3_column_text(?stmt1?);
??????QString?qplate?=?QString::fromUtf8((char?*)pplate);
??????if(qplate?==?plate)
??????{
??????????sqlite3_finalize(stmt);
??????????sqlite3_close(db);
??????????return?LOCAL;
??????}
??????ret?=?sqlite3_step(stmt);
????}
????sqlite3_finalize(stmt);
????//關(guān)閉數(shù)據(jù)庫
????sqlite3_close(db);
????return?FOREIGN;
}
void?insert_InAndOut(QString?plate?QString?time?char?*type)
{
????sqlite3?*db;
????sqlite3_stmt?*stmt;
????int?ret;
????ret?=?sqlite3_open(“mysqlite.DB3“?&db);
????if(ret?!=?SQLITE_OK)
????{
????????qDebug()?<????????qDebug()?<????????return;
????}
????char?sql[256]?=?{0};
????sprintf(sql?“insert?into?InAndOutInfo?(plate?time?type)?values(‘%s‘?‘%s‘?‘%s‘);“
????????????plate.toUtf8().data()?time.toUtf8().data()?type);
????sqlite3_prepare(db?sql?-1?&stmt?NULL);
????ret?=?sqlite3_step(stmt);
????if(ret?!=?SQLITE_DONE)
????{
????????qDebug()?<????}
????sqlite3_finalize(stmt);
????sqlite3_close(db);
}
評(píng)論
共有 條評(píng)論