Subtract images - Bug or incompetence
Posted: 2008-10-08T00:47:18-07:00
Hello this is a short question regarding pixelcalculation in c/c++.
darkpic.composite(brightpic,0,0,MinusCompositeOp);
As you can see, I use the MinusCompositeOp operation, but tried also DifferenceOp and SubtractOp.
Usually it works but some pixels are calculated wrong.
Image A (value 2038) - Image B (value 2004) should be value 34!
But in the resulting Image there is the wrong value 65525. Bug?
Both images are 16-bit tif and I work with Windows Vista(64).
By the way...is there a possibility to avoid updating the current image (darkpic) but the other (brightpic)?.
Thank you in advance.
darkpic.composite(brightpic,0,0,MinusCompositeOp);
As you can see, I use the MinusCompositeOp operation, but tried also DifferenceOp and SubtractOp.
Usually it works but some pixels are calculated wrong.
Image A (value 2038) - Image B (value 2004) should be value 34!
But in the resulting Image there is the wrong value 65525. Bug?
Both images are 16-bit tif and I work with Windows Vista(64).
By the way...is there a possibility to avoid updating the current image (darkpic) but the other (brightpic)?.
Thank you in advance.