Powiel możliwe:
Understanding region of interest in openCV 2.4OpenCV sub-obraz z obrazu Mat
chcę uzyskać sub-obraz (ten ograniczony przez czerwone pole poniżej) z obrazu (Format maty). jak mam to zrobic?
oto moja postęp do tej pory:
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);
}
To pytanie jak to już zostało zadane i odpowiedzi, przynajmniej [tutaj] (http://stackoverflow.com/questions/12705817/understanding-region-of-interest- in-opencv-2-4/12706208 # 12706208) i [tam] (http://stackoverflow.com/questions/12369697/access-sub-matrix-of-i-multidimensional-mat-in-opencv/12370641#12370641) – remi