Ask Your Question

Revision history [back]

Crop a rectangle using: vector<vector<point>> squares

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]

click to hide/show revision 2
retagged

updated 2014-05-18 13:18:13 -0600

berak gravatar image

Crop a rectangle using: vector<vector<point>> squares

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]