Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

thank you all for the response. I have finally solved it as per your suggestions

if (good_matches.size() >= 4){
line(img_matches, scene_corners[0] + Point2f(src.cols, 0), scene_corners[1] + Point2f(src.cols, 0), Scalar(0, 255, 0), 4);
line(img_matches, scene_corners[1] + Point2f(src.cols, 0), scene_corners[2] + Point2f(src.cols, 0), Scalar(0, 255, 0), 4);
line(img_matches, scene_corners[2] + Point2f(src.cols, 0), scene_corners[3] + Point2f(src.cols, 0), Scalar(0, 255, 0), 4);
line(img_matches, scene_corners[3] + Point2f(src.cols, 0), scene_corners[0] + Point2f(src.cols, 0), Scalar(0, 255, 0), 4);
}

as per @StevenPuttemans suggestion i managed to reinitialize scene_vector inside the capture loop. And its working perfectly fine.