diff --git a/sdk/imgprc/imgprc_mgr.cpp b/sdk/imgprc/imgprc_mgr.cpp index ad0b164..761536e 100644 --- a/sdk/imgprc/imgprc_mgr.cpp +++ b/sdk/imgprc/imgprc_mgr.cpp @@ -128,9 +128,9 @@ void imgproc_mgr::dump_real(const std::vector& img, const char* aft char name[128] = { 0 }; int ind = 0; - sprintf(name, "%04x-%d-%d-%04x-%s", v.info.paper_ind, v.info.paper_side, v.info.split_ind, pos, after); + sprintf(name, "%04x-%04x-%d-%d-%s", v.info.paper_ind, pos, v.info.paper_side, v.info.split_ind, after); while(std::find(existing.begin(), existing.end(), name) != existing.end()) - sprintf(name, "%04x-%d-%d-%04x-%s(%d)", v.info.paper_ind, v.info.paper_side, v.info.split_ind, pos, after, ++ind); + sprintf(name, "%04x-%04x-%d-%d-%s(%d)", v.info.paper_ind, pos, v.info.paper_side, v.info.split_ind, after, ++ind); existing.push_back(name); cv::imwrite((root + name + ".jpg").c_str(), v.img); } @@ -150,17 +150,17 @@ std::string imgproc_mgr::dump_usb_img_real(uint8_t* data, size_t bytes, HGIMGINF else tail = ""; - sprintf(name, "%04x-usb%s%s", info->paper_ind, tail_leader, tail); + sprintf(name, "%04x-0000-0-0-usb%s%s", info->paper_ind, tail_leader, tail); { // check repeat ... - dst = fopen((root + name + ".jpg").c_str(), "rb"); - while (dst) - { - fclose(dst); - sprintf(name, "%04x-usb%s%s(%d)", info->paper_ind, tail_leader, tail, ++ind); - dst = fopen((root + name + ".jpg").c_str(), "rb"); - } + //dst = fopen((root + name + ".jpg").c_str(), "rb"); + //while (dst) + //{ + // fclose(dst); + // sprintf(name, "%04x-0000-0-0-usb%s%s(%d)", info->paper_ind, tail_leader, tail, ++ind); + // dst = fopen((root + name + ".jpg").c_str(), "rb"); + //} } dst = fopen((root + name + ".jpg").c_str(), "wb"); @@ -312,7 +312,7 @@ int imgproc_mgr::load_processor(const char* path) { \ cls *obj = new cls(); \ opts_->add(obj); \ - obj->release(); \ + processors_.push_back(obj); \ } ADD_IMG_PROCESSOR(hole_filler); @@ -334,7 +334,7 @@ int imgproc_mgr::clear(void) int imgproc_mgr::process(HGIMGINFO* info, uint8_t* data, size_t bytes, std::vector& out) { std::vector mid[2], in, *src = &in, * dst = &mid[0]; - int ret = decode(info, data, bytes, in), sn = 0; + int ret = decode(info, data, bytes, in), sn = 0, ind = 0; if (ret == SCANNER_ERR_OK) {