How to overlap two histograms , one generated from reference image other for noisy image ?
    조회 수: 5 (최근 30일)
  
       이전 댓글 표시
    
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
  Image Analyst
      
      
 2015년 10월 13일
				You're welcome. You can also "Thank" me by officially "Accepting" my answer and "Voting" for it.
채택된 답변
  Image Analyst
      
      
 2015년 10월 6일
        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
  Image Analyst
      
      
 2015년 10월 9일
				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;

추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


