Reputation: 131
I having 2 images image(1) and image(2)
image(1): I placed camera on some fixed place and captured this image. I having box coordinates(xmin, ymin, xmax, ymax) which is shown by red bounding box. Also I having some region of interest(ROI) which is shown by blue box.
image(2): From top I am captured this image. Here also I just drawn box coordinates(xmin, ymin, xmax, ymax) which is shown by red bounding box. Also drawn region of interest(ROI) which is shown by blue box.
in image(1) we can see some intersection between the red box and blue box. But this intersection not the real one. because when we see the image from top view we can see there is no intersection between them as I showed in image(2).
So for image(1) I having red rectangle coordinates(xmin,ymin,xmax,ymax). This red rectangle contains the object. In that red rectangle I don't having the information about the object position/direction and visible corner points of object. (Because from object detector I only getting this red rectangle). Also, I have blue box(ROI) coordinates. Is there any way with the help of camera calibration(or any other computer vision method) to find this 2 boxes (Red rectangle and blue ROI) are not really intersecting in image(1)?
Upvotes: 0
Views: 357
Reputation: 20160
have a look at the attached image. You might have to zoom in. Remind that there is still lens distortion and I just used my hands to draw the lines, so not really accurate but hopefully enough to get the idea.
After calibrating the scene, you will know the ground plane in which the blue rectangle is defined and the object is lying on that ground plane. I just used the paper squares and directions, but the coordinate axes can be arbitrary.
You can compute the vanishing point of the object bounding box directions, which is the dark green lines intersection and the orange lines intersection (z direction vanishing point) and the cyan line intersection (y direction vanishing point). Orange and dark green lines are parallel in reality.
Now from the top-left corner point of the 3D object bounding box (Point C) which is above the ground plane, you can draw the line directly to the y direction vanishing point (left light green line) and the same for the top-right corner point of the bounding box (Point D) (right light green line). The intersection between the light green and the dark green lines are the points where the object hits the ground (intersection between the pink and the dark green and the light green lines). If some of those points or their intersetction intersects with your ROI, the object is really intersecting with that region on the ground plane.
You will need a way to determine the 2D image points of the 3D bounding box, which can be a hard problem itself. If you know a CAD model or 3D model of your object and you have the the camera intrinsics, there are some shape fitting models available in literature, for example from the company MVTec / Halcon who also has an implementation in their software. But if you are able to determine the 3D object points in 3D according to your scene and camera then you wont even need the vanishing point thing ;)
Upvotes: 1