300 新增尺寸检测

This commit is contained in:
mo1027728827@qq.com 2022-05-19 14:35:38 +08:00
parent 95ff799cce
commit 59691f8704
3 changed files with 42 additions and 7 deletions

File diff suppressed because one or more lines are too long

View File

@ -37,7 +37,7 @@ using namespace std;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// functional ...
////////////////////////////////////////////////////////////////////////////////
// NEW£¬flow ...
// NEW£¬flow ...
static int num=0;
namespace hg_imgproc
@ -556,7 +556,7 @@ namespace hg_imgproc
#endif
return ret;
}
//除网�
//除网<EFBFBD>?
int textureRemove()
{
int ret = SCANNER_ERR_OK;
@ -630,7 +630,7 @@ namespace hg_imgproc
std::vector<cv::Mat> mats(mats_);
mats_.clear();
double threshold = 40; //默认�
double threshold = 40; //默认<EFBFBD>?
int edge = 150;
CImageApplyDiscardBlank(threshold,edge,img_conf_.discardblank_percent);
@ -646,7 +646,7 @@ namespace hg_imgproc
}
return ret;
}
//答题å<EFBFBD>¡å‡ºï¿?
//答题卡出<EFBFBD>?
int answerSheetFilterRed()
{
int ret = SCANNER_ERR_OK;
@ -695,7 +695,6 @@ namespace hg_imgproc
int ocr_auto_txtdirect()
{
int pDirect = -1;
int ret = SCANNER_ERR_OK;
void *pHanld = NULL;
@ -724,9 +723,26 @@ namespace hg_imgproc
HWOCR_SDKExit(pHanld);
#endif
return ret;
}
int size_detection()
{
int ret = SCANNER_ERR_OK;
std::vector<cv::Mat> mats(mats_);
mats_.clear();
CImageApplySizeDetection paper(img_conf_.papertype);
for (size_t i = 0; i < mats.size(); ++i)
{
ret = paper.apply(mats[i]);
mats_.push_back(mats[i]);
}
if(ret == 1)
{
return SCANNER_ERR_DEVICE_SIZE_CHECK;
}
return SCANNER_ERR_OK;
}
// final
public:
int final(void)
@ -948,6 +964,12 @@ namespace hg_imgproc
{
return ((imgproc*)himg)->ocr_auto_txtdirect();
}
int size_detection(HIMGPRC himg)
{
return ((imgproc*)himg)->size_detection();
}
int final(HIMGPRC himg)
{
return ((imgproc*)himg)->final();

View File

@ -193,6 +193,7 @@ namespace hg_imgproc
int fold(HIMGPRC himg);
int quality(HIMGPRC himg,int dpi);
int ocr_auto_txtdirect(HIMGPRC himg);
int size_detection(HIMGPRC himg);
int final(HIMGPRC himg);