가능한 중복 :
Understanding region of interest in openCV 2.4OpenCV의 서브 이미지
내가 이미지에서 서브 이미지 (아래 빨간색 상자에 의해 둘러싸인 하나) 싶어 (매트 포맷). 어떻게해야합니까?
여기 내 진행 지금까지의 :
include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace std;
using namespace cv;
int main()
{
Mat imgray, thresh;
vector<vector<Point> >contours;
vector<Point> cnt;
vector<Vec4i> hierarchy;
Point leftmost;
Mat im = imread("igoy1.jpg");
cvtColor(im, imgray, COLOR_BGR2GRAY);
threshold(imgray, thresh, 127, 255, 0);
findContours(thresh, contours, hierarchy, RETR_TREE,CHAIN_APPROX_SIMPLE);
}
이 질문은 이미 질문하고, 답 ([여기] 적어도 http://stackoverflow.com/questions/12705817/understanding-region-of-interest- in-opencv-2-4/12706208 # 12706208) 및 [there] (http://stackoverflow.com/questions/12369697/access-sub-matrix-of-a-multidimensional-mat-in-opencv/12370641#12370641) – remi