Wiki | Community | Discussion Forum | Q&A

Obtain a certain region of vision

Hi community:

I’m struggling with how to obtain the furthest vision region of my camera. This is in reality how to take a specific region of the image and then process it to contour it in order to have some interesting values like area, center of mass etc. I’ve done some research and maybe using moments in openCV could be the way to follow, but I don’t know how to obtain an specific area from the total area calculated with moments.

PS: I’ve tried to crop the original image to obtain the parts I want and then process the result, but this procedure doesn’t work properly in this environment.

Thank you in advance.

This image represents the area or the mask (white one) that I want to obtain.

image

Hi @pabs_sc,

image cropping or ROIs (Region of Interest) are good ways to go. Take a look at https://stackoverflow.com/questions/9084609/how-to-copy-a-image-region-using-opencv-in-python or
https://stackoverflow.com/questions/15589517/how-to-crop-an-image-in-opencv-using-python

I would not crop only the red rectangle you show, I would crop a whole horizontal region close to the horizon line. In case of the Formula1 car far deviating from the red line in the road, it may appear side areas of the image…

Cheers

Hi!

I got it!, I was using that method but I didn’t adjust correctly the values to obtain the desired area.

Thank you for your quick response!

image