Ask Your Question
0

How to chosse the last parameter of connectedComponents

asked 2017-02-25 18:17:12 -0600

Hi,guys. My problem is about connectedComponents.

I konw , If img is CV_8U

connectedComponents(img,labels,8,CV_16U);

it works.

But when img is CV_32F how to chosse the last parameter?

I tried CV_64F,CV_32F and others,but all crashed. Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-02-25 19:33:35 -0600

Tetragramm gravatar image

The last variable is the type of the labels output. If you use CV_8U, you can only have 255 components. CV_16U is 65535 components. CV_32S is a lot.

Those are the possible choices. CV_32S is just a good choice. It's not much slower than the others, and it can have all the components.

edit flag offensive delete link more

Comments

thanks!It helps

jsxyhelu gravatar imagejsxyhelu ( 2017-02-26 08:31:40 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-02-25 18:17:12 -0600

Seen: 179 times

Last updated: Feb 25 '17