Ask Your Question

colorDistance acting bizarrely

asked 2013-10-18 00:27:21 -0500

RunDeep gravatar image

I am using the latest from Github (hour ago) and I'm having trouble that I also saw with a copy I grabbed three days ago. I am cropping a 1200 w, 1920 h screen capture (portrait mode monitor) and when I apply colorDistance to the cropped image it is distorted. hueDistance works fine and colorDistance works fine on the uncropped image.

img_orig = Image(r"screenshot-02.png")
img_crop= img_orig.crop(0, 0, 133, 400) # fine
img_proc = img_crop.colorDistance(color=Color.BLACK) # distorted
img_proc = img_crop.hueDistance(color=Color.BLACK) # fine

Cropped image: I guess my karma sucks so imagine a nice cropped image

Distored image: if I crop the image so that the height and width dimensions are the same, imgproc is rotated 90 deg CW and flipped about the vertical axis. If the width = n * height, I get n of the rotated/flipped images stacked vertically if n is an integer. If n is real, the individual images start to skew, e.g. imgorig.crop(0, 0, 133, 400) causes the border between the individual images to run at what looks like a 45 deg angle.

This is on Win 7 with 32 bit Python in a virtualenv.

Guessing this isn't the way it is supposed to work?


edit retag flag offensive close merge delete


I hit exactly the same problem while doing the parking tutorial . I've a Linux installation using SimpleCV version 1.3.0. I don't think this is the expected behavior of this function.

Franksm gravatar imageFranksm ( 2013-11-27 10:40:25 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2014-01-01 12:34:34 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I have workaround, yellow_car = car.colorDistance(Color.YELLOW).rotate(270).flipHorizontal()

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2013-10-18 00:27:21 -0500

Seen: 216 times

Last updated: Jan 01 '14