Ask Your Question

How to chosse the last parameter of connectedComponents

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

Hi,guys. My problem is about connectedComponents.

I konw , If img is CV_8U


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

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

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


thanks!It helps

jsxyhelu gravatar imagejsxyhelu ( 2017-02-26 08:31:40 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


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

Seen: 91 times

Last updated: Feb 25 '17