kimdj1990 / jjil

Automatically exported from code.google.com/p/jjil
0 stars 0 forks source link

Precomputed filter values in Gray8GaussHoriz.java and Gray8GaussSmoothVert.java are wrong #20

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi Jon,

first thanks for the great lib, I'm using it for an android app and it's 
great to have some basic algorithms already implemented. However, I found 
out that the precomputed filter values in the classes Gray8GaussHoriz.java 
and Gray8GaussSmoothVert.java are wrong. You are using the range 0-256 for 
them, but in this case the average value for the smoothed pixel can be out 
of the signed byte bounds [-128, 127]. In such a case the bitshift 
operation in the end causes an byte overflow and dark areas become bright 
and the other way round. I think using a range of 0-128 for the filter 
values should fix this.

Original issue reported on code.google.com by romantic...@gmail.com on 15 Dec 2009 at 10:09