# How to detect object is perpendicular to camera optical axis?

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?

edit retag close merge delete

this might work for the xy plane

(and note, that it's probably impossible for objects in the yz plane, with a single camera)

( 2018-04-04 04:12:01 -0500 )edit

In a video for a fixed distance I would say when visible surface is minimum

( 2018-04-04 04:28:54 -0500 )edit
1

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.

( 2018-04-04 07:55:08 -0500 )edit

@chamoda, may i ask,which problem you're trying to solve in the "real world" with this ?

( 2018-04-05 02:32:55 -0500 )edit
1

@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.

( 2018-04-05 02:38:47 -0500 )edit