把3288的设备使用到resize 进行锐化
This commit is contained in:
parent
661d5d54e4
commit
b117cbc8bd
|
@ -3722,7 +3722,7 @@ void hg_scanner::image_process(std::shared_ptr<tiny_buffer>& buffer)
|
|||
(this->*dump_img_)(handle, "ocr_auto_txtdirect");
|
||||
}
|
||||
|
||||
if (is_quality_ == IMG_SPEED && resolution_ >= 300)//239
|
||||
if ((is_quality_ == IMG_SPEED && (pid_ == 0x239 || pid_ == 0x439)) && resolution_ >= 300)//239
|
||||
{
|
||||
err = hg_imgproc::quality(handle, resolution_);
|
||||
(this->*dump_img_)(handle, "quality");
|
||||
|
|
|
@ -580,6 +580,7 @@ namespace hg_imgproc
|
|||
int resolution_change()
|
||||
{
|
||||
int ret = SCANNER_ERR_OK;
|
||||
CImageApplyFilter::FilterMode sharpenType = CImageApplyFilter::FilterMode::None;
|
||||
std::vector<cv::Mat> mats(mats_);
|
||||
mats_.clear();
|
||||
|
||||
|
@ -597,8 +598,28 @@ namespace hg_imgproc
|
|||
|
||||
CImageApplyResize resize(resizeType,cvSize,ratio,ratio);
|
||||
resize.apply(mats,img_conf_.is_duplex);
|
||||
if(!mats.empty())
|
||||
mats_ = mats;
|
||||
|
||||
|
||||
if (img_conf_.resolution_dst > 200 && img_conf_.sharpen == CImageApplyFilter::FilterMode::None)
|
||||
{
|
||||
if (img_conf_.resolution_dst <= 300)
|
||||
sharpenType = CImageApplyFilter::FilterMode::Sharpen;
|
||||
else if (img_conf_.resolution_dst > 300 && img_conf_.resolution_dst <= 600)
|
||||
sharpenType = CImageApplyFilter::FilterMode::Sharpen_More;
|
||||
|
||||
CImageApplyFilter Filte(sharpenType);
|
||||
for (size_t i = 0; i < mats.size(); ++i)
|
||||
{
|
||||
Filte.apply(mats[i], img_conf_.is_duplex);
|
||||
mats_.push_back(mats[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!mats.empty())
|
||||
mats_ = mats;
|
||||
}
|
||||
|
||||
|
||||
if (mats_.empty())
|
||||
{
|
||||
|
@ -910,6 +931,7 @@ namespace hg_imgproc
|
|||
int quality(int dpi_dst)
|
||||
{
|
||||
int ret = SCANNER_ERR_OK;
|
||||
CImageApplyFilter::FilterMode sharpenType = CImageApplyFilter::FilterMode::None;
|
||||
std::vector<cv::Mat> mats(mats_);
|
||||
mats_.clear();
|
||||
//mats_.resize(mats.size());
|
||||
|
@ -919,8 +941,20 @@ namespace hg_imgproc
|
|||
{
|
||||
cv::Mat out;
|
||||
cv::resize(mats[i],out, cv::Size(),xy,xy);
|
||||
mats_.push_back(out);
|
||||
}
|
||||
|
||||
if (img_conf_.resolution_dst <= 300)
|
||||
sharpenType = CImageApplyFilter::FilterMode::Sharpen;
|
||||
else if (img_conf_.resolution_dst > 300 && img_conf_.resolution_dst <= 600)
|
||||
sharpenType = CImageApplyFilter::FilterMode::Sharpen_More;
|
||||
|
||||
CImageApplyFilter Filte(sharpenType);
|
||||
for (size_t i = 0; i < mats.size(); ++i)
|
||||
{
|
||||
Filte.apply(mats[i], img_conf_.is_duplex);
|
||||
mats_.push_back(mats[i]);
|
||||
}
|
||||
|
||||
if (mats_.empty())
|
||||
{
|
||||
return SCANNER_ERR_NO_DATA;
|
||||
|
|
Loading…
Reference in New Issue