Inflection points on grayscale image histogram

1 visualización (últimos 30 días)
Veronica Morales
Veronica Morales el 24 de En. de 2019
Comentada: Star Strider el 31 de En. de 2019
I have a grayscale image, then plotted the histogram using imhist. Now, I need to find the first inflection point of the histogram. That point halfway up, when the bell-shape curve starts to change (see red line in attached jpg). I calculated first and second derivative of the histogram, but I'm stuck on how to get that point. My code looks something like this:
I = imread('dog3.jpg');
%figure; imshow(I)
%Calculating and plotting histogram of image
y = imhist(I);
f1 = diff(y);
f2 = diff(f1);
figure; imhist(I)
figure; plot(y)
figure; plot(f2)
image.jpeg

Respuesta aceptada

Star Strider
Star Strider el 24 de En. de 2019
Use the gradient (link) function to calculate the numerical derivative, not the diff function.
See if the approach in my Answer to How to draw tangent line at infleciton point? (link) will work for you.
  12 comentarios
Veronica Morales
Veronica Morales el 29 de En. de 2019
this is the image I'm using. See attached jpg
Star Strider
Star Strider el 31 de En. de 2019
I am still doing my best to figure out what you are doing in your code with respect to the inflection points.
Meanwhile, one way to find FWHM is to use the midcross (link) function. (It was introduced in R2012a.)
specifically:
mcy = midcross(y);
produces:
mcy =
23.4983
38.7014
So:
FWHM = diff(mcy)
FWHM =
15.2031
Those values are in terms of the ‘x’ variable being defined as:
x = 1:numel(y);
so essentially the indices of ‘y’.

Iniciar sesión para comentar.

Más respuestas (1)

Veronica Morales
Veronica Morales el 25 de En. de 2019
Whoa! Thanks for asking. Well my intension is automatization of a process. I need to select that value as the dark level, when the histogram start changing. Don't have more info of why it has to be that point. AS of today we are doing it manually, and want to get away from that, because I have to do the same with hundreds of images...kinda' tedious heh?! I have no clue about all those other methods you mentioned (well getting the FWHM I know). So based on what I was doing, selecting that point visually, I thought it was similar as selecting an inflection point.
  1 comentario
Veronica Morales
Veronica Morales el 25 de En. de 2019
hum...you are right (obviously) maybe what I need is the FWHM...now I need to figure out how to do it.

Iniciar sesión para comentar.

Categorías

Más información sobre Histograms en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by