25 lines
1.1 KiB
C++
25 lines
1.1 KiB
C++
#include <baoMo.hpp>
|
|
#include <yuhan.hpp>
|
|
#include <RLJ.hpp>
|
|
int main(int argc, char* argv[])
|
|
{
|
|
//rlj_hanyin("D:\\º¸Ó¡Image\\11.20\\T\\NG", "bmp", "./outputs/", cv::Size(300, 300));
|
|
//yuhan_hanqian("D:\\testImage\\OK", "bmp", "./outputs/" , cv::Size(300, 300));
|
|
// yuhan_hanqian("D:\\testImg\\L", "bmp", "./outputs/", cv::Size(50, 50));
|
|
cv::Mat img = cv::imread("D:\\testImage\\cutImageTest (2).bmp", -1);
|
|
img(cv::Rect(1000, 1500, 2350, 1020)).copyTo(img);
|
|
cv::Mat imgR = cv::imread("D:\\testImage\\cutImageTest (1).bmp", -1);
|
|
std::vector<std::vector<cv::Point>> contours;
|
|
cv::findContours(imgR, contours, cv::RETR_EXTERNAL, cv::CHAIN_APPROX_SIMPLE);
|
|
std::vector<std::vector<cv::Mat>> allCutImgs;
|
|
std::vector<cv::Mat> samples;
|
|
for (auto& contour : contours) {
|
|
//755 4300 60 300
|
|
auto imgs = cutImg2ClsVec(cv::boundingRect(contour), img);
|
|
allCutImgs.push_back(imgs);
|
|
samples.push_back(img(cv::boundingRect(contour)));
|
|
}
|
|
auto imgs = cutImg2ClsVec(cv::Rect(370, 320, 384, 70), img);
|
|
cv::Mat sa = img(cv::Rect(370, 320, 384, 70));
|
|
return 1;
|
|
} |