mirror of http://192.168.1.51:8099/lmh188/twain3.0
除背景色二值化阈值调整为50(100-50) --23.02.21
This commit is contained in:
parent
2fdaa65f98
commit
f82353257c
|
@ -82,3 +82,4 @@
|
||||||
3.调整msvc与mfc链接顺序,默认开启多核编译
|
3.调整msvc与mfc链接顺序,默认开启多核编译
|
||||||
4.添加色偏算法
|
4.添加色偏算法
|
||||||
5.UI开放色偏校正,增加色偏校正协议 --23.01.05
|
5.UI开放色偏校正,增加色偏校正协议 --23.01.05
|
||||||
|
6.除背景色二值化阈值调整为50(100-50) --23.02.21
|
|
@ -262,8 +262,6 @@ void GScan439Android::Scanner_StartScan(UINT16 count)
|
||||||
}
|
}
|
||||||
write_reg(m_usb, 0x1000, m_param.is_duplex ? m_param.scannum /2 : m_param.scannum);
|
write_reg(m_usb, 0x1000, m_param.is_duplex ? m_param.scannum /2 : m_param.scannum);
|
||||||
scanner_control(m_usb, SC_START);
|
scanner_control(m_usb, SC_START);
|
||||||
|
|
||||||
|
|
||||||
if (!m_usbthread.get()) {
|
if (!m_usbthread.get()) {
|
||||||
b_usbthread = true;
|
b_usbthread = true;
|
||||||
m_usbthread.reset(new thread(&GScan439Android::usbmainloop, this));
|
m_usbthread.reset(new thread(&GScan439Android::usbmainloop, this));
|
||||||
|
|
|
@ -80,7 +80,7 @@ static std::map<PaperStatus, unsigned int> SupPaperTyps = {
|
||||||
#ifdef G300
|
#ifdef G300
|
||||||
{{TwSS::None,PaperAlign::Rot0},G400_A4},
|
{{TwSS::None,PaperAlign::Rot0},G400_A4},
|
||||||
#else // G300
|
#else // G300
|
||||||
{{TwSS::None,PaperAlign::Rot0},G400_A3},
|
{{TwSS::None,PaperAlign::Rot0}, G400_A3},
|
||||||
#endif
|
#endif
|
||||||
{{TwSS::MaxSize,PaperAlign::Rot0},G400_LONGLETTER},
|
{{TwSS::MaxSize,PaperAlign::Rot0},G400_LONGLETTER},
|
||||||
{{TwSS::USStatement,PaperAlign::Rot0},G400_LONGLETTER},
|
{{TwSS::USStatement,PaperAlign::Rot0},G400_LONGLETTER},
|
||||||
|
@ -121,6 +121,7 @@ enum HGType
|
||||||
IMG,
|
IMG,
|
||||||
AutoCorrect,
|
AutoCorrect,
|
||||||
STOPSCAN,
|
STOPSCAN,
|
||||||
|
CMD_OUT,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct HGEIntInfo
|
struct HGEIntInfo
|
||||||
|
@ -206,6 +207,9 @@ enum Scanner_Reg_Defs
|
||||||
SR_GET_TOKEN_LENGHT,
|
SR_GET_TOKEN_LENGHT,
|
||||||
SR_DECODE_TOKEN,
|
SR_DECODE_TOKEN,
|
||||||
SR_CLEAN_PAPER_ROAD,
|
SR_CLEAN_PAPER_ROAD,
|
||||||
|
SR_EXECUTE_CMD,
|
||||||
|
SR_EXECUTE_CMD_OUT_LENGHT,
|
||||||
|
SR_GET_EXECUTE_CMD_OUT,
|
||||||
SR_GET_CUO_ERROR = 0x50,
|
SR_GET_CUO_ERROR = 0x50,
|
||||||
SR_GET_DOU_ERROR,
|
SR_GET_DOU_ERROR,
|
||||||
SR_GET_JAM_ERROR,
|
SR_GET_JAM_ERROR,
|
||||||
|
|
|
@ -210,7 +210,7 @@ void ImageMatQueue::setparam(const GScanCap& param)
|
||||||
|
|
||||||
if (param.fadeback)//&& param.pixtype == 2
|
if (param.fadeback)//&& param.pixtype == 2
|
||||||
{
|
{
|
||||||
m_iaList.push_back(shared_ptr<CImageApply>(new CImageApplyFadeBackGroudColor(100,0,param.fadeback_range)));
|
m_iaList.push_back(shared_ptr<CImageApply>(new CImageApplyFadeBackGroudColor(50,0,param.fadeback_range)));
|
||||||
}
|
}
|
||||||
//filter 0 r 1 g 2 b 3 none enhance color 0 none 1 r 2 g 3 b
|
//filter 0 r 1 g 2 b 3 none enhance color 0 none 1 r 2 g 3 b
|
||||||
if (param.filter != 3 || param.enhance_color) {
|
if (param.filter != 3 || param.enhance_color) {
|
||||||
|
@ -764,6 +764,11 @@ void ImageMatQueue::duplex_process(CacheInfo info)
|
||||||
uvmats.clear();
|
uvmats.clear();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//string path = FileTools::get_appdata_path() + to_string(m_snowflake.nextid()) + ".jpg";
|
||||||
|
//cv::imwrite(path, mats[0]);
|
||||||
|
//path = FileTools::get_appdata_path() + to_string(m_snowflake.nextid()) + ".jpg";
|
||||||
|
//cv::imwrite(path, mats[1]);
|
||||||
FileTools::writelog(log_DEBUG, " image process finish");
|
FileTools::writelog(log_DEBUG, " image process finish");
|
||||||
if (!scanParam.is_duplex && mats.size() > 1) {
|
if (!scanParam.is_duplex && mats.size() > 1) {
|
||||||
mats.pop_back();
|
mats.pop_back();
|
||||||
|
@ -772,6 +777,8 @@ void ImageMatQueue::duplex_process(CacheInfo info)
|
||||||
{
|
{
|
||||||
splitimg(mats);
|
splitimg(mats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (int i = 0; i < mats.size(); i++) {
|
for (int i = 0; i < mats.size(); i++) {
|
||||||
if (!mats[i].empty()) {
|
if (!mats[i].empty()) {
|
||||||
IMat2Bmp idata;
|
IMat2Bmp idata;
|
||||||
|
|
|
@ -2603,9 +2603,10 @@ Result HuagaoDs::imageLayoutSet(const Identity& origin, ImageLayout& lay) {
|
||||||
Result HuagaoDs::imageLayoutReset(const Identity& origin, ImageLayout& data) {
|
Result HuagaoDs::imageLayoutReset(const Identity& origin, ImageLayout& data) {
|
||||||
return imageLayoutGet(origin, data);
|
return imageLayoutGet(origin, data);
|
||||||
}
|
}
|
||||||
|
static int xtfer = 0;
|
||||||
Result HuagaoDs::imageMemXferGet(const Identity& origin, ImageMemXfer& data) {
|
Result HuagaoDs::imageMemXferGet(const Identity& origin, ImageMemXfer& data) {
|
||||||
if (!m_pendingXfers) {
|
if (!m_pendingXfers) {
|
||||||
|
FileTools::writelog(log_INFO, "正在上传图片 ===> Twain imageNativeXferGet m_pendingXfers ");
|
||||||
return seqError();
|
return seqError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2617,13 +2618,16 @@ Result HuagaoDs::imageMemXferGet(const Identity& origin, ImageMemXfer& data) {
|
||||||
auto dib = header();
|
auto dib = header();
|
||||||
auto bpl = bytesPerLine();
|
auto bpl = bytesPerLine();
|
||||||
auto memSize = data.memory().size();
|
auto memSize = data.memory().size();
|
||||||
|
FileTools::writelog(log_INFO, "正在上传图片 ===> Twain imageNativeXferGet size error setup.maxsize = " + to_string(setup.maxSize()) +" setup.minsize "+ to_string(setup.minSize()));
|
||||||
if (memSize > setup.maxSize() || memSize < setup.minSize()) {
|
if (memSize > setup.maxSize() || memSize < setup.minSize()) {
|
||||||
|
FileTools::writelog(log_INFO, "正在上传图片 ===> Twain imageNativeXferGet size error data.size = "+to_string(memSize) );
|
||||||
return badValue();
|
return badValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto maxRows = memSize / bpl;
|
auto maxRows = memSize / bpl;
|
||||||
auto rows = std::min<UInt32>(maxRows, static_cast<UInt32>(dib->biHeight) - m_memXferYOff);
|
auto rows = std::min<UInt32>(maxRows, static_cast<UInt32>(dib->biHeight) - m_memXferYOff);
|
||||||
if (rows == 0) {
|
if (rows == 0) {
|
||||||
|
FileTools::writelog(log_INFO, "正在上传图片 ===> Twain imageNativeXferGet rows == 0");
|
||||||
return seqError(); // image already transfered in this session
|
return seqError(); // image already transfered in this session
|
||||||
}
|
}
|
||||||
cv::Mat mat;
|
cv::Mat mat;
|
||||||
|
@ -2678,13 +2682,14 @@ Result HuagaoDs::imageMemXferGet(const Identity& origin, ImageMemXfer& data) {
|
||||||
m_pendingXfers = 0;
|
m_pendingXfers = 0;
|
||||||
m_memXferYOff = 0;
|
m_memXferYOff = 0;
|
||||||
//bmpData.reset(new std::vector<unsigned char>);
|
//bmpData.reset(new std::vector<unsigned char>);
|
||||||
|
FileTools::writelog(log_INFO, "正在上传图片 ===> Twain imageNativeXferGet m_memXferYOff transfered num of " + to_string(++xtfer) + " images");
|
||||||
return { ReturnCode::XferDone, ConditionCode::Success };
|
return { ReturnCode::XferDone, ConditionCode::Success };
|
||||||
}
|
}
|
||||||
|
FileTools::writelog(log_INFO, "正在上传图片 ===> Twain imageNativeXferGet transfered num of " + to_string(++xtfer) + " images");
|
||||||
return success();
|
return success();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int xtfer = 0;
|
|
||||||
Result HuagaoDs::imageNativeXferGet(const Identity& id, ImageNativeXfer& data) {
|
Result HuagaoDs::imageNativeXferGet(const Identity& id, ImageNativeXfer& data) {
|
||||||
if (!m_pendingXfers) {
|
if (!m_pendingXfers) {
|
||||||
return seqError();
|
return seqError();
|
||||||
|
|
BIN
huagao/stdafx.h
BIN
huagao/stdafx.h
Binary file not shown.
Loading…
Reference in New Issue