Image brightness/ contrast differences

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Image brightness/ contrast differences

WillyB
Background:
I down-loaded Image J last week, so I am a rookie with the software and image analysis in general.

Problem:
Trying to analyze particles on digital SEM images.  The images have slight differences in brightness/ contrast during image capture. I would like to "normalize/translate/correct (not sure what term applies yet)" all images, so I can set the same threshold range for particle analysis to numerically compare all images. Sounds fairly straight forward, but as a non-macro rookie, I only have a few hours of experience with the software to date.

Any help will be greatly appreciated.

WillyB

Reply | Threaded
Open this post in threaded view
|

Re: Image brightness/ contrast differences

dschones
Good Day to you all!

I have a similar problem as WillyB. I'm working on an old SEM with a larger
range of brightness (amount of electrons) provided by the electron gun
(tungsten cathode). The differences cause bigger differences of brightness
and contrast in the pictures I take. So I'm having problems comparing these
images.

In different images of the same probe there are areas where there shouldn't
be any difference in brightness and contrast. my idea was to create a stack
and ›enhance contrast‹ for every picture. But it's not the way I nead. I'm
wondering if there is a way selecting an area in one picture of the stack,
setting its brightness and contrast to norm and adjusting all other pictures
brightness' and contrasts in order to make the selected area look equal in
the hole stack.

Thanks in advice and greetings!



--
Sent from: http://imagej.1557.x6.nabble.com/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Image brightness/ contrast differences

dschones
Well I forgot the question.. Is there a way to do what I want?



--
Sent from: http://imagej.1557.x6.nabble.com/

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Image brightness/ contrast differences

Herbie
Are you sure that the contrast changes?

Michelson-contrast:

c = (max - min) / (max + min);

Regards

Herbie

::::::::::::::::::::::::::::::::::::::
Am 03.04.18 um 12:46 schrieb dschones:
> Well I forgot the question.. Is there a way to do what I want?
>
>
Original:


Good Day to you all!

I have a similar problem as WillyB. I'm working on an old SEM with a larger
range of brightness (amount of electrons) provided by the electron gun
(tungsten cathode). The differences cause bigger differences of brightness
and contrast in the pictures I take. So I'm having problems comparing these
images.

In different images of the same probe there are areas where there shouldn't
be any difference in brightness and contrast. my idea was to create a stack
and ›enhance contrast‹ for every picture. But it's not the way I nead. I'm
wondering if there is a way selecting an area in one picture of the stack,
setting its brightness and contrast to norm and adjusting all other pictures
brightness' and contrasts in order to make the selected area look equal in
the hole stack.

Thanks in advice and greetings!

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Image brightness/ contrast differences

Michael Schmid-3
In reply to this post by dschones
Hi,

with slightly similar background, this topic has been discussed already
as "stack normalization" and "stack deflickering". For additional
information, search for these terms...


If your image data are counts (e.g. of an Everhart-Thornley Detector)
without further scaling by the SEM software, I guess that scaling only
involves a factor, and the level of zero intensity should not vary. So
you should not apply brightness&contrast but just multiply the data by
different values to correct for different intensity of the electron beam.

You can write a simple macro to normalize these values for a stack,
taking only the selection into account:

   run("32-bit");
   for(i=1; i<=nSlices; i++) {
     setSlice(i);
     getStatistics(area, mean);
     run ("Select None");
     run("Divide...", "value=&mean");
     run ("Restore Selection");
   }
   resetMinAndMax();


If you want to adjust brightness AND contrast, the easiest would be
converting to 32 bit and "Enhance Contrast" with "Normalize" and
"Process all slices" checked. Note, however, that this will saturate the
darkest and brightest pixels. Otherwise it is a simple exercise to
modify the macro for normalization of mean and standard deviation:

   run("32-bit");
   for(i=1; i<=nSlices; i++) {
     setSlice(i);
     getStatistics(area, mean, min, max, std);
     run ("Select None");
     run("Subtract...", "value=&mean");
     run("Divide...", "value=&std");
     run ("Restore Selection");
   }
   resetMinAndMax();



Michael
________________________________________________________________
On 03/04/2018 11:26, dschones wrote:

> Good Day to you all!
>
> I have a similar problem as WillyB. I'm working on an old SEM with a larger
> range of brightness (amount of electrons) provided by the electron gun
> (tungsten cathode). The differences cause bigger differences of brightness
> and contrast in the pictures I take. So I'm having problems comparing these
> images.
>
> In different images of the same probe there are areas where there shouldn't
> be any difference in brightness and contrast. my idea was to create a stack
> and ›enhance contrast‹ for every picture. But it's not the way I nead. I'm
> wondering if there is a way selecting an area in one picture of the stack,
> setting its brightness and contrast to norm and adjusting all other pictures
> brightness' and contrasts in order to make the selected area look equal in
> the hole stack.
>
> Thanks in advice and greetings!
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Image brightness/ contrast differences

Kenneth Sloan-3
I have had similar problems.  I suspect that the key problem (which may elude standard canned solutions) is that only specific AREAS of the stack are reliable enough to use as a basis for matching brightness/contrast throughout the stack.

What's needed is the ability to specify an ROI, and adjust B/C through the stack so that THAT ROI appears similar in all slices.

If such a canned solution exists - I'm very interested.

--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.





> On 3 Apr 2018, at 14:45 , Michael Schmid <[hidden email]> wrote:
>
> Hi,
>
> with slightly similar background, this topic has been discussed already as "stack normalization" and "stack deflickering". For additional information, search for these terms...
>
>
> If your image data are counts (e.g. of an Everhart-Thornley Detector) without further scaling by the SEM software, I guess that scaling only involves a factor, and the level of zero intensity should not vary. So you should not apply brightness&contrast but just multiply the data by different values to correct for different intensity of the electron beam.
>
> You can write a simple macro to normalize these values for a stack, taking only the selection into account:
>
>  run("32-bit");
>  for(i=1; i<=nSlices; i++) {
>    setSlice(i);
>    getStatistics(area, mean);
>    run ("Select None");
>    run("Divide...", "value=&mean");
>    run ("Restore Selection");
>  }
>  resetMinAndMax();
>
>
> If you want to adjust brightness AND contrast, the easiest would be converting to 32 bit and "Enhance Contrast" with "Normalize" and "Process all slices" checked. Note, however, that this will saturate the darkest and brightest pixels. Otherwise it is a simple exercise to modify the macro for normalization of mean and standard deviation:
>
>  run("32-bit");
>  for(i=1; i<=nSlices; i++) {
>    setSlice(i);
>    getStatistics(area, mean, min, max, std);
>    run ("Select None");
>    run("Subtract...", "value=&mean");
>    run("Divide...", "value=&std");
>    run ("Restore Selection");
>  }
>  resetMinAndMax();
>
>
>
> Michael
> ________________________________________________________________
> On 03/04/2018 11:26, dschones wrote:
>> Good Day to you all!
>> I have a similar problem as WillyB. I'm working on an old SEM with a larger
>> range of brightness (amount of electrons) provided by the electron gun
>> (tungsten cathode). The differences cause bigger differences of brightness
>> and contrast in the pictures I take. So I'm having problems comparing these
>> images.
>> In different images of the same probe there are areas where there shouldn't
>> be any difference in brightness and contrast. my idea was to create a stack
>> and ›enhance contrast‹ for every picture. But it's not the way I nead. I'm
>> wondering if there is a way selecting an area in one picture of the stack,
>> setting its brightness and contrast to norm and adjusting all other pictures
>> brightness' and contrasts in order to make the selected area look equal in
>> the hole stack.
>> Thanks in advice and greetings!
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Image brightness/ contrast differences

Michael Schmid-3
Hi Kenneth & everyone,

these macros take the selected area into account.

The getStatistics macro command uses only the selected area
   https://imagej.nih.gov/ij/developer/macro/functions.html#getStatistics

Then, the selection is removed for applying the normalization to the
whole image ("Select None"), and it is re-applied before the next slice
is processed ("Restore Selection").

Michael
________________________________________________________________
On 03/04/2018 22:10, Kenneth Sloan wrote:

> I have had similar problems.  I suspect that the key problem (which may elude standard canned solutions) is that only specific AREAS of the stack are reliable enough to use as a basis for matching brightness/contrast throughout the stack.
>
> What's needed is the ability to specify an ROI, and adjust B/C through the stack so that THAT ROI appears similar in all slices.
>
> If such a canned solution exists - I'm very interested.
>
> --
> Kenneth Sloan
> [hidden email]
> Vision is the art of seeing what is invisible to others.
>
>
>
>
>
>> On 3 Apr 2018, at 14:45 , Michael Schmid <[hidden email]> wrote:
>>
>> Hi,
>>
>> with slightly similar background, this topic has been discussed already as "stack normalization" and "stack deflickering". For additional information, search for these terms...
>>
>>
>> If your image data are counts (e.g. of an Everhart-Thornley Detector) without further scaling by the SEM software, I guess that scaling only involves a factor, and the level of zero intensity should not vary. So you should not apply brightness&contrast but just multiply the data by different values to correct for different intensity of the electron beam.
>>
>> You can write a simple macro to normalize these values for a stack, taking only the selection into account:
>>
>>   run("32-bit");
>>   for(i=1; i<=nSlices; i++) {
>>     setSlice(i);
>>     getStatistics(area, mean);
>>     run ("Select None");
>>     run("Divide...", "value=&mean");
>>     run ("Restore Selection");
>>   }
>>   resetMinAndMax();
>>
>>
>> If you want to adjust brightness AND contrast, the easiest would be converting to 32 bit and "Enhance Contrast" with "Normalize" and "Process all slices" checked. Note, however, that this will saturate the darkest and brightest pixels. Otherwise it is a simple exercise to modify the macro for normalization of mean and standard deviation:
>>
>>   run("32-bit");
>>   for(i=1; i<=nSlices; i++) {
>>     setSlice(i);
>>     getStatistics(area, mean, min, max, std);
>>     run ("Select None");
>>     run("Subtract...", "value=&mean");
>>     run("Divide...", "value=&std");
>>     run ("Restore Selection");
>>   }
>>   resetMinAndMax();
>>
>>
>>
>> Michael
>> ________________________________________________________________
>> On 03/04/2018 11:26, dschones wrote:
>>> Good Day to you all!
>>> I have a similar problem as WillyB. I'm working on an old SEM with a larger
>>> range of brightness (amount of electrons) provided by the electron gun
>>> (tungsten cathode). The differences cause bigger differences of brightness
>>> and contrast in the pictures I take. So I'm having problems comparing these
>>> images.
>>> In different images of the same probe there are areas where there shouldn't
>>> be any difference in brightness and contrast. my idea was to create a stack
>>> and ›enhance contrast‹ for every picture. But it's not the way I nead. I'm
>>> wondering if there is a way selecting an area in one picture of the stack,
>>> setting its brightness and contrast to norm and adjusting all other pictures
>>> brightness' and contrasts in order to make the selected area look equal in
>>> the hole stack.
>>> Thanks in advice and greetings!
>>
>> --
>> 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
Reply | Threaded
Open this post in threaded view
|

Re: Image brightness/ contrast differences

dschones
Hi Micheal,

this Macro is just what I searched for! Works perfect! Thank you very very
much :)
ImageJ is a really powerful tool which can also be seen at the community
working on and with it!
Thanks again!

Good day and kind regard
Jonas



--
Sent from: http://imagej.1557.x6.nabble.com/

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