Pixel value difference graph for two images

I want to show the pixel value difference histogram of two images as shown in the above attached file and want to show the outline of the histograms only. I am using histogram(cover,'DisplayStyle','stairs'),
but its showing only solid histogram. Another question, how to use the legent ?
Please help me.

Antworten (1)

Matt Gaidica
Matt Gaidica am 17 Jan. 2021

1 Stimme

First of all, are you asking for an algorithm to get the pixel value difference or do you just want code for the histogram? To get you started, the code below results in the following plot.
a = rand(1,1000);
histogram(a,'DisplayStyle','stairs')
legend('Random Numbers')

3 Kommentare

Image Analyst
Image Analyst am 17 Jan. 2021
Specify the "edges" parameter in histogram.
... and use
hold on
to plot another histogram in the same figure;
Laraib Naz
Laraib Naz am 25 Jan. 2021
pixel vale difference code

Melden Sie sich an, um zu kommentieren.

Gefragt:

am 17 Jan. 2021

Kommentiert:

am 25 Jan. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by