sightmachine / SimpleCV

The Open Source Framework for Machine Vision
http://simplecv.org
BSD 3-Clause "New" or "Revised" License
2.68k stars 798 forks source link

Bug when using scale then colorDistance #628

Open baptistelabat opened 10 years ago

baptistelabat commented 10 years ago

When applying scale, then colorDistance to an image, the result is unexpected. With some images it's applying a rotation. with jpg imags it's giving weird results. Here is the smallest code to reproduce the problem. Tested with 1.3 and 7372a0c58eead9c3228315d65ae1903e4b8eb3f1

from SimpleCV import Image, Color

img = Image("logo").scale(2.0) bug_img = img.colorDistance(color = Color.RED) img.save("bug.jpg") img.sideBySide(bug_img).show()

I check the source code, but was not able to find the bug.

baptistelabat commented 10 years ago

A work around is to use resize instead : scale = 0.5 img = img.resize(int(scale_img.width), int(scale_img.height))