新增gamme曲线设置

This commit is contained in:
mo1027728827@qq.com 2022-05-07 17:12:32 +08:00
parent e2ad5270d9
commit b25ae0a7c2
5 changed files with 23 additions and 21 deletions

View File

@ -628,7 +628,8 @@ void hg_scanner_200::image_process(std::shared_ptr<std::vector<char>>& buffer)
//HG_LOGHG_LOG_LEVEL_DEBUG_INFO,"除色开启\r\n");
}
/////////////////////////////////////2222222222222222222222222222222222222//////////////////////////////////
hg_imgproc::customgamma(handle,false); //临时false
int tableLength = sizeof(custom_gamma_val_->table)/sizeof(custom_gamma_val_->table[0]);
hg_imgproc::customgamma(handle,custom_gamma_,custom_gamma_val_->table,tableLength);
if (img_conf_.pixtype == COLOR_MODE_24_BITS && img_conf_.hsvcorrect)
{

View File

@ -364,7 +364,7 @@ void hg_scanner_300::thread_handle_usb_read(void)
if (ret == HG_ERR_DEVICE_SLEEPING)
{
status_ = ret;
notify_ui_working_status(STATU_DESC_HG_ERR_DEVICE_SLEEPING, SANE_EVENT_SCAN_FINISHED, status_);
notify_ui_working_status(STATU_DESC_HG_ERR_DEVICE_SLEEPING, SANE_EVENT_ERROR, status_);
HG_VLOG_MINI_1(HG_LOG_LEVEL_WARNING, "device start status is(%s)\n", STATU_DESC_HG_ERR_DEVICE_SLEEPING);
return ret;
}
@ -372,7 +372,7 @@ void hg_scanner_300::thread_handle_usb_read(void)
if (ret == HG_ERR_DEVICE_NO_PAPER)
{
status_ = ret;
notify_ui_working_status(STATU_DESC_HG_ERR_DEVICE_NO_PAPER, SANE_EVENT_SCAN_FINISHED, status_);
notify_ui_working_status(STATU_DESC_HG_ERR_DEVICE_NO_PAPER, SANE_EVENT_ERROR, status_);
HG_VLOG_MINI_1(HG_LOG_LEVEL_WARNING, "device start status is(%s)\n", STATU_DESC_HG_ERR_DEVICE_NO_PAPER);
return ret;
}
@ -585,7 +585,8 @@ void hg_scanner_300::image_process(std::shared_ptr<std::vector<char>>& buffer)
//HG_LOGHG_LOG_LEVEL_DEBUG_INFO,"除色开启\r\n");
}
/////////////////////////////////////2222222222222222222222222222222222222//////////////////////////////////
hg_imgproc::customgamma(handle,false); //临时false
int tableLength = sizeof(custom_gamma_val_->table)/sizeof(custom_gamma_val_->table[0]);
hg_imgproc::customgamma(handle,custom_gamma_,custom_gamma_val_->table,tableLength);
if (img_conf_.pixtype == COLOR_MODE_24_BITS && img_conf_.hsvcorrect)
{

View File

@ -362,7 +362,7 @@ int hg_scanner_400::start(void)
if (ret == HG_ERR_DEVICE_SLEEPING)
{
status_ = ret;
notify_ui_working_status(STATU_DESC_HG_ERR_DEVICE_SLEEPING, SANE_EVENT_SCAN_FINISHED, status_);
notify_ui_working_status(STATU_DESC_HG_ERR_DEVICE_SLEEPING, SANE_EVENT_ERROR, status_);
HG_VLOG_MINI_1(HG_LOG_LEVEL_WARNING, "device start status is(%s)\n", STATU_DESC_HG_ERR_DEVICE_SLEEPING);
return ret;
}
@ -370,7 +370,7 @@ int hg_scanner_400::start(void)
if (ret == HG_ERR_DEVICE_NO_PAPER)
{
status_ = ret;
notify_ui_working_status(STATU_DESC_HG_ERR_DEVICE_NO_PAPER, SANE_EVENT_SCAN_FINISHED, status_);
notify_ui_working_status(STATU_DESC_HG_ERR_DEVICE_NO_PAPER, SANE_EVENT_ERROR, status_);
HG_VLOG_MINI_1(HG_LOG_LEVEL_WARNING, "device start status is(%s)\n", STATU_DESC_HG_ERR_DEVICE_NO_PAPER);
return ret;
}
@ -588,7 +588,8 @@ void hg_scanner_400::image_process(std::shared_ptr<std::vector<char>>& buffer)
//HG_VLOG_MINI_1(HG_LOG_LEVEL_DEBUG_INFO, "除色开启:%s\n",hg_scanner::strerr((hg_err)ret).c_str());
}
/////////////////////////////////////2222222222222222222222222222222222222//////////////////////////////////
hg_imgproc::customgamma(handle,false); //临时false
int tableLength = sizeof(custom_gamma_val_->table)/sizeof(custom_gamma_val_->table[0]);
hg_imgproc::customgamma(handle,custom_gamma_,custom_gamma_val_->table,tableLength);
if (img_conf_.pixtype == COLOR_MODE_24_BITS && img_conf_.hsvcorrect)
{

View File

@ -29,7 +29,7 @@ using namespace std;
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// functional ...
////////////////////////////////////////////////////////////////////////////////
// NEWflow ...
// NEW£¬flow ...
static int num=0;
namespace hg_imgproc
@ -127,7 +127,7 @@ namespace hg_imgproc
if(buffs.empty())
return -1;
/////cmake褰撲腑杩涜<EFBFBD>瀹氫箟銆€mips64銆€//鍦╩ips64涓嬩娇鐢╮eset浼氬<E6B5BC>鑷村穿婧?
/////cmake当中进行定义 mips64 //在mips64下使用reset会导致崩<E887B4>?
//#ifndef mips64
//printf("\n buffer_ reset");
buffer_.reset(new std::vector<char >());
@ -452,7 +452,7 @@ namespace hg_imgproc
return ret;
}
int customgamma(int is_customgamma)
int customgamma(bool is_customgamma,unsigned char* table,int tableLength)
{
int ret = HG_ERR_OK;
std::vector<cv::Mat> mats(mats_);
@ -460,7 +460,8 @@ namespace hg_imgproc
if(is_customgamma)
{
//CImageApplyCustomGamma gamme(); //鏆傜暀
CImageApplyCustomGamma gamme(table,tableLength);
gamme.apply(mats,img_conf_.is_duplex);
}
else
{
@ -474,14 +475,12 @@ namespace hg_imgproc
justColors.apply(mats[i],img_conf_.is_duplex);
}
}
mats_ = mats;
//cv::imwrite("/home/huagao/Desktop/customgamma2.jpg",mats_[0]);
}
mats_ = mats;
return ret;
}
//闃叉<EFBFBD>娓楅€?
//防止渗<EFBFBD>?
int antiInflow(int permeate_lv)
{
int ret = HG_ERR_OK;
@ -549,7 +548,7 @@ namespace hg_imgproc
#endif
return ret;
}
//闄ょ綉绾?
//除网<EFBFBD>?
int textureRemove()
{
int ret = HG_ERR_OK;
@ -623,7 +622,7 @@ namespace hg_imgproc
std::vector<cv::Mat> mats(mats_);
mats_.clear();
double threshold = 40; //榛樿<EFBFBD>?
double threshold = 40; //默认<EFBFBD>?
int edge = 150;
CImageApplyDiscardBlank(threshold,edge,img_conf_.discardblank_percent);
@ -639,7 +638,7 @@ namespace hg_imgproc
}
return ret;
}
//绛旈<EFBFBD>鍗″嚭绾?
//答题卡出<EFBFBD>?
int answerSheetFilterRed()
{
int ret = HG_ERR_OK;
@ -830,9 +829,9 @@ namespace hg_imgproc
{
return ((imgproc*)himg)->channel();
}
int customgamma(HIMGPRC himg,int is_custogamma)
int customgamma(HIMGPRC himg,bool is_custogamma,unsigned char* table,int tableLength)
{
return ((imgproc*)himg)->customgamma(is_custogamma);
return ((imgproc*)himg)->customgamma(is_custogamma,table,tableLength);
}
int antiInflow(HIMGPRC himg,int permeate_lv)
{

View File

@ -178,7 +178,7 @@ namespace hg_imgproc
int resolution_change(HIMGPRC himg);
int croprect(HIMGPRC himg);
int channel(HIMGPRC himg);
int customgamma(HIMGPRC himg,int is_custogamma);
int customgamma(HIMGPRC himg,bool is_custogamma,unsigned char* table,int tableLength);
int antiInflow(HIMGPRC himg,int permeate_lv);
int colorCorrection(HIMGPRC himg);
int orentation(HIMGPRC himg);