EE356 Project1: Threshold Selection
SJTU-EE356 Project 1: Threshold selection by clustering gray levels of boundary.
Author: HUANG Siyuan (519030910095)
Structure
| Name | Content | | -------------- | ------------------------------------------------------------ | | data | Original Image | | hist | Hist of gray values of boundary points | | boundary | Boundary Detection Result | | out | Segmentation Result | | Util.py | utilities | | Mean.py | single class object & background segmentation for 6.jpg, 8_gray.bmp, 40.jpg | | Bi-level.py | bi-level selection for 1_gray.bmp, 13.bmp | | Multi-level.py | multi-level selection for 22.bmp, 23.bmp |
Paper Outline
1. Boundary points
All boundary points satisfies:
- $\frac{\partial^{2}f}{\partial x^{2}} + \frac{\partial^{2}f}{\partial y^{2}}=0$
- $\sqrt{{\frac{\partial{f}}{\partial{x}}}^2+{\frac{\partial{f}}{\partial{y}}}^2}\ge T$
Where $T$ is predefined.
2. Discrete sampling of gray values of boundaries
Goal: obtain the discrete sampling points of the boundaries within 2D image and the gray values of these discrete sampling points.
2D image is treated as discrete sampling data sampled from the grid points (i.e. pixels lies on the grid points) of 2D regular grids. Two kinds of cells: edge-cells intersected by boundary, non-edge-cells.
Procedure of finding edge cells:
- detect all edge-cells
- approximate the boundary in each edge-cell by examining the number of interacted edges.
The vertices of a intersected boundary, $p_1$ and $p_2$ has the following properties:
1. $l(p_1)\cdot l(p_2) < 0$
2. $g(p_1)\cdot g(p_2) \ge 2\tilde{T}$
Where gradient threshold $\tilde{T}$ needs to be predefined. The intersected edges can be found in this way.
The simplest method to compute the position and the gray value of an intersecting point is to linearly interpolate the positions and the gray values of two vertices of the edge at which this intersecting point locates.