Reputation: 2244
I am working on an android project using opencv.I'm following some tutorial in internet ,have done "How to capture Image using Opencv,show in ImageView,Here is the Code for that ,
https://gist.github.com/manikavi/46cbdedba34d338c201f5cea6242fd2a
Next my requirement is mark width & height on Captured image and get Size of that .(Image is added here)
Is it possible in opencv,If yes Can I get help to do this?
Upvotes: 0
Views: 468
Reputation: 31
The first step is to obtain the extreme points of the contour. Without them nothing will be done.
I know 3 methods to perform the measurement.
First and simplest, is to have a reference pattern next to the object whose measurement is previously known. The measurement is simply obtained with the rule of three.
If you previously know the distance between the object and the camera lens, you should calculate the size of the object using trigonometry. You compare the previously known distance with the angle formed between the detected point and the line 0 point of the camera.
A third method is using epipolar geometry. With this it's not necessary to know in advance the distance between the camera and the object. The reference for the trigonometric calculation is the angles of the reference point in relation to line 0 of each lens.
Upvotes: 1