Login  Register

Re: Fw: Aw: Re: Calculator Plus

Posted by Herbie on Mar 30, 2017; 1:50pm
URL: http://imagej.273.s1.nabble.com/Calculator-Plus-tp5018377p5018422.html

Dear Thomas,

from my point of view you didn't specify enough of what you really want.

Comparing two RGB images isn't defined per se. You need to tell us how
you want to deal with color.

One possibility is to compare corresponding color channels.
This in turn can be done by subtracting the corresponding channels and
this can be done with and without sign, i.e. as 32bit (Subtract) or as
8bit (Difference) result.
Finally the resulting channels can again be combined to give an RGB-image.

Attached please find the RGB-result from your example image
        2017010061-132-small.tif
that I saved as JPG-image in ImageJ (with the default quality of ImageJ)
for comparison.

The resulting RGB image from channel-wise subtraction is displayed as
follows:
The three bipolar channel-wise 32bit results from the subtractions are
made to range from -20 to 20 and this span of 0...40 is finally shown as
the RGB-result.

Evidently, your original TIF-image is quite noisy and this shows up in
pronounced JPG-artifacts all over the image.

I hope this clarifies the issue a bit.

Regards

Herbie

::::::::::::::::::::::::::::::::::::::::::::
Am 30.03.17 um 14:03 schrieb Thomas Eschner:

> Dear Gabriel, dear all,
>
> as I explained somewhere in-between of this discussion, the order
> was Taking RGB-image - Storing as jpg and tiff - difference of
> RGB-jpeg - RGB-tiff (working, but noisy) - 2 x transformation to 16
> bit - difference of "16-bit jpeg" - "16-bit tiff" (not working as
> expected and reason for first of all mails). In that sense I do have
> 16-bit jpegs, i.e. images containing artefacts from jpg-compression
> (and possibly from transformation, too).
>
> And all I want to achieve is to have a difference of these images.
> For some reason I tried Calculatur Plus. Butd if for two quite
> similar images the difference scaled by k1 = 8 and offset by k2 = 128
> is 65535 everywhere, I dare to say that subtraction in that plugin is
> _not_ scaled  by k1 and offset by k2.
>
> I already learned that I should go with Image Calculator (non-Plus)
> and surely I will do so. However, I would have liked the idea that
> all offered tools work as expected/intended, even the simpler ones. I
> know I could/should do that myself, but let's remain realistic.
>
> Gabriel, as you are not the maintainer, I'd suggest to end the
> discussion at this point, but just fyi I attached two images and this
> macro:
>
> selectWindow("2017010061-130-small.jpg"); run("16-bit");
> selectWindow("2017010061-132-small.tif"); run("16-bit");
> run("Calculator Plus", "i1=2017010061-130-small.jpg
> i2=2017010061-132-small.tif operation=[Subtract: i2 = (i1-i2) x k1 +
> k2] k1=8 k2=128 create");
>
>
> Kind regards, Thomas
>
>
> Gesendet: Donnerstag, 30. März 2017 um 03:19 Uhr Von: "Gabriel
> Landini" <[hidden email]> An: [hidden email] Betreff: Re:
> Calculator Plus On Mon, Mar 27, 2017 at 6:50 AM, Thomas Eschner
> <[hidden email]>
>> I am trying to illustrate artefacts introduced by storing files as
>> jpg by showing the difference of two identical 16-bit images, one
>> stored as jpg and one as tiff.
>
> First of all, are there 16bit jpegs?? I do not seem to be able to
> create one in IJ.
>
>> With Calculator Plus, setting e.g. Subtract with k1 = 1 and k2 =
>> 16, I end up with files having their values set to 65535
>> exclusively.
>
> The subtraction in that plugin is scaled by k1 and offset by k2. I do
> not understand what is that you are tring to achieve. Why not use
> just the Image Calculator (not the "Plus" one) with the result as 32
> bit?
>
> I do not think I am the maintainer of the plugin. I added the support
> for RGB images, plane-wise, long ago but that was about it. I think
> the plugin works fine as it is. If it doesn't, please post a macro
> that shows the problem.
>
> Cheers
>
> Gabriel
>
> -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Result_2017010061-132-small.png (34K) Download Attachment