diff --git a/include/easypr/core/plate_locate.h b/include/easypr/core/plate_locate.h index 1f61e4f4..89cb5716 100644 --- a/include/easypr/core/plate_locate.h +++ b/include/easypr/core/plate_locate.h @@ -56,7 +56,7 @@ class CPlateLocate { int colorSearch(const Mat& src, const Color r, Mat& out, - std::vector& outRects, int index = 0); + std::vector& outRects); int mserSearch(const Mat &src, vector& out, vector>& out_plateVec, bool usePlateMser, vector>& out_plateRRect, diff --git a/resources/image/test.jpg b/resources/image/test.jpg new file mode 100644 index 00000000..7750ed0e Binary files /dev/null and b/resources/image/test.jpg differ diff --git a/src/core/plate_locate.cpp b/src/core/plate_locate.cpp index c7daa4c8..b1a8e52a 100644 --- a/src/core/plate_locate.cpp +++ b/src/core/plate_locate.cpp @@ -108,7 +108,7 @@ int CPlateLocate::mserSearch(const Mat &src, vector &out, int CPlateLocate::colorSearch(const Mat &src, const Color r, Mat &out, - vector &outRects, int index) { + vector &outRects) { Mat match_grey; // width is important to the final results; @@ -118,9 +118,9 @@ int CPlateLocate::colorSearch(const Mat &src, const Color r, Mat &out, colorMatch(src, match_grey, r, false); - if (m_debug) { - utils::imwrite("resources/image/tmp/match_grey.jpg", match_grey); - } + //if (m_debug) { + // utils::imwrite("resources/image/tmp/match_grey.jpg", match_grey); + //} Mat src_threshold; threshold(match_grey, src_threshold, 0, 255, @@ -130,9 +130,9 @@ int CPlateLocate::colorSearch(const Mat &src, const Color r, Mat &out, MORPH_RECT, Size(color_morph_width, color_morph_height)); morphologyEx(src_threshold, src_threshold, MORPH_CLOSE, element); - if (m_debug) { - utils::imwrite("resources/image/tmp/color.jpg", src_threshold); - } + //if (m_debug) { + // utils::imwrite("resources/image/tmp/color.jpg", src_threshold); + //} src_threshold.copyTo(out); @@ -722,19 +722,21 @@ int CPlateLocate::plateColorLocate(Mat src, vector &candPlates, vector plates_yellow; plates_yellow.reserve(64); + Mat src_clone = src.clone(); + + Mat src_b_blue; + Mat src_b_yellow; #pragma omp parallel sections { #pragma omp section { - Mat src_b_blue; - colorSearch(src, BLUE, src_b_blue, rects_color_blue, index); + colorSearch(src, BLUE, src_b_blue, rects_color_blue); deskew(src, src_b_blue, rects_color_blue, plates_blue, true, BLUE); } #pragma omp section { - Mat src_b_yellow; - colorSearch(src, YELLOW, src_b_yellow, rects_color_yellow, index); - deskew(src, src_b_yellow, rects_color_yellow, plates_yellow, true, YELLOW); + colorSearch(src_clone, YELLOW, src_b_yellow, rects_color_yellow); + deskew(src_clone, src_b_yellow, rects_color_yellow, plates_yellow, true, YELLOW); } } diff --git a/test/plate.hpp b/test/plate.hpp index a70c257e..cc2b45e8 100644 --- a/test/plate.hpp +++ b/test/plate.hpp @@ -17,8 +17,8 @@ int test_plate_locate() { vector resultVec; CPlateLocate plate; - plate.setDebug(1); - plate.setLifemode(true); + //plate.setDebug(0); + //plate.setLifemode(true); int result = plate.plateLocate(src, resultVec); if (result == 0) {