binary images connected component labelling (blobs)

300 views
Skip to first unread message

info gabor

unread,
Jun 20, 2010, 3:07:13 AM6/20/10
to ctypes...@googlegroups.com
Connected component labeling is available for opencv (either as cvblobslib in opencv site, or as cvblob in googlecode)
Is there pyopencv interface for it?

In pyopencvext I can find CvBlob class (and some related classes),
but I cannot find a method for detecting/filtering blobs (or labeling). 

If not available, how can I generate such an interface myself ? 

Thanks for any help!



Minh-Tri Pham

unread,
Jul 9, 2010, 6:54:37 PM7/9/10
to ctypes...@googlegroups.com
Apologies to everyone for my rather late reply. I have gone through a rather
long and busy period. From now, I will start looking at the current issues at
pyopencv. Hopefully, things will be back to normal gradually.

Cheers,
Minh-Tri

> --
> You received this message because you are subscribed to the Google Groups
> "ctypes-opencv" group.
> To post to this group, send email to ctypes...@googlegroups.com.
> To unsubscribe from this group, send email to
> ctypes-openc...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/ctypes-opencv?hl=en.

--
Dr. Minh-Tri Pham
Research Fellow, University of Surrey, UK
Email: t.p...@surrey.ac.uk or pmt...@gmail.com
Mob: +44 (0) 778 774 1089 | Tel: +44 (0) 148 368 4711

info gabor

unread,
Jul 14, 2010, 4:49:48 AM7/14/10
to ctypes...@googlegroups.com
Any help will be appreciated!

Minh-Tri Pham

unread,
Jul 16, 2010, 3:10:09 AM7/16/10
to ctypes...@googlegroups.com
Hi Gabor,

The code to generate code for wrapping class CvBlob and other related classes
are located at file src_gen/cvvidsurf_hpp.py at the main trunk. I will find
some time to write the code for you. What are the functions that use CvBlob?
Are they in OpenCV or in an external library?

Cheers,
Minh-Tri

info gabor

unread,
Jul 16, 2010, 11:59:35 AM7/16/10
to ctypes...@googlegroups.com
Thanks, Minh-Tri
I actually use the cvBlobslib available in opencv site
I use it (in C++ code) as the following excerpt exemplifies -

blobs = new CBlobResult( anImage, NULL, 0 );
blobs->Filter( * blobs, B_EXCLUDE, CBlobGetArea(), B_LESS, someVal);
.....
len = blobs->GetNumBlobs ();
for (i=0; i<len; i++) {
    avg[i] = blobs->GetBlob (i)->Mean (image);
    sum += blobs->GetBlob (i)->Area ();
  }

Any other blob library will do.

Do you have some tutorial/sample code illustrating how you create the interface?

Thanks a lot again!

Gabor

Minh-Tri Pham

unread,
Jul 16, 2010, 12:11:48 PM7/16/10
to ctypes...@googlegroups.com
Unfortunately, there is no tutorial. But you can look at my code to get the
concept and write a similar one for yourself. :)

I am still busy now, though less busy than last month. But I have put your
request for wrapping cvBlobslib into a TODO list. Hopefully, it will be done
in the next couple of months.

Cheers,
Minh-Tri

On 7/16/2010 4:59 PM, info gabor wrote:
> Thanks, Minh-Tri
> I actually use the cvBlobslib available in opencv site
> I use it (in C++ code) as the following excerpt exemplifies -
>

> /blobs = new CBlobResult( anImage, NULL, 0 );/
> /blobs->Filter( * blobs, B_EXCLUDE, CBlobGetArea(), B_LESS, someVal);/
> /...../
> /len = blobs->GetNumBlobs ();/
> /for (i=0; i<len; i++) {/
> / avg[i] = blobs->GetBlob (i)->Mean (image);/
> / sum += blobs->GetBlob (i)->Area ();/
> / }/

> <mailto:ctypes...@googlegroups.com>.


> > To unsubscribe from this group, send email to
> > ctypes-openc...@googlegroups.com

> <mailto:ctypes-opencv%2Bunsu...@googlegroups.com>.


> > For more options, visit this group at
> > http://groups.google.com/group/ctypes-opencv?hl=en.
>
> --
> Dr. Minh-Tri Pham
> Research Fellow, University of Surrey, UK

> Email: t.p...@surrey.ac.uk <mailto:t.p...@surrey.ac.uk> or
> pmt...@gmail.com <mailto:pmt...@gmail.com>


> Mob: +44 (0) 778 774 1089 | Tel: +44 (0) 148 368 4711
>
> --
> You received this message because you are subscribed to the Google Groups
> "ctypes-opencv" group.
> To post to this group, send email to ctypes...@googlegroups.com

> <mailto:ctypes...@googlegroups.com>.


> To unsubscribe from this group, send email to
> ctypes-openc...@googlegroups.com

> <mailto:ctypes-opencv%2Bunsu...@googlegroups.com>.

info gabor

unread,
Jul 19, 2010, 2:29:25 AM7/19/10
to ctypes...@googlegroups.com
Thanks, Minh-Tri
Reply all
Reply to author
Forward
0 new messages