Binary Image Processing
:material-circle-edit-outline: 约 229 个字 :fontawesome-solid-code: 12 行代码 :material-image-multiple-outline: 4 张图片 :material-clock-time-two-outline: 预计阅读时间 2 分钟
Binary image¶
- Binary image:
- 0: black
- 1: white (255)
advantages
* less memory
* easy to process
* can sometimes be applied on grayscale image
* more cheap
disadvantage
* application field is limited
* cannot be applied on D data
* less expressive force, fial to express the color and gray level of the image
Acquisiton of binary image¶
- Thresholding:
\(I(x,y)=0 if I(x,y)<Threshold\)
\(I(x,y)=255 if I(x,y)>=Threshold\)
How to find a good threshold?

Matlab | |
---|---|
\(N_{Fgrd}\): the number of pixels in the foreground
\(N_{Bgrd}\): the number of pixels in the background
\(\sigma_{Fgrd}^2\): the variance of the foreground
\(\sigma_{Bgrd}^2\): the variance of the background
\(\sigma_{within}^2\): the variance within the foreground and background
\(\mu_{Fgrd}\): the mean of the foreground
\(\mu_{Bgrd}\): the mean of the background
Simplified formula:

\(\sigma_{between}=w_b*w_f*(\mu_{Fgrd}-\mu_{Bgrd})^2\) (use findmax loop to find the maximum value of \(\sigma_{between}\))
Otsu's method: embedded in matlab

Tip
Generalization¶
Weber's law¶
- Weber's law:
\(\frac{\Delta I}{I}=k\)
\(\Delta I\): the smallest difference that can be perceived by human eyes
\(I\): the intensity of the light
\(k\): constant, between 0.01 and 0.02