[영역처리] Thinning (세선화) --- ③
2003.09.01
위의 그림은 알고리즘을 적용한 실험결과.
Zhang Suen 세선화 알고리즘의 주요부분임.
소스코드(주요부분)
// mark and delete pixels.
While Again = 1 Do
Begin
again := 0;
// Second sub-iteration.
For row := 1 To sy -2 Do
For col := 1 To sx -2 Do
Begin
If tTgt[col, row] <> 1 Then
Continue;
k := nays8(tTgt, col, row);
If ( (k >= 2) And (k <= 6) ) And (Connectivity(tTgt, col, row) = 1) Then
Begin
If ( tTgt[col+1, row] * tTgt[col, row-1] * tTgt[col-1, row] = 0) And
( tTgt[col, row-1] * tTgt[col, row+1] * tTgt[col-1, row] = 0) Then
Begin
localTgt[col, row] := 1;
again := 1;
End;
// of if ..else.
End // End of if tTgt.
End; // Of For col.
// End of For row.
// delete pixel.
DeletePixel(tTgt, localTgt);
If Again = 0 Then
Break;
// First sub-iteration.
For row := 1 To sy -2 Do
For col := 1 To sx -2 Do
Begin
If tTgt[col, row] <> 1 Then
Continue;
k := nays8(tTgt, col, row);
If ( (k >= 2) And (k <= 6) ) And (Connectivity(tTgt, col, row) = 1) Then
Begin
If ( tTgt[col, row-1] * tTgt[col+1, row] * tTgt[col, row+1] = 0) And
( tTgt[col+1, row] * tTgt[col, row+1] * tTgt[col-1, row] = 0) Then
Begin
localTgt[col, row] := 1;
again := 1;
End;
// of if ..else.
End // End of if tTgt.
End; // Of For col.
// End of For row.
// delete pixel.
deletePixel(tTgt, localTgt);
End; // of While Again.
'IT-개발,DB' 카테고리의 다른 글
[기사] 디지털정보기기 '워터마킹' 속속 채택 (0) | 2016.07.05 |
---|---|
DRM(Digital Rights Management) 알아보고 싶지 (0) | 2016.07.05 |
[영역처리] Thinning (세선화) --- ② (0) | 2016.07.04 |
[영역처리] Thinning(세선화) -- ① (0) | 2016.07.04 |
[개념] DCT(Discrete Cosine Transform) 압축 기술 (1) | 2016.07.04 |
댓글