How to overlap two histograms , one generated from reference image other for noisy image ?
    5 Ansichten (letzte 30 Tage)
  
       Ältere Kommentare anzeigen
    
    Preethi  H L
 am 6 Okt. 2015
  
    
    
    
    
    Kommentiert: Image Analyst
      
      
 am 13 Okt. 2015
            Actual Program which I tried is,
Prog 1: A = imread('frame2.bmp'); I = rgb2gray(A); J = imnoise(I,'salt & pepper',0.2); figure; imshow(I);title('original image'); figure; imshow(J);title('image with salt&pepper noise=0.2'); figure; imhist(I);title('histogram of refrece image'); figure; imhist(J);title('histogram of salt&pepper noisy image'); figure; K=imhist(I)+imhist(J); hist(K); But didn't get desired output.
2 Kommentare
  Image Analyst
      
      
 am 13 Okt. 2015
				You're welcome. You can also "Thank" me by officially "Accepting" my answer and "Voting" for it.
Akzeptierte Antwort
  Image Analyst
      
      
 am 6 Okt. 2015
        Do you have R2015b? You can overlap histograms with histogram() - just look at the example in the help:
x = randn(2000,1);
y = 1 + randn(5000,1);
h1 = histogram(x);
hold on
h2 = histogram(y);
3 Kommentare
  Image Analyst
      
      
 am 9 Okt. 2015
				Try imhist instead of hist:
clc;    % Clear the command window.
close all;  % Close all figures (except those of imtool.)
clear;  % Erase all existing variables. Or clearvars if you want.
workspace;  % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 20;
rgbImage = imread('peppers.png');
subplot(2,2,1);
imshow(rgbImage);
title('Original RGB Image', 'fontSize', fontSize);
grayImage = rgb2gray(rgbImage);
subplot(2,2,2);
imshow(grayImage);
title('Original Gray Scale Image', 'fontSize', fontSize);
% Set up figure properties:
% Enlarge figure to full screen.
set(gcf, 'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
% Get rid of tool bar and pulldown menus that are along top of figure.
set(gcf, 'Toolbar', 'none', 'Menu', 'none');
% Give a name to the title bar.
set(gcf, 'Name', 'Demo by ImageAnalyst', 'NumberTitle', 'Off') 
M=0;
V=0.01;
noisyImage = imnoise(grayImage,'gaussian',M,V);
noisyImage=im2double(noisyImage);
subplot(2,2,3);
imshow(noisyImage);
title('image with gaussian noise v=0.01', 'fontSize', fontSize);
subplot(2,2,4);
%imhist(I);title('histogram of refrece image');
 h1 = imhist(grayImage);
 plot(h1)
 hold on
 h2 = imhist(noisyImage); 
 plot(h2);
 title('histogram of image with gauss noise v=0.01', 'fontSize', fontSize);
 grid on;

Weitere Antworten (0)
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


