Hi Jeremy,

this might be a misunderstanding.
It is
   (peak signal)/noise, not
   peak(signal/noise).
https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio

(From a grammar standpoint, the hyphens should be Peak-signal to noise, but then there is no room for adding a the word "ratio", which would require hyphens again; unless one has two levels of hyphens, Peak-signal–to–noise ratio.)


BTW, what came to my mind after replying:
If Nataliya wants to get rid of salt/pepper noise, the most suitable filter would be Process>Noise>Remove Outliers.

For other sources of noise, one can then run some (edge-preserving) smoothing filter in a second step.


Michael
________________________________________________________________
On 31.03.25 13:14, Jeremy Adler wrote:
Signal to noise ratio is meaningful when receiving morse code but when based on 
the value of the single most intense pixel in a 6000x6000 image maybe far less 
informative.
.

Any suggestions for a  measurement of image quality based on a larger and 
therefore more representative population of pixels.

Jeremy Adler


===============================================
                     B i o V i s   P l a t f o r m of  Uppsala University
                    Light & EM microscopy / FlowCytometry & Cell Sorting / 
Image Analysis
===============================================
Jeremy Adler   PhD - Senior research engineer
Light, Confocal Microscopy, Image Analysis
E-mail: [email protected]
0739 188170
www.uu.se/biovis

Dag Hammarskjölds v 20
751 85 UPPSALA, SWEDEN
http://biovis.uu.se/
===============================================






-----Original Message-----
From: Michael Schmid <[email protected]>
Sent: Monday, March 31, 2025 12:28 PM
To: [email protected]
Subject: Re: Median 3D filter

Hi Nataliya,

just see the formula for PSNR:
    https://en.wikipedia.org/wiki/Peak_signal-to-noise_ratio

You can get the mean squared error (MSE) by calculating the square of the difference 
image (which must be a 32-bit image), Process>Math>Square

Then take the mean of the squared deviation, see Analyze>Measure and
Analyze>Set Measurements...

You can also get the maximum of the original (the signal) with
Analyze>Measure.

If you use a macro, Analyze>Measure would be replaced with the mean and max 
values obtained via
    getStatistics(area, mean, min, max);


Michael
________________________________________________________________
On 31.03.25 10:59, Наталія Тулякова wrote:
Hello, Michael.
I have implemented my own non-adaptive nonlinear (robust) filtering
algorithm as a plugin.
I use some noise-free images (such as "Barbara", "Lena" and artificial
RSA
(radio) images). I use the ImageJ command "Process - Noise" and
simulate salt and pepper and Gaussian noise with different variance. I
found the plugin for Poisson noise. But I can only calculate the total
difference between the pure test image and the image obtained after
the denoising algorithm. I use the commands "Process - Image
Calculator" and "Analyze - Measure". I mean is it possible by means of
ImageJ to calculate PSNR? Maybe there is a plugin for this?
Thanks.
With best regards, Nataliya


пн, 31 бер. 2025 р. о 11:19 Michael Schmid <[email protected]> пише:

Dear Natalya,

for calculating the signal-to-noise ratio, you need to know the
"ground truth", i.e., what the image would be without noise.
There are essentially two approaches for this:

(1) Take a noise free image and add synthetic noise (preferably, with
the same characteristics as the noise of real images; for photos with
digital sensors the noise should be shot noise (Poisson statistics) +
readout noise (roughly Gaussian) + dark current variations (best
taken from a dark field with the same sensor).

(2) As a reference image, you can use the average of many images of
the same object (of course, without any lateral displacements due to
vibrations, etc.). By averaging, much of the noise will cancel out.
If dark current plays a role, you should subtract an average many
dark fields. Best do these operations in 32-bit mode, since it may
result in slightly negative values in low-intensity regions.
When subtracting this low-noise result from the noisy single
exposure, not that there will be a (roughly) constant offset, which
should be removed before evaluating the noise.

[A dark field is a photo with no light intensity reaching the sensor,
but the same exposure time. You can use a black lens cap.]


Best,

Michael
________________________________________________________________
On 29.03.25 16:46, Наталія Тулякова wrote:
Hi, Michael.

Thank you very much for the answer.

I have developed nonlinear filtering algorithms and implemented them
as plugins, taking one of the freely available plugins described in
the package ImageJ as a prototype. I want to compare the filter
de-noising efficiency for some of the test 2D gray-scale images. But
I can only calculate the difference between the test and filtered
images using Image Calculator, and to obtain the total mean value
(Analyze - Measure). Is it possible to obtain the filter efficiency
estimation, for example, by
means
of “Peak Signal-to-Noise Ratio”, using ImageJ program?

Yours  sincerely,    Nataliya

вт, 25 бер. 2025 р. о 13:30 Michael Schmid <[email protected]>
пише:

Hi Nataliya,

both, Median and Median 3D use a circular support (circular Kernel).
I noticed that Median 3D (and the other 3D filters) use a slightly
different definition of the radius.
For the 3D filters, sometimes one needs to add a small number like
0.5 to the radius of the 2D filters.
For a 2D image (no stack), Median 3D with radius=2.5 in x&y and the
"usual" (2D) Median with radius=2 do exactly the same (except near
the edges, see below).
At some radius values. the behavior is the same for the 2D and 3D
filters (e.g. radius=10.5 and 14.5), so there is no simple rule.
I think that eventually the 3D filters should be modified to use
the same definition of the radius as the 2D filters, the one also
used for
Process>Filters>Show circular masks.

The remaining difference is the handling of the edge pixels.
The 3D filters consider the out-of image pixels as nonexistent.
Thus, when calculating the median near the edge, the 3D median uses
fewer pixels. The 2D filters (the "usual" Median, Mean, etc.)
assume that the out-of-image pixels are the same as the nearest
edge pixel, and the mean, median, etc. is always calculated over
the same number of pixels (except for float images with NaN = Not a Number).
The latter convention (assuming repeated edge pixels) is the usual
convention in ImageJ, also for Gaussian Blur, and the
Process>Binary functions.

Hope this helps,

Michael
________________________________________________________________


On 22.03.25 12:32, Наталія Тулякова wrote:
Dear colleagues.
I am interested in filtering 2D images. The ImageJ program has two
median
filters in the "Process-Filters" menu item. I have not found any
documentation explaining how "Median 3D" works. Median 3D provides
better
results than Median. What is the difference between them for 2D
image processing? Does "Median 3D" use a square window while
"Median" uses a circular window?

With best regards,    Nataliya

--
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

--
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

VARNING: Klicka inte på länkar och öppna inte bilagor om du inte känner igen 
avsändaren och vet att innehållet är säkert.
CAUTION: Do not click on links or open attachments unless you recognise the 
sender and know the content is safe.









När du har kontakt med oss på Uppsala universitet med e-post så innebär det att 
vi behandlar dina personuppgifter. För att läsa mer om hur vi gör det kan du 
läsa här: http://www.uu.se/om-uu/dataskydd-personuppgifter/

E-mailing Uppsala University means that we will process your personal data. For 
more information on how this is performed, please read here: 
http://www.uu.se/en/about-uu/data-protection-policy

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

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

Reply via email to