Borrar filtros
Borrar filtros

How can I implement auto threshold into my code rather than defining the threshold for each image?

19 visualizaciones (últimos 30 días)
Hi everyone. I would like to implement auto-thresholding into my Matlab code as I don't want to define manually for each image. For example, I define my threshold like; binaryImage = myinput <0.7; Is there any way to find the best threshold automatically and use that threshold for images I have.
  2 comentarios
Ameer Hamza
Ameer Hamza el 22 de Mayo de 2018
Editada: Ameer Hamza el 22 de Mayo de 2018
It will be possible most probably. But first, you need to define best threshold. How do you measure whether a specific threshold is best or not?
engineer
engineer el 22 de Mayo de 2018
I find the best threshold by trial and error. The best threshold for me is that the background pixel is fully black (0) and the object's pixel is fully white (0).

Iniciar sesión para comentar.

Respuesta aceptada

Ameer Hamza
Ameer Hamza el 22 de Mayo de 2018
See adaptthresh(). This will estimate a threshold value without the need to manually specifying it.
  6 comentarios

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox 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