拆分调整

This commit is contained in:
13038267101 2022-09-26 18:46:04 +08:00
parent fb3251054d
commit fedd3116d9
1 changed files with 15 additions and 14 deletions

View File

@ -325,11 +325,11 @@ namespace hg_imgproc
int split(int multioutputtype,bool is_msplit,bool is_multiout_red,int colortype,bool is_duplex,int split3399,bool fpga_ver) int split(int multioutputtype,bool is_msplit,bool is_multiout_red,int colortype,bool is_duplex,int split3399,bool fpga_ver)
{ {
std::vector<cv::Mat> mats(mats_); std::vector<cv::Mat> mats(mats_);
CImageApplySplit split(multioutputtype, is_msplit, is_multiout_red, colortype);;
mats_.clear(); mats_.clear();
CImageApplySplit split(multioutputtype, is_msplit, is_multiout_red, colortype);;
auto matexs = split.SplitMats(mats,is_duplex); auto matexs = split.SplitMats(mats,is_duplex);
std::string filename ; std::string filename ;
int rotation01_ = 1; int rotation01_ = 1;
int rotation02_ = 1; int rotation02_ = 1;
@ -341,9 +341,9 @@ namespace hg_imgproc
int i = 0; int i = 0;
for(auto &matex : matexs) for(auto &matex : matexs)
{ {
cv::flip(matex.mat,matex.mat,rotation01_); cv::flip(matex.mat, matex.mat, rotation01_);
cv::flip(matex.mat,matex.mat,rotation02_); cv::flip(matex.mat,matex.mat,rotation02_);
if (i > 1 && (pid_ == 0x402 || pid_ == 0x100 || pid_ == 0x400)) if (i > 1 && ((pid_ == 0x402) || pid_ == 0x100 || pid_ == 0x400))
{ {
cv::flip(matex.mat,matex.mat,-1); cv::flip(matex.mat,matex.mat,-1);
} }
@ -359,14 +359,14 @@ namespace hg_imgproc
case 0x100: case 0x100:
rotatetype = CImageApplyRotation::RotationType::Rotate_90_anti_clockwise; rotatetype = CImageApplyRotation::RotationType::Rotate_90_anti_clockwise;
break; break;
case 0x402 || 0x400: case 0x402:
rotatetype = CImageApplyRotation::RotationType::Rotate_90_clockwise; rotatetype = CImageApplyRotation::RotationType::Rotate_90_clockwise;
break; break;
case 0x400: case 0x400:
rotatetype = CImageApplyRotation::RotationType::Rotate_90_clockwise; rotatetype = CImageApplyRotation::RotationType::Rotate_90_clockwise;
break; break;
} }
CImageApplyRotation Rotation(rotatetype,img_conf_.is_backrotate180,img_conf_.resolution_native,"./tessdata"); CImageApplyRotation Rotation(rotatetype,false,img_conf_.resolution_native,"./tessdata");
Rotation.apply(mats_,img_conf_.is_duplex); Rotation.apply(mats_,img_conf_.is_duplex);
} }
@ -685,13 +685,14 @@ namespace hg_imgproc
if (img_conf_.is_autotext) if (img_conf_.is_autotext)
rotatetype = CImageApplyRotation::RotationType::AutoTextOrientation; rotatetype = CImageApplyRotation::RotationType::AutoTextOrientation;
/*#if defined(WIN32) || defined(_WIN64)
char szIniFile[MAX_PATH] = {0}; unsigned char back180 = false;
SHGetSpecialFolderPathA(NULL, szIniFile, CSIDL_WINDOWS, TRUE); if (img_conf_.splitImage)
strcat(szIniFile, "\\twain_32\\HuaGoScan\\tessdata"); unsigned char back180 = false;
// m_iaList.push_back(shared_ptr<CImageApply>(new CImageApplyRotation(rotatetype, imgparams.BackRotate180, imgparams.DestResulution, szIniFile))); else
#else // WIN32*/ back180 = img_conf_.is_backrotate180;
CImageApplyRotation Rotation(rotatetype,img_conf_.is_backrotate180,img_conf_.resolution_native,"./tessdata");
CImageApplyRotation Rotation(rotatetype, back180,img_conf_.resolution_native,"./tessdata");
Rotation.apply(mats,img_conf_.is_duplex); Rotation.apply(mats,img_conf_.is_duplex);
mats_ = mats; mats_ = mats;