190 likes | 321 Views
Managing Gigabytes. Ch8. Mixed Text and Images. 2003. 1. 28 임성신. Introduction(1/2). This chapter examines the problem how to separate Text Line drawing (graphic) Halftone each component can be compressed effectively. Three steps in the Process. Orientation(8.1)
E N D
Managing Gigabytes Ch8. Mixed Text and Images 2003. 1. 28 임성신
Introduction(1/2) • This chapter examines the problem how to separate • Text • Line drawing (graphic) • Halftone • each component can be compressed effectively. • Three steps in the Process. • Orientation(8.1) • examine the orientation and correct it for skew • Segmentation(8.2) • Segment the document into visually distinct regions • Classification(8.3) • Classify the regions into text, line drawing, halftone
8.1 Orientation • Tree approaches have been proposed for determining the orientation, or skew angle, of a document image. • The first is to examine the left margin of the text • The second is to look down the page for the gaps – leading • The third is to look at the slopes of imaginary lines joining pairs of marks on the page and see • Hough transform • Assists in locating straight lines(or curves) in image
Orientation - Detecting straight lines using the Hough transform • Hough transform is a line-to-point transformation • 직선에 놓여있는 픽셀을 검출하는데 사용 • n개로 구성된 영상에서 같은 직선에 놓여있는 점을 발견하는 방법 • 모든 쌍의 픽셀로부터 두 점을 연결하는 직선을 구하고 다시 직선과 직선을 비교하여 비슷하거나 같은 것을 비교하여 같은 것들을 한 직선을 나타내는 부분집합으로 분류 • 비교해야 할 직선의 개수 : n(n-1)/2 ≈n2/2 • 이 방법은 너무 계산량이 많다.
Orientation - Detecting straight lines using the Hough transform • n개로 구성된 영상에서 같은 직선에 놓여있는 점을 발견하는 방법 • Hough Transform 1 • 직선의 방정식 y = ax + b를 이용하여 매개변수 a, b에 의해 영상에서 직선의 방정식을 추출해 내는 방법이다. • 픽셀 (xi, yi)를 지나는 직선의 방정식 : • yi = axi + b • 픽셀 (xj, yj)를 지나는 직선의 방정식 : • yj = axj + b • 위의 두 식에 의해 a, b를 구해서 • yk = axk + b를 만족하는 (xk, yk) 는 위의 두점을 지나는 직선을 지난다. • 이 원리로부터 b = yk - axk에 따라 a변수의 값 변화에 따라 b가 같은 픽셀들을 선택할 수 있다.
Orientation - Detecting straight lines using the Hough transform • n개로 구성된 영상에서 같은 직선에 놓여있는 점을 발견하는 방법 • Hough Transform 2 • 위의 Hough Transform 1에서 직선이 y축에 평행해 갈 때 매개변수 a, b가 무한대에 가까워지는 문제점을 해결하기 위해 두 번째 알고리즘은 직선의 식을 • xcosθ + ysinθ = ρ 로 바꾸어 직선을 각도θ 와 거리 ρ의 매개변수로 표현한다. • 이 방법 또한 Hough Transform 1에서와 유사한 방법으로 a, b 대신에 θ, ρ을 매개변수로 2차원 배열을 구성하고 적당한 간격을 둔다. 예를 들어 각도 θ는 1도씩 간격을 두고 범위는 1 ~ 180도, 거리 ρ는 간격 1씩 범위는 전체 영상의 크기를 포용할 수 있을 만큼 또는 검색하고자 원하는 범위만큼 크기를 정한다. 알고리즘은 각도 θ를 고정하고 모든 픽셀을 대입하여 ρ를 구하고 ρ가 범위안에 있으면 배열 A[θ][ρ]를 1 증가시키고 각도 θ 범위안에서 θ를 증가시킨 후 위의 동작을 반복한다.
Orientation - Detecting straight lines using the Hough transform
Orientation – Left-margin search • return to our main problem : detecting the orientation, or skew angle , of a document image • Most printed documents have an easily identifiable vertical left margin. • Unfortunately, this method is not robust • sometimes left margin is broken up by illustration • the text may not be left-justified
Orientation – The projection profile • 수직축을 기준으로 각 라인당 black pixel의 수를 계산하고 그 결과를 히스토그램으로 검사. • If the document is oriented correctly, valleys will occur in the histogram the lines of text.
Orientation – The projection profile • Autocorrelation function of the histogram • The sharpness of the valleys can be quantified h(n) : the value of the histogram at vertical position n
Orientation – From slope histogram to docstrum • Histogram based techniques that reflect the pairwisw relationship between marks in the image.
8.2 Segmentation • To divide the document image into regions that contain either text, graphics, or a halftone picture. • Three critical issues • Regions • Scale • Prior information
Segmentation – Bottom-up segmentation methods • run-length smoothing algorithm – blurring, smearing
8.3 Classification • Analyzing the layout is to classify the regions as text, line drawings, and halftone images.