필터 지우기
필터 지우기

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

조회 수: 19 (최근 30일)
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
Ameer Hamza
Ameer Hamza 2018년 5월 22일
편집: Ameer Hamza 2018년 5월 22일
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 2018년 5월 22일
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).

댓글을 달려면 로그인하십시오.

채택된 답변

Ameer Hamza
Ameer Hamza 2018년 5월 22일
See adaptthresh(). This will estimate a threshold value without the need to manually specifying it.
  댓글 수: 6

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by