Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Image threshold with a side-by-side view using SimpleCV.
from SimpleCV import Image, Color, Display
# Make a function that does a half and half image.
def halfsies(left,right):
result = left
# crop the right image to be just the right side.
crop = right.crop(right.width/2.0,0,right.width/2.0,right.height)
# now paste the crop on the left image.
result = result.blit(crop,(left.width/2,0))
# return the results.
return result
# Load an image from imgur.
img = Image('')
# binarize the image using a threshold of 90
# and invert the results.
output = img.binarize(90).invert()
# create the side by side image.
result = halfsies(img,output)
# show the resulting image.
# save the results to a file.'juniperbinary.png')

This comment has been minimized.

Copy link

@Olhcim Olhcim commented Jul 9, 2014

it gives me the following error for line 16:
TypeError: CvArr argument 'src' must be IplImage, CvMat or CvMatND. Use fromarray() to convert numpy arrays to CvMat or cvMatND

but cv.fromarray(img) doesnt seem to fix anything?


This comment has been minimized.

Copy link

@Waqarrak Waqarrak commented May 10, 2015

Greetings. I am working at underwater path detection and path follow for that i have to remove blobs if any on run time. Would anyone tell me that how to remove blob at there?
thanks and regards


This comment has been minimized.

Copy link

@mohit1718 mohit1718 commented May 27, 2016

please can any one give me brief about

How to start developing an Image processing Software...Or Machine Vision System...
I heard that there are many opensource codes which i can use to develop vision systems.

I am trying to google from...Where..I can go ahead..??

My requirement is to prepare Machine vision software for known facts that can handled by vision systems
Such as:

  1. Measurements
    1. Presence absence
    2. Data matrix / 2D / Bar code Reading
    3. Defect on area scan basis

later on i will move to the OCR and OCV applications.

please if anybody can help me in this....
Than you in advance..!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment