how to find and filter blobs from segment image using python?

Posted by Python Team on Ask Ubuntu See other posts from Ask Ubuntu or by Python Team
Published on 2014-06-05T09:17:56Z Indexed on 2014/06/05 9:43 UTC
Read the original article Hit count: 373

Filed under:
|

Am trying to detect number plate from an image.I have converted an image to grayscale and segment image. Now i have to find and filter blobs from an image and to detect number plate from an image. I will explain what i did..

I jus read segment image

license_plate = cv2.imread('license1_segmented.png',cv2.CV_LOAD_IMAGE_COLOR)
license_plate_size = (license_plate.shape[1], license_plate.shape[0])
mask = cv2.cv.CreateImage (license_plate_size, 8, 1)
cv2.cv.Set(mask, 1)
thresh_image_ipl = cv2.cv.CreateImage(license_plate_size, cv2.cv.IPL_DEPTH_8U, 1)
cv2.cv.SetData(thresh_image_ipl,thresh_image.tostring(),thresh_image.dtype.itemsize * 1 * thresh_image.shape[1])
min_blob_size = 100 # Blob must be 30 px by 30 px
max_blob_size = 10000
threshold = 100
**myblobs = CBlobResult(thresh_image_ipl,mask, threshold, True)**
myblobs.filter_blobs(min_blob_size, max_blob_size)
blob_count = myblobs.GetNumBlobs()

trying to find and filter blobs from an image.But am getting error while passing the parameters to CBlobResult which i highlighted above code.I mentioned the error below what i get while passing.

 Traceback (most recent call last):
 File "rectdetect1.py", line 110, in <module>
 myblobs = CBlobResult(thresh_image_ipl,image_area, threshold, True)
 File "/home/oomsys/pyblobs-read-only/blobs/BlobResult.py", line 92, in __init__
 this = _BlobResult.new_CBlobResult(*args)
 NotImplementedError: Wrong number or type of arguments for overloaded function 'new_CBlobResult'.
 Possible C/C++ prototypes are:
 CBlobResult::CBlobResult()
 CBlobResult::CBlobResult(IplImage *,IplImage *,int,bool)
 CBlobResult::CBlobResult(CBlobResult const &)

Anyone help me to find out the erros and to solve this and all... Thanks in advance...

© Ask Ubuntu or respective owner

Related posts about python

Related posts about opencv