How do I plot image noise (snr) to compare the noise of two images?

18 ビュー (過去 30 日間)
Hakan Peker
Hakan Peker 2022 年 11 月 30 日
回答済み: Kartik 2023 年 3 月 20 日
Hi,
I am trying to compare two images and want to plot the image noise somehow. I already know how to calculate the snr but I do not know how to plot it.
Can someone help?
Thanks a lot :)
  2 件のコメント
Hakan Peker
Hakan Peker 2022 年 11 月 30 日
This is what I have so far:
img=imread('B00011.jpg');
img=double(img(:));
ima=max(img(:));
imi=min(img(:));
ims=std(img(:));
snr=10*log((ima-imi)./ims);
fprintf('\n SNR value here %0.5f\n', snr);
Jonas
Jonas 2022 年 11 月 30 日
of course you could plot those two snr values, but thats probable not, what you wanted to see.
What you could do is highpass filter the images and compare them. Then you can see how much high frequency content each image has

サインインしてコメントする。

回答 (1 件)

Kartik
Kartik 2023 年 3 月 20 日
Hi,
To plot the signal-to-noise ratio (SNR) of two images in MATLAB, you can use the 'imagesc' function to display a matrix as a color image and plot the SNR values as a color map.
Assuming you have already calculated the SNR values for the two images, you can create a matrix of SNR values and then use the imagesc function to plot it. Here's an example code snippet:
% Example SNR values for two images
SNR_image1 = 30;
SNR_image2 = 25;
% Create a 2x1 matrix of SNR values
SNR_matrix = [SNR_image1, SNR_image2];
% Plot the SNR values as a color map
imagesc(SNR_matrix);
colorbar;
This code will create a color map with two colors representing the SNR values of the two images. You can use this plot to compare the noise levels of the two images, where the color representing the higher SNR value indicates a lower noise level. You can customize the color map and the color bar to suit your needs using the 'colormap' and 'caxis' functions.
Use the following MathWorks documentation for more information:
https://www.mathworks.com/help/matlab/ref/imagesc.html

カテゴリ

Help Center および File ExchangeBlue についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by