How to detect object is perpendicular to camera optical axis? [closed]
I want to detect whether object is perpendicular to optical axis.
Sample input will be an image that has and object (cylinder shape similar to a bottle) in it and a mostly plain background.
Output will be a boolean determining whether that object is perpendicular to camera axis. This does not require to have much accuracy.
For example following image is not perpendicular to camera axis
Following image is not perpendicular too because camera angle is little bit from above
Next image is perpendicular and in the correct position
Is there any algorithm in OpenCV to do this?
this might work for the xy plane
(and note, that it's probably impossible for objects in the yz plane, with a single camera)
In a video for a fixed distance I would say when visible surface is minimum
First, it is necessary to define the concept "perpendicular". For planar objects it is obvious. All your examples are cylindrical. Also just elongated objects may be considered as a generalization. For all of them you need to determine the central axis (one straight line) and talk about perpendicularity of this line. It may be tricky if the camera doesn't look right at the object. If it does, I think that this task has no solution in general case. For example, how will you tell a perpendicular cone from turned cylinder? That is, you need the shape of the object.
@chamoda, may i ask,which problem you're trying to solve in the "real world" with this ?
@berak Doing some analytics on core samples https://en.wikipedia.org/wiki/Core_sa... . Trying to take a photo and analize the image for some features.
but then your images are misleading.
without proper context, anyone is solving an XY problem