File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -247,9 +247,10 @@ SmartCrop.prototype = {
247
247
for ( var x = 0 ; x < output . width ; x ++ ) {
248
248
var p = yoffset + x * 4 ,
249
249
importance = this . importance ( crop , x * downSample , ydownSample ) ;
250
- score . skin += od [ p ] / 255 * ( od [ p + 1 ] / 255 + options . skinBias ) * importance ;
251
- score . detail += od [ p + 1 ] / 255 * importance ;
252
- score . saturation += od [ p + 2 ] / 255 * ( od [ p + 1 ] / 255 * 1.0 + options . saturationBias ) * importance ;
250
+ var g = od [ p + 1 ] / 255 ;
251
+ score . skin += od [ p ] / 255 * ( g + options . skinBias ) * importance ;
252
+ score . detail += g * importance ;
253
+ score . saturation += od [ p + 2 ] / 255 * ( g + options . saturationBias ) * importance ;
253
254
//if(Number.isNaN(score.detail)) debugger;
254
255
//if(Number.isNaN(score.saturation)) debugger;
255
256
//if(Number.isNaN(score.skin)) debugger;
You can’t perform that action at this time.
0 commit comments