blobs order

21 views
Skip to first unread message

fala70

unread,
May 24, 2011, 5:32:49 PM5/24/11
to cvBlob
how can I do to order the blobs by left,top to right,bottom... or
other orders ?

Stefano

Nathan Oostendorp

unread,
May 24, 2011, 10:51:09 PM5/24/11
to cvb...@googlegroups.com
I'm not sure how to do it in cvblob, if there's not a function in the code for it it wouldn't be too hard to write.

in simplecv you can get the Blobs as a FeatureSet and sort/filter eg:

    blobs = img.findBlobs() #same params as CvThresh + CvLabel
    left_sorted = FeatureSet(sorted(blobs, key=lambda f: f.x))
    left_sorted_top_half_screen = left_sorted.filter(left_sorted.y() > img.height / 2)

It uses cvblob if you install my cvblob-python wrapper

Cristóbal

unread,
May 25, 2011, 6:41:56 AM5/25/11
to cvBlob
Reply all
Reply to author
Forward
0 new messages