Number of dark stripe in a image
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Amrit Kumar Mondal
el 23 de Mayo de 2023
Comentada: Amrit Kumar Mondal
el 25 de Mayo de 2023
How can I calculate number of black or gray stripe in the above region using Matlab (not by counting then manually)?
0 comentarios
Respuestas (1)
Nathan Hardenberg
el 23 de Mayo de 2023
I would extract one line of pixels in the image and then use the islocalmin() or islocalmax()-function. This searches for local minima/maxima. Depending on counting black or white stripes (to count black you need islocalmin()).
Then you just need to check the length of the vector.
If you have Problems (e.g. finding multiple maxima/minima in one stripe) check the documentation for possible arguments which could resolve possible issures.
Note that this only works if your stripes are always "clean". If not possible filtering beforehand might be nessescary.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!