블로그 이미지
Leeway is... the freedom that someone has to take the action they want to or to change their plans.
maetel

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
  • total
  • today
  • yesterday

Category

2010. 9. 26. 19:30 Computer Vision
OpenCV 함수 cvTreshold or cv::threshold

source code link: https://code.ros.org/trac/opencv/browser/tags/2.1/opencv/src/cv/cvthresh.cpp
file: /opencv/src/cv/cvthresh.cpp


Learning OpenCV: Chapter 5 Image Processing: Threshold (135p)


cf. Otsu method




원본 영상

입력 영상



threshold=100, max_val=100, CV_THRESH_BINARY

threshold=100, max_val=200, CV_THRESH_BINARY

threshold=200, max_val=200, CV_THRESH_BINARY



threshold=50, CV_THRESH_TRUNC

threshold=50, CV_THRESH_TRUNC

threshold=150, CV_THRESH_TRUNC



threshold=50, CV_THRESH_TOZERO

threshold=100, CV_THRESH_TOZERO

threshold=200, CV_THRESH_TOZERO



threshold=100, max_val=200, CV_THRESH_BINARY

threshold=100, max_val=200, CV_THRESH_BINARY & CV_THRESH_OTSU

threshold=100, max_val=200, CV_THRESH_OTSU


코드에서 CV_THRESH_OTSU는 CV_THRESH_BINARY | CV_THRESH_OTSU 와 같은 효과.
CV_THRESH_OTSU는 함수의 인자 "threshold"의 초기값과 무관하게 입력 영상에 대해 내부적으로 threshold 값을 구하고 이에 따라 선택된 픽셀들에 max_value 값을 준다.


posted by maetel