Ask Your Question
0

Object dimension calculation using pixel in a image

asked 2014-05-20 09:08:32 -0600

himsha gravatar image

Hi, I am new with opencv, my problem is to convert image in binary format and than scan its pixel if pixel get white draw outline of that object and measure its dimension jpeg is attached.

Is this is possible using opencv and If someone got piece of code than it be great.

image description

Thanks in advance..

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-05-20 11:29:11 -0600

Haris gravatar image

Try

  1. Find contour.

  2. Find rotated rectangle for the contour.

  3. Consider the rotated rectangle size as your object size.

In short,

Contour-->RotatedRect 
              | 
              '-->  Size2f size
                            |
                            |-->width
                            '-->height

Also see the answer here might be helpful.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-05-20 09:08:32 -0600

Seen: 1,266 times

Last updated: May 20 '14