Ask Your Question

Revision history [back]

Hmm @Haris I think you are making it way to difficult. If I understood it correctly he already found the 3 corners using template matching, this he has the coordinates of those points. What I suggest is making a region of interest based on those points, using a Rect element and then do a deep copy using

Rect ROI(Point(x1,y1), Point(x2,y2));
Mat table = original( ROI ).clone();

Hmm @Haris I think you are making it way to difficult. If I understood it correctly he already found the 3 corners using template matching, this he has the coordinates of those points. What I suggest is making a region of interest based on those points, using a Rect element and then do a deep copy using

Rect ROI(Point(x1,y1), Point(x2,y2));
Mat table = original( ROI ).clone();

EDIT: lets add how to add the coordinates of the ROI.

Imaging marker top_right, bottom_left and bottom_right. I consider that each marker is now defined by a rectangle which you visualise. Then you can calculate the location based on:

int x1 = top_right.x;
int y1 = top_right.y + top_right.height;
int x2 = bottom_left.x + top_left.width;
int y2 = bottom_left.y;