संभव डुप्लिकेट:
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- इन-ओपनसीवी -2-4/12706208 # 12706208) और [वहां] (http://stackoverflow.com/questions/12369697/access-sub-matrix-of-a-multidimensional-mat-in-opencv/12370641#12370641) – remi