Opencv C++: how to translate points from bounding box to original image

I am extracting some bounding boxes and then performing hough transforms on it. I will then draw circles within the bounding box cropped image.

 auto violaJonesDetections = get_detections(orig_frame);

for (auto &rect: violaJonesDetections) {
        auto violaJonesFrame = orig_frame(rect);
        vector<Circle> circles = houghCircles(violaJonesFrame,...);
        drawCircles(circles, violaJonesFrame);

My goal is, I want to draw the circles on the original image.

For that, I will have to somehow translate my circle points from the cropped imgage to the original image.

I am not sure how to to go about this. Could someone show me a runnable example for how I can accomplish this with opencv c++?

Also, I need to generalize this translation logic for lines parameterized on rho and theta.

Archive from:


You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *