Histogram Difference with Normalization and Equalization ...Help Please

7 views (last 30 days)
Hello everyone.
I am currently working with Histograma diferencia and I have used the following code that is referenced here:
https://de.mathworks.com/matlabcentral/fileexchange/51238-key-frame-extraction-from-video-using-videoreader?focused=3880674&tab=function
the code works perfectly for me.
My Doubt is
what would be the mathematical equation of the function that defines the calculation of Histogram difference and if it is possible to apply another, for example:
n 2
d(Ii,Ij)=(Hik-Hjk) / (Hjk+Hik)
k=1
Where Hi and Hj stand for the histogram of Ii and Ij, respectively.
My second doubt it is possible to introduce normalization and equalization to this code.
How would I do that?
Someone can Help me pls.
Thank you.
  2 Comments
Image Analyst
Image Analyst on 6 Apr 2018
I don't understand the question. And what are Hi, Hj, Ii, and Ij? Hi and Hj don't show up in your equation. And what is Hik? Is it H(i, k), which is the element at row i, column k? If so, what is H? What does a 2-D Histogram represent?
Dracfov
Dracfov on 6 Apr 2018
Edited: Dracfov on 6 Apr 2018
Hello dear friend, thank you for responding. Sorry for not being clear in my question. let me reformulate my question, my apologies. 1. In the following link: "https://de.mathworks.com/matlabcentral/fileexchange/51238-key-frame-extraction-from-video-using-videoreader?focused=3880674&tab=function"
the following function is used to calculate the Histogram difference:
function [ r ] = difference( f1,f2 )
k=rgb2gray(f1); % Convert into gray scale
l=rgb2gray(f2);
f11=imhist(k); %histogram of data
f12=imhist(l);
diffe= imabsdiff(f11,f12); %Absolute difference of two images
r=sum(diffe);
end
imabsdiff(), this is a Matlab's own function to calculate Histogram difference, right?
I would like to know if it is possible to calculate the Histogram difference by applying my own equation and how I could implement it.
this is the rectified equation:
n 2
d (Ii, Ij) = Σ (Hi-Hj) / (Hj + Hi)
k=1
Where Hi and Hj represent the Histograms of the current Ii and the next frame Ij respectively, for all frames from 1..n
2. It is possible to normalize and equalize the Histogram before calculating the Difference or not?
Thanks

Sign in to comment.

Answers (0)

Categories

Find more on Data Distribution Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!