Ask Your Question
0

How to get length and width of a bounding box?

asked 2014-02-18 02:14:23 -0600

York gravatar image

I want to identify the length and width of a bounding box in OpenCV, any functions I need in the LIB? please give me some tips,ideas~

MUCH THANKS IN ADVANCE!!!

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
2

answered 2014-02-18 03:04:19 -0600

Basically a bounding box is stored as a rectangle. This means that you have the following parameters stored

EITHER

  • Left top corner point
  • Right bottom corner point

OR

  • Left top corner point
  • Width and height

In both cases you can use the properties of a rectangle to access it dimensions. A small code snippet

Rectangle retrieved_rectangle;
int width = retrieved_rectangle.width;
int heigth = retrieved_rectangle.heigth;
edit flag offensive delete link more

Comments

1

the reply is exciting ! so good,so thanks!

York gravatar imageYork ( 2014-02-18 05:12:44 -0600 )edit
1

Keep in mind to accept the answer once you have 50 karma points ;)

StevenPuttemans gravatar imageStevenPuttemans ( 2014-02-18 07:27:20 -0600 )edit
1

sorry,IM new ,so how to get karma points?and whats that ps:im a chinese unfamiliar to foreign website due to the“ great wall “

York gravatar imageYork ( 2014-02-18 09:32:54 -0600 )edit

Basically you can get karma points by posting questions or getting upvotes on your reactions. Just keep a steady activity at the forum and you will receive it rather soon.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-02-19 01:42:39 -0600 )edit

Question Tools

Stats

Asked: 2014-02-18 02:14:23 -0600

Seen: 7,253 times

Last updated: Feb 18 '14