Crop a rectangle using: vector<vector<Point>> squares [closed]
I have a code that draws a square drive plate and would use it if it were possible to make a cut in the image storing the car plate in another image, if possible, how do I? I already tried using ROI
the code:
void Process::drawSquares(char* adress, vector<vector<Point>>& squares){
Mat plate = imread(adress, CV_LOAD_IMAGE_COLOR);
for( size_t i = 0; i < squares.size(); i++ ){
const Point* p = &squares[i][0];
int n = (int)squares[i].size();
polylines(plate, &p, &n, 1, true, Scalar(0,255,0), 3, CV_AA);
}
imshow("Plate", plate);
waitKey(0);
}
vector<vector<point>>& squares is a vector that stores several square but the this time I store only one square: plate of the car (I want make the cut)
I tried used ROI but but I could not make it work. for more details of my project as a whole. My emails: [email protected] / [email protected]
what went wrong, when you tried it ?
thank you very much berak, I tried but not used boundingRect (). ,this is the first time I see THANK YOU