This commit is contained in:
13038267101 2024-01-03 14:41:31 +08:00
commit 4d93d6bb1a
3 changed files with 31 additions and 0 deletions

View File

@ -5284,6 +5284,12 @@ bool hg_scanner::image_process(std::shared_ptr<tiny_buffer>& buffer, uint32_t id
(this->*dump_img_)(ImagePrc_pHandle_, "auto_crop"); (this->*dump_img_)(ImagePrc_pHandle_, "auto_crop");
} }
if (pid_ != 0x239 && pid_ != 0x439 && image_prc_param_.bits.color_mode == COLOR_MODE_24_BITS)
{
ret = hg_imgproc::dispersion(ImagePrc_pHandle_);
(this->*dump_img_)(ImagePrc_pHandle_, "dispersion");
}
if (is_quality_ == IMG_SPEED && resolution_ >= 300)//239 if (is_quality_ == IMG_SPEED && resolution_ >= 300)//239
{ {
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "set resolution_ is :%d\n", resolution_) VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "set resolution_ is :%d\n", resolution_)

View File

@ -854,6 +854,26 @@ namespace hg_imgproc
} }
return SCANNER_ERR_OK; return SCANNER_ERR_OK;
} }
int dispersion()
{
int ret = SCANNER_ERR_OK;
std::vector<cv::Mat> mats(mats_);
mats_.clear();
CImageApplyDispersion disp;
for (int i = 0; i < mats.size(); ++i)
{
disp.apply(mats[i], 0);
mats_.push_back(mats[i]);
}
if (mats_.empty())
{
return SCANNER_ERR_NO_DATA;
}
return SCANNER_ERR_OK;
}
int fillhole(float top,float low,float l,float r) int fillhole(float top,float low,float l,float r)
{ {
int ret = SCANNER_ERR_OK; int ret = SCANNER_ERR_OK;
@ -1989,6 +2009,10 @@ namespace hg_imgproc
{ {
return ((imgproc*)himg)->auto_crop(dpi); return ((imgproc*)himg)->auto_crop(dpi);
} }
int dispersion(HIMGPRC himg)
{
return ((imgproc*)himg)->dispersion();
}
int fillhole(HIMGPRC himg, float top, float low, float l, float r) int fillhole(HIMGPRC himg, float top, float low, float l, float r)
{ {
return ((imgproc*)himg)->fillhole(top, low, l,r); return ((imgproc*)himg)->fillhole(top, low, l,r);

View File

@ -186,6 +186,7 @@ namespace hg_imgproc
int multi_out_red(HIMGPRC himg); int multi_out_red(HIMGPRC himg);
int auto_matic_color(HIMGPRC himg,int color_type); int auto_matic_color(HIMGPRC himg,int color_type);
int auto_crop(HIMGPRC himg, float dpi); int auto_crop(HIMGPRC himg, float dpi);
int dispersion(HIMGPRC himg);
int fillhole(HIMGPRC himg, float top, float low, float r, float l); int fillhole(HIMGPRC himg, float top, float low, float r, float l);
int resolution_change(HIMGPRC himg,float dpi3288); int resolution_change(HIMGPRC himg,float dpi3288);
int croprect(HIMGPRC himg); int croprect(HIMGPRC himg);