KR102340303B1 - Method for acquiring binary edge image and computer readable recording medium having computer program recorded therefor - Google Patents

Method for acquiring binary edge image and computer readable recording medium having computer program recorded therefor Download PDF

Info

Publication number
KR102340303B1
KR102340303B1 KR1020150038982A KR20150038982A KR102340303B1 KR 102340303 B1 KR102340303 B1 KR 102340303B1 KR 1020150038982 A KR1020150038982 A KR 1020150038982A KR 20150038982 A KR20150038982 A KR 20150038982A KR 102340303 B1 KR102340303 B1 KR 102340303B1
Authority
KR
South Korea
Prior art keywords
pixels
edge
binary edge
image
gray scale
Prior art date
Application number
KR1020150038982A
Other languages
Korean (ko)
Other versions
KR20160112738A (en
Inventor
유연걸
백영민
박주형
Original Assignee
한화정밀기계 주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 한화정밀기계 주식회사 filed Critical 한화정밀기계 주식회사
Priority to KR1020150038982A priority Critical patent/KR102340303B1/en
Publication of KR20160112738A publication Critical patent/KR20160112738A/en
Application granted granted Critical
Publication of KR102340303B1 publication Critical patent/KR102340303B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection

Abstract

본 발명의 실시예에 따른 이진 에지 이미지 획득 방법은, 그레이 스케일 이미지를 생성하는 단계, 상기 그레이 스케일 이미지 내의 복수의 영역에서 각 영역 별로 에지도(edgeness)가 높은 순서로 N개의 픽셀을 선정하는 단계, 상기 선정된 복수의 픽셀들의 에지도의 평균을 기초로 하한값을 연산하는 단계, 상기 선정된 복수의 픽셀들 중 에지도가 상기 하한값 이하 또는 미만인 픽셀을 제외한 나머지 픽셀들의 에지도의 평균을 기초로 상한값을 연산하는 단계, 상기 상한값과 상기 하한값 사이에서 이진 에지 임계값을 선정하는 단계 및 상기 선정된 이진 에지 임계값을 기준으로 상기 그레이 스케일 이미지를 이진 처리하는 단계를 포함한다A method for obtaining a binary edge image according to an embodiment of the present invention includes the steps of generating a gray scale image, selecting N pixels in the order of increasing edgeness for each region from a plurality of regions in the gray scale image , calculating a lower limit value based on the average of the edge maps of the plurality of selected pixels, based on the average of the edge maps of the remaining pixels except for pixels having an edge map of the plurality of selected pixels equal to or less than the lower limit value calculating an upper limit value, selecting a binary edge threshold value between the upper limit value and the lower limit value, and performing binary processing of the grayscale image based on the selected binary edge threshold value

Description

이진 에지 이미지 획득 방법 및 이를 실행하기 위한 프로그램이 기록되는 컴퓨터로 읽을 수 있는 기록매체{Method for acquiring binary edge image and computer readable recording medium having computer program recorded therefor}Method for acquiring binary edge image and a computer readable recording medium in which a program for executing the same is recorded

본 발명은 이진 에지 이미지 획득 방법 및 이를 실행하기 위한 프로그램이 기록되는 컴퓨터로 읽을 수 있는 기록매체에 관한 것으로서, 보다 상세하게는 이미지 내 형상의 에지 부분을 이진화한 이진 에지 이미지를 획득하는 방법과 그 방법을 실행하기 위한 프로그램이 기록되는 컴퓨터로 읽을 수 있는 기록매체에 관한 것이다.The present invention relates to a method for obtaining a binary edge image and a computer-readable recording medium on which a program for executing the same is recorded, and more particularly, to a method for obtaining a binary edge image obtained by binarizing an edge portion of a shape in an image and the same It relates to a computer-readable recording medium in which a program for executing a method is recorded.

직접회로, 다이오드, 콘덴서, 저항, 트랜지스터 등의 다양한 종류와 크기의 전자 부품을 고속으로 인쇄회로기판에 실장하는 칩마운터는 전자 부품의 정확한 실장을 위한 비전 알고리즘이 필수적으로 사용된다.In a chip mounter that mounts various types and sizes of electronic components such as integrated circuits, diodes, capacitors, resistors, and transistors on a printed circuit board at high speed, a vision algorithm is essential for accurate mounting of electronic components.

전자 부품에 대한 비전 알고리즘은 카메라를 이용하여 전자 부품을 촬영한 이미지를 통해 전자 부품의 종류 및 틀어짐 등을 파악하고 이를 반영하여 전자 부품이 요구되는 위치에 요구되는 방향으로 장착되도록 한다.The vision algorithm for electronic parts uses a camera to identify the types and distortions of electronic parts through images taken, and reflects them so that the electronic parts are mounted in a required position and in a required direction.

전자 부품 이미지를 비전 알고리즘에 사용하기 위해서는 전자 부품 이미지를 명확한 윤곽 정보가 필요하다. 이를 위해 비전 알고리즘을 카메라가 촬영한 전자 부품 이미지로부터 이진 에지 이미지(binary edge image)를 추출하는데, 이진 에지 이미지를 추출하기 위해서는 이미지에 대한 이진 처리의 기준이 되는 이진 에지 임계값(binary edge threshold)이 요구된다.In order to use the electronic component image in the vision algorithm, clear outline information of the electronic component image is required. To this end, the vision algorithm extracts a binary edge image from the electronic component image taken by the camera. this is required

종래의 비전 알고리즘은 이진 에지 임계값(binary edge threshold)을 사용자가 입력하도록 구성되어 있는데, 전자 부품의 다양성과 전자 부품이 촬영되는 다양한 조명 환경으로 인해 이진 에지 임계값을 일률적으로 결정하여 사용할 수 없다.The conventional vision algorithm is configured to input a binary edge threshold by a user, but due to the diversity of electronic components and various lighting environments in which electronic components are photographed, the binary edge threshold cannot be uniformly determined and used. .

예를 들어, 동일한 이진 에지 임계값을 사용하더라고 전자 부품의 종류에 따라 또는 전자 부품이 촬영된 조명 환경에 따라 이진 에지 이미지의 품질이 달라지게 된다.For example, even if the same binary edge threshold is used, the quality of the binary edge image varies according to the type of electronic component or the lighting environment in which the electronic component is photographed.

본 발명이 해결하고자 하는 과제는, 이진 에지 영상을 자동으로 획득하는 이진 에지 이미지 획득 방법 및 이를 실행하기 위한 프로그램이 기록되는 컴퓨터로 읽을 수 있는 기록매체를 제공하는 것이다.An object of the present invention is to provide a binary edge image acquisition method for automatically acquiring a binary edge image, and a computer-readable recording medium in which a program for executing the same is recorded.

본 발명의 과제들은 이상에서 언급한 과제로 제한되지 않으며, 언급되지 않은 또 다른 과제들은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.The problems of the present invention are not limited to the problems mentioned above, and other problems not mentioned will be clearly understood by those skilled in the art from the following description.

상기 과제를 해결하기 위한 본 발명의 실시예에 따른 이진 에지 이미지 획득 방법은, 그레이 스케일 이미지를 생성하는 단계, 상기 그레이 스케일 이미지 내의 복수의 영역에서 각 영역 별로 에지도(edgeness)가 높은 순서로 N개의 픽셀을 선정하는 단계, 상기 선정된 복수의 픽셀들의 에지도의 평균을 기초로 하한값을 연산하는 단계, 상기 선정된 복수의 픽셀들 중 에지도가 상기 하한값 이하 또는 미만인 픽셀을 제외한 나머지 픽셀들의 에지도의 평균을 기초로 상한값을 연산하는 단계, 상기 상한값과 상기 하한값 사이에서 이진 에지 임계값을 선정하는 단계 및 상기 선정된 이진 에지 임계값을 기준으로 상기 그레이 스케일 이미지를 이진 처리하는 단계를 포함한다.The method for obtaining a binary edge image according to an embodiment of the present invention for solving the above problems includes the steps of generating a gray scale image, and in a plurality of regions in the gray scale image, N in the order of increasing edgeness for each region selecting pixels, calculating a lower limit value based on an average of edge degrees of the plurality of selected pixels, and edges of pixels other than a pixel having an edge degree of less than or equal to the lower limit among the selected plurality of pixels calculating an upper limit value based on the average of the figures, selecting a binary edge threshold value between the upper limit value and the lower limit value, and binary processing the gray scale image based on the selected binary edge threshold value .

본 발명의 기타 구체적인 사항들은 상세한 설명 및 도면들에 포함되어 있다.Other specific details of the invention are included in the detailed description and drawings.

본 발명의 실시예들에 의하면 적어도 다음과 같은 효과가 있다.According to the embodiments of the present invention, there are at least the following effects.

이진 에지 임계값을 자동으로 연산하여 보다 정확한 이진 에지 이미지를 보다 간편하게 확보할 수 있다.By automatically calculating the binary edge threshold, it is easier to obtain a more accurate binary edge image.

본 발명에 따른 효과는 이상에서 예시된 내용에 의해 제한되지 않으며, 더욱 다양한 효과들이 본 명세서 내에 포함되어 있다.The effect according to the present invention is not limited by the contents exemplified above, and more various effects are included in the present specification.

도 1은 본 발명의 일 실시예에 따른 이진 에지 이미지 획득 방법을 도시한 순서도이다.
도 2는 도 1의 S10 단계에서 입력되는 부품 이미지의 일례를 개략적으로 도시한 것이다.
도 3은 도 2의 부품 이미지에 대해 도 1의 S20 단계에서 소벨 연산에 의해 생성된 그레이 스케일 이미지를 도시한 것이다.
도 4는 도 1의 S20 단계의 그레이 스케일 이미지에 대해 도 1의 S30 단계에서 선택된 픽셀들의 분포를 표시한 그래프이다.
도 5는 도 1의 S40 단계에서 생성된 1차 히스토그램(H1)이다.
도 6은 도 1의 S20 단계의 그레이 스케일 이미지 내의 전체 픽셀들에 대한 히스토그램이다.
도 7은 도 5의 1차 히스토그램(H1) 상에 도 1의 S50 단계에서 연산된 이진 에지 임계값의 하한값을 표현한 히스토그램이다.
도 8은 도 1의 S60 단계에서 생성된 2차 히스토그램(H2) 및 S70 단계에서 연산된 이진 에지 임계값의 상한값을 표현한 히스토그램이다.
도 9는 도 1의 S90 단계에서 최종 생성된 이진 에지 이미지를 도시한 것이다.
1 is a flowchart illustrating a binary edge image acquisition method according to an embodiment of the present invention.
FIG. 2 schematically illustrates an example of a component image input in step S10 of FIG. 1 .
FIG. 3 shows a gray scale image generated by the Sobel operation in step S20 of FIG. 1 with respect to the part image of FIG. 2 .
FIG. 4 is a graph showing the distribution of pixels selected in step S30 of FIG. 1 with respect to the gray scale image of step S20 of FIG. 1 .
FIG. 5 is a primary histogram H1 generated in step S40 of FIG. 1 .
6 is a histogram of all pixels in the gray scale image of step S20 of FIG. 1 .
FIG. 7 is a histogram representing the lower limit of the binary edge threshold calculated in step S50 of FIG. 1 on the primary histogram H1 of FIG. 5 .
8 is a histogram expressing the secondary histogram H2 generated in step S60 of FIG. 1 and the upper limit value of the binary edge threshold calculated in step S70 of FIG. 1 .
FIG. 9 illustrates a binary edge image finally generated in step S90 of FIG. 1 .

본 발명의 이점 및 특징, 그리고 그것들을 달성하는 방법은 첨부되는 도면과 함께 상세하게 후술되어 있는 실시예들을 참조하면 명확해질 것이다. 그러나 본 발명은 이하에서 개시되는 실시예들에 한정되는 것이 아니라 서로 다른 다양한 형태로 구현될 수 있으며, 단지 본 실시예들은 본 발명의 개시가 완전하도록 하고, 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 발명의 범주를 완전하게 알려주기 위해 제공되는 것이며, 본 발명은 청구항의 범주에 의해 정의될 뿐이다. 명세서 전체에 걸쳐 동일 참조 부호는 동일 구성 요소를 지칭한다.Advantages and features of the present invention and methods of achieving them will become apparent with reference to the embodiments described below in detail in conjunction with the accompanying drawings. However, the present invention is not limited to the embodiments disclosed below, but may be implemented in various different forms, and only these embodiments allow the disclosure of the present invention to be complete, and common knowledge in the art to which the present invention pertains It is provided to fully inform those who have the scope of the invention, and the present invention is only defined by the scope of the claims. Like reference numerals refer to like elements throughout.

또한, 본 명세서에서 기술하는 실시예들은 본 발명의 이상적인 예시도인 단면도 및/또는 개략도들을 참고하여 설명될 것이다. 따라서, 제조 기술 및/또는 허용 오차 등에 의해 예시도의 형태가 변형될 수 있다. 또한 본 발명에 도시된 각 도면에 있어서 각 구성 요소들은 설명의 편의를 고려하여 다소 확대 또는 축소되어 도시된 것일 수 있다. 명세서 전체에 걸쳐 동일 참조 부호는 동일 구성 요소를 지칭한다.Further, the embodiments described herein will be described with reference to cross-sectional and/or schematic diagrams that are ideal illustrative views of the present invention. Accordingly, the shape of the illustrative drawing may be modified due to manufacturing technology and/or tolerance. In addition, in each of the drawings shown in the present invention, each component may be enlarged or reduced to some extent in consideration of convenience of description. Like reference numerals refer to like elements throughout.

이하, 본 발명의 일 실시예에 따른 이진 에지 이미지 획득 방법을 설명하기 위한 도면들을 참고하여 본 발명에 대하여 설명하도록 한다.Hereinafter, the present invention will be described with reference to drawings for explaining a method for obtaining a binary edge image according to an embodiment of the present invention.

도 1은 본 발명의 일 실시예에 따른 이진 에지 이미지 획득 방법을 도시한 순서도이다.1 is a flowchart illustrating a binary edge image acquisition method according to an embodiment of the present invention.

도 1에 도시된 바와 같이, 본 발명의 일 실시예에 따른 이진 에지 이미지 획득 방법은 부품 이미지가 입력되는 단계(S10), 그레이 스케일 이미지를 생성하는 단계(S20), 영역 별로 N개의 픽셀을 선정하는 단계(S30), 1차 히스토그램(H1)을 생성하는 단계(S40), 이진 에지 임계값의 하한값을 연산하는 단계(S50), 2차 히스토그램(H2)을 생성하는 단계(S60), 이진 에지 임계값의 상한값을 연산하는 단계(S70), 이진 에지 임계값을 선정하는 단계(S80) 및 이진 에지 이미지를 생성하는 단계(S90)를 포함한다.As shown in Fig. 1, the binary edge image acquisition method according to an embodiment of the present invention includes a step of inputting a part image (S10), a step of generating a gray scale image (S20), and selecting N pixels for each area. (S30), generating a primary histogram (H1) (S40), calculating a lower limit value of the binary edge threshold value (S50), generating a secondary histogram (H2) (S60), binary edge Calculating the upper limit of the threshold value (S70), selecting a binary edge threshold value (S80), and generating a binary edge image (S90) are included.

부품 이미지가 입력되는 단계(S10)는 인쇄회로기판 상에 실장될 예정이거나 이미 실장된 부품을 촬영한 이미지가 입력되는 단계이다. 도 2는 도 1의 S10 단계에서 입력되는 부품 이미지의 일례를 도시한 것이다.The step S10 of inputting the component image is a step of inputting an image of a component to be mounted on a printed circuit board or already mounted on the printed circuit board. FIG. 2 shows an example of a component image input in step S10 of FIG. 1 .

도 2에 도시된 바와 같이, 입력된 부품 이미지(I1)는 부품와 배경이 함께 존재하는 이미지일 수 있다.As shown in FIG. 2 , the input part image I1 may be an image in which the part and the background exist together.

부품 이미지가 입력되는 단계(S10)는 카메라에 의해 촬영된 부품 이미지가 실시간으로 입력되도록 구성될 수 있다. 이를 위해 본 발명의 일 실시예에 따른 이진 에지 이미지 획득 방법이 사용되는 장치는 부품을 촬영하는 카메라를 포함하거나 카메라가 촬영한 이미지 데이터를 전송 받을 수 있도록 구성될 수 있다.The step (S10) of inputting the part image may be configured such that the part image photographed by the camera is input in real time. To this end, the apparatus using the binary edge image acquisition method according to an embodiment of the present invention may include a camera for photographing parts or may be configured to receive image data photographed by the camera.

또는, 부품 이미지가 입력되는 단계(S10)는 별도의 저장 매체에 저장된 부품 이미지가 로딩되도록 구성될 수 있다. 이를 위해 본 발명의 일 실시예에 따른 이진 에지 이미지 획득 방법이 사용되는 장치는 부품 이미지들이 데이터로 저장되는 저장 매체를 포함하거나 저장 매체로부터 이미지 데이터를 전송 받을 수 있도록 구성될 수 있다.Alternatively, the step of inputting the part image ( S10 ) may be configured to load the part image stored in a separate storage medium. To this end, the apparatus using the binary edge image acquisition method according to an embodiment of the present invention may include a storage medium in which part images are stored as data or may be configured to receive image data from the storage medium.

그레이 스케일 이미지를 생성하는 단계(S20)를 S10 단계에서 입력된 부품 이미지를 처리하여 그레이 스케일 이미지로 변환하는 단계이다. 본 발명의 일 실시예에 따른 이진 에지 이미지 획득 방법에서의 그레이 스케일 이미지란, 백색과 흑색을 포함하는 회색의 농담으로 표현된 이미지로서, 흑색과 백색으로만 구성되지 않은 이미지를 의미한다. 그레이 스케일 이미지는 회색의 농담이 0부터 255까지 256단계로 구분되어 표현된 이미지일 수 있으며 0과 255는 각각 흑색과 백색을 의미할 수 있다. The step of generating the gray scale image ( S20 ) is a step of processing the part image input in step S10 and converting it into a gray scale image. A gray scale image in the method for obtaining a binary edge image according to an embodiment of the present invention is an image expressed in shades of gray including white and black, and refers to an image that is not composed of only black and white. The gray scale image may be an image in which the gray scale is divided into 256 levels from 0 to 255, and 0 and 255 may mean black and white, respectively.

그레이 스케일 이미지를 생성하는 단계(S20)에서는 컬러 이미지를 그레이 스케일 이미지로 변환하는 처리가 이루어질 수 있다. S10 단계에서 입력된 부품 이미지가 그레이 스케일의 이미지인 경우에는, 입력된 이미지를 그대로 본 실시예의 그레이 스케일 이미지로서 사용할 수 있다.In the step of generating the gray scale image ( S20 ), a process of converting a color image into a gray scale image may be performed. When the part image input in step S10 is a gray scale image, the input image may be used as a gray scale image of the present embodiment as it is.

또한, 보다 효과적인 이진 에지 처리를 위해, 그레이 스케일 이미지를 생성하는 단계(S20)에서는 S10 단계에서 입력된 부품 이미지에 대해 이미지 내 형상의 윤곽 부분이 두드러지도록 하는 에지 처리가 이루어질 수 있다.In addition, for more effective binary edge processing, in the step S20 of generating the gray scale image, edge processing for making the contour portion of the shape in the image stand out may be performed on the part image input in step S10 .

에지 처리에 대한 방법으로는, 다음 표와 같이 행렬 연산자를 사용하는 에지 처리 방법들이 있다.As a method for edge processing, there are edge processing methods using a matrix operator as shown in the following table.

연산자 명operator name f(x)f(x) f(y)f(y) RobertsRoberts

Figure 112015027641112-pat00001
Figure 112015027641112-pat00001
Figure 112015027641112-pat00002
Figure 112015027641112-pat00002
PrewittPrewitt
Figure 112015027641112-pat00003
Figure 112015027641112-pat00003
Figure 112015027641112-pat00004
Figure 112015027641112-pat00004
SobelSobel
Figure 112015027641112-pat00005
Figure 112015027641112-pat00005
Figure 112015027641112-pat00006
Figure 112015027641112-pat00006

본 실시예에 따른 그레이 스케일 이미지를 생성하는 단계(S20)에서는 수평, 수직 에지 및 대각성 방향의 에지를 추출할 수 있고 잡음에 강한 소벨(Sobel) 연산을 사용한 예를 기준으로 설명한다. 도 3은 도 2에 도시된 부품 이미지에 대해 도 1의 S20 단계에서 소벨 연산에 의해 생성된 그레이 스케일 이미지를 도시한 것이다.In the step (S20) of generating a grayscale image according to the present embodiment, an example in which a Sobel operation capable of extracting horizontal, vertical edges, and diagonal edges and a strong noise-resistant Sobel operation is used will be described. FIG. 3 shows a gray scale image generated by the Sobel operation in step S20 of FIG. 1 with respect to the part image shown in FIG. 2 .

한편, 영역 별로 N개의 픽셀을 선정하는 단계(S30)에서는 S20 단계에서 생성된 그레이 스케일 이미지 내의 복수의 영역에서 각 영역 별로 N개의 픽셀을 선정한다.Meanwhile, in the step of selecting N pixels for each area ( S30 ), N pixels are selected for each area from a plurality of areas in the gray scale image generated in step S20 .

복수의 영역은 그레이 스케일 이미지를 등분하여 설정된다. 예를 들어, 복수의 영역은 그레이 스케일 이미지(I2)를 복수의 열 및/또는 복수의 행으로 등분하여 설정될 수 있다. 또는 복수의 영역은 그레이 스케일 이미지(I2)를 각 픽셀 열 및/또는 각 픽셀 행으로 분할 설정될 수 있다. 본 실시예에서는 복수의 영역이 그레이 스케일 이미지(I2)를 각 픽셀 열로 분할 설정되는 경우를 기준으로 설명한다.A plurality of regions are set by dividing the gray scale image into equal parts. For example, the plurality of regions may be set by equally dividing the gray scale image I2 into a plurality of columns and/or a plurality of rows. Alternatively, the plurality of regions may be set by dividing the gray scale image I2 into each pixel column and/or each pixel row. In this embodiment, a case in which a plurality of regions is set by dividing the gray scale image I2 into respective pixel columns will be described as a reference.

각 영역 별로 선정되는 N개의 픽셀은 각 영역을 구성하는 픽셀들 중 에지도(edgeness)가 높은 순서로 선정된다. 예를 들어, 복수의 영역이 그레이 스케일 이미지(I2)를 각 픽셀 열로 분할 설정되는 경우에는, 각 픽셀 열을 구성하는 복수의 픽셀들 중 에지도(edgeness)가 높은 순서로 N개의 픽셀이 선택된다. The N pixels selected for each region are selected in order of highest edgeness among pixels constituting each region. For example, when a plurality of regions is set by dividing the gray scale image I2 into each pixel column, N pixels are selected in an order of increasing edgeness among a plurality of pixels constituting each pixel column. .

N은 하나의 픽셀 열을 구성하는 픽셀 수의 약 10%에 해당하는 정수일 수 있다. 예를 들어, 하나의 픽셀 열이 1024개의 픽셀로 구성된 경우에는 1024의 픽셀 중 102개의 픽셀이 선택될 수 있다. 이는 N이 선택되는 하나의 예를 설명한 것으로서, N은 하나의 픽셀 열을 구성하는 픽셀 수의 상위 몇 %와 같이 상대적인 수치로 결정될 수도 있고, 50개, 100개 등과 같이 절대적인 수치로 결정될 수도 있다.N may be an integer corresponding to about 10% of the number of pixels constituting one pixel column. For example, when one pixel column consists of 1024 pixels, 102 pixels among 1024 pixels may be selected. This describes an example in which N is selected, and N may be determined as a relative number such as a top few percent of the number of pixels constituting one pixel column, or may be determined as an absolute number such as 50 or 100.

에지도(edgeness)는 그레이 스케일 이미지 내에서 256단계로 구분되어 표현된 회색의 농담 수치일 수 있다. 또는 소벨(Sobel) 연산 등의 에지 처리를 통해 각 픽셀이 갖는 수치일 수 있다.The edgeness may be a gray scale value expressed by being divided into 256 steps in a gray scale image. Alternatively, it may be a numerical value of each pixel through edge processing such as a Sobel operation.

도 4는 도 1의 S20 단계의 그레이 스케일 이미지에 대해 도 1의 S30 단계에서 선택된 픽셀들의 분포를 표시한 그래프이다. 도 4에 도시된 그래프의 가로 방향은 각 픽셀 열들의 분포로서 그레이 스케일 이미지의 가로 방향과 대응되고, 도 4에 도시된 그래프의 세로 방향은 에지도(edgeness)이다.FIG. 4 is a graph showing the distribution of pixels selected in step S30 of FIG. 1 with respect to the gray scale image of step S20 of FIG. 1 . The horizontal direction of the graph shown in FIG. 4 corresponds to the horizontal direction of the gray scale image as a distribution of each pixel column, and the vertical direction of the graph shown in FIG. 4 is edgeness.

도 4에 도시된 바와 같이, 각 픽셀 열마다 에지도(edgeness)가 높은 순서로 N개의 픽셀들을 선택함에 따라, 배경의 노이즈 에지(Noise edge in background), 부품 영역 내 노이즈 에지(Noise edge in part region), 부품 영역 내 유효 에지(Valid edge in part region)이 대략적으로 구별된다.As shown in FIG. 4 , as N pixels are selected in the order of high edgeness for each pixel column, a noise edge in the background and a noise edge in part region) and a valid edge in part region are roughly distinguished.

부품 이미지는 대부분 중앙에 부품이 위치하고 이미지의 양측에는 배경이 형성된다. 그리고, 부품 이미지에 대한 그레이 스케일 이미지에서 배경과 대응하는 픽셀들은 대부분 흑색에 가까우며 인접하는 픽셀과 쉽게 구분되지 않으므로 낮은 에지도(edgeness)를 갖는다.Most of the part image is with the part in the center and the background is formed on both sides of the image. In addition, pixels corresponding to the background in the gray scale image of the part image are mostly close to black and are not easily distinguished from adjacent pixels, and thus have low edgeness.

따라서, 도 4에 도시된 바와 같이, 배경 부분에 해당하는 그래프의 양측 픽셀 열들에서 각각 선택된 N개의 픽셀들은 대부분 그래프의 하단에 밀집되어 있게 되고, 이들은 배경의 노이즈 에지(Noise edge in background)에 해당함을 쉽게 파악할 수 있다.Accordingly, as shown in FIG. 4 , most of the N pixels selected from both pixel columns of the graph corresponding to the background portion are concentrated at the bottom of the graph, and these correspond to the noise edge in the background. can be easily identified.

한편, 부품 이미지에서 부품은 대부분 중앙에 위치하며, 부품 이미지의 그레이 스케일 이미지에서 부품에 대응하는 픽셀들은 배경에 비해 밝게 표현된다.On the other hand, in the part image, the part is mostly located in the center, and pixels corresponding to the part in the gray scale image of the part image are expressed brighter than the background.

따라서, 도 4에 도시된 바와 같이, 부품이 위치하는 그래프 중앙부의 픽셀 열들에서 각각 선택된 N개의 픽셀들은 배경의 노이즈 에지(Noise edge in background) 비해 상부에 위치한다.Accordingly, as shown in FIG. 4 , each of the N pixels selected from the pixel columns in the center of the graph where the component is located is located above the noise edge in the background.

그리고, 도 4에 도시된 바와 같이, 부품에 대응하는 픽셀들은 그래프의 상부에 위치하는 부품 영역 내 유효 에지(Valid edge in part region)와, 그보다는 낮게 위치하는 부품 영역 내 노이즈 에지(Noise edge in part region)로 구별된다.And, as shown in FIG. 4 , the pixels corresponding to the part have a valid edge in part region positioned at the upper part of the graph, and a noise edge in the part region positioned lower than that. part region).

부품 영역 내 유효 에지(Valid edge in part region)는 실질적인 부품 에지에 대응하는 픽셀들에 해당한다. 도 3에서 실질적인 부품 에지는 가장 밝은 색으로 표현되며, 에지는 선에 가깝게 표현되어 인접하는 픽셀과 확실하게 구별되므로 높은 에지도(edgeness)를 갖는다. 따라서, 도 4의 그래프에서 이들 픽셀들은 상부에 위치하게 된다. 도 3에 도시된 바와 같이, 가장 밝은 색으로 표현된 부품 에지가 양측에 위치하기 때문에 도 4의 그래프에서도 부품 영역 내 유효 에지(Valid edge in part region)가 2개의 군으로 표현되었다.A valid edge in a part region corresponds to pixels corresponding to an actual part edge. In FIG. 3 , an actual part edge is expressed in the brightest color, and the edge is expressed close to a line to be clearly distinguished from an adjacent pixel, and thus has high edgeness. Accordingly, in the graph of FIG. 4, these pixels are located at the top. As shown in FIG. 3 , since the edge of the part expressed in the brightest color is located on both sides, the valid edge in the part region is expressed in two groups in the graph of FIG. 4 as well.

한편, 부품 영역 내 노이즈 에지(Noise edge in part region)는 실질적인 부품 에지가 아닌 픽셀들에 해당한다. 그레이 스케일 이미지에서 부품의 에지가 아닌 면에 해당되는 부분은 배경보다는 밝게 표현되지만 부품의 에지보다는 어둡게 표현되며, 면이므로 인접하는 픽셀과 쉽게 구분되지 않으므로 부품 영역 내 유효 에지(Valid edge in part region)보다는 낮은 에지도(edgeness)를 갖는다. 따라서, 도 4의 그래프에서 이들 픽셀들은 부품 영역 내 유효 에지(Valid edge in part region)와 배경의 노이즈 에지(Noise edge in background) 사이에 위치하게 된다.Meanwhile, a noise edge in part region corresponds to pixels that are not actual part edges. In the gray scale image, the part corresponding to the non-edge part of the part is expressed brighter than the background, but darker than the part's edge. It has a lower edgeness than Accordingly, in the graph of FIG. 4 , these pixels are positioned between a valid edge in part region and a noise edge in background.

도 4에서 각 픽셀 열마다 선택된 N개의 픽셀들에 대한 에지도(edgeness) 분포에 의해 표현된 바와 같이, 부품 영역 내 유효 에지(Valid edge in part region)를 배경의 노이즈 에지(Noise edge in background) 및 부품 영역 내 노이즈 에지(Noise edge in part region)로부터 구별한다면, 유효한 에지들을 추출할 수 있다.As expressed by the edgeness distribution for N pixels selected for each pixel column in FIG. 4 , a valid edge in part region is defined as a noise edge in the background. and a noise edge in part region, valid edges can be extracted.

부품 영역 내 유효 에지(Valid edge in part region)를 배경의 노이즈 에지(Noise edge in background) 및 부품 영역 내 노이즈 에지(Noise edge in part region)과 구별할 수 있는 이진 에지 임계값을 찾기 위해 다음의 단계들을 수행할 수 있다.To find a binary edge threshold that can distinguish a valid edge in part region from Noise edge in background and Noise edge in part region, steps can be performed.

1차 히스토그램(H1)을 생성하는 단계(S40)에서는 S30 단계에서 각 픽셀 열마다 선택된 N개의 픽셀들을 이용해 1차 히스토그램(H1)을 생성한다.In the step S40 of generating the first histogram H1, the first histogram H1 is generated using the N pixels selected for each pixel column in step S30.

도 5는 도 1의 S40 단계에서 생성된 1차 히스토그램이다.5 is a primary histogram generated in step S40 of FIG. 1 .

도 5에 도시된 바와 같이, 1차 히스토그램(H1)은 가로축이 각 픽셀들의 에지도(edgeness)이고, 세로축이 픽셀의 수(Number of pixel)가 되도록 생성된다.As shown in FIG. 5 , the primary histogram H1 is generated such that the horizontal axis represents the edgeness of each pixel and the vertical axis represents the number of pixels.

도 5에 도시된 바와 같이, 1차 히스토그램(H1) 내에서 픽셀들은 에지도(edgeness)에 따라 크게 3개의 군(A1, A2, A3)을 형성한다. 제1 군(A1)은 도 4의 배경의 노이즈 에지(Noise edge in background)에 대응하는 픽셀들로 이루어지고, 제2 군(A2)은 도 4의 부품 영역 내 노이즈 에지(Noise edge in part region)에 대응되는 픽셀들로 이루어지며, 제3 군(A3)은 부품 영역 내 유효 에지(Valid edge in part region)에 대응되는 픽셀들로 이루어진다.As shown in FIG. 5 , pixels in the primary histogram H1 largely form three groups A1 , A2 , and A3 according to edgeness. The first group A1 includes pixels corresponding to a noise edge in the background of FIG. 4 , and the second group A2 is a noise edge in part region of FIG. 4 . ), and the third group A3 includes pixels corresponding to a valid edge in a part region.

한편, 도 6은 S20 단계의 그레이 스케일 이미지 내의 전체 픽셀들에 대한 히스토그램이다.Meanwhile, FIG. 6 is a histogram of all pixels in the gray scale image of step S20.

S30 단계를 거치지 않고 S20 단계의 그레이 스케일 이미지의 이미지 내 전체 픽셀들을 대상으로 히스토그램(H0)을 생성하는 경우에는, 도 6에 도시된 바와 같이, 부품 영역 내 유효 에지(Valid edge in part region)는 물론 부품 영역 내 노이즈 에지(Noise edge in part region)와 배경의 노이즈 에지(Noise edge in background)이 상호 구분되지 않는다.When the histogram H0 is generated for all pixels in the image of the gray scale image of step S20 without going through step S30, as shown in FIG. 6, a valid edge in part region is Of course, a noise edge in part region and a noise edge in background are not distinguished from each other.

이진 에지 임계값의 하한값을 연산하는 단계(S50)에서는, S40 단계에서 생성된 1차 히스토그램(H1)을 기초로 이진 에지 임계값의 하한값(TL)을 연산한다.In step S50 of calculating the lower limit of the binary edge threshold, the lower limit T L of the binary edge threshold is calculated based on the primary histogram H1 generated in step S40.

도 7은 도 5의 1차 히스토그램 상에 도 1의 S50 단계에서 연산된 이진 에지 임계값의 하한값을 표현한 히스토그램이다.FIG. 7 is a histogram representing the lower limit of the binary edge threshold calculated in step S50 of FIG. 1 on the primary histogram of FIG. 5 .

이진 에지 임계값의 하한값(TL)은 1차 히스토그램(H1)의 평균으로 계산될 수 있다. 즉, 1차 히스토그램(H1)에 표현된 각 픽셀들의 에지도(edgeness)의 평균이 이진 에지 임계값의 하한값(TL)이 될 수 있다. The lower limit value T L of the binary edge threshold value may be calculated as an average of the primary histogram H1 . That is, the average of edgeness of each pixel expressed in the primary histogram H1 may be the lower limit value T L of the binary edge threshold value.

도 7에 도시된 바와 같이, 1차 히스토그램(H1)에 표현된 픽셀들 중의 상당 수가 제1 군(A1)에 위치하므로, 이진 에지 임계값의 하한값(TL)은 제1 군(A1)에 근접하거나 제1 군(A1)과 제2 군(A2) 사이 또는 제2 군(A2) 내에 위치할 수 있다. As shown in FIG. 7 , since a significant number of pixels expressed in the primary histogram H1 are located in the first group A1, the lower limit value of the binary edge threshold value T L is in the first group A1. It may be located adjacent to, between the first group A1 and the second group A2 or within the second group A2.

또는, 이진 에지 임계값의 하한값을 연산하는 단계(S50)는 1차 히스토그램(H1)을 생성하는 단계(S40)를 거치지 않고, 영역 별로 N개의 픽셀을 선정하는 단계(S30) 이후에 수행될 수 있다. 이 경우에는 1차 히스토그램(H1)을 별도로 생성하지 않고, S30 단계에서 선택된 픽셀들의 에지도(edgeness)를 합산하고 픽셀의 수로 나누어 이진 에지 임계값의 하한값(TL)을 연산할 수 있다.Alternatively, the step of calculating the lower limit of the binary edge threshold (S50) may be performed after the step (S30) of selecting N pixels for each area without going through the step (S40) of generating the first histogram H1. have. In this case, without separately generating the primary histogram H1, the lower limit value T L of the binary edge threshold value can be calculated by summing the edgeness of the pixels selected in step S30 and dividing by the number of pixels.

2차 히스토그램(H2)을 생성하는 단계(S60)에서는 S30 단계에서 선택된 픽셀들 중 S50 단계에서 연산된 이진 에지 임계값의 하한값(TL)의 미만 또는 이하의 에지도(edgeness)를 갖는 픽셀들을 제외한 나머지 픽셀들을 대상으로 2차 히스토그램(H2)을 생성한다.In the step S60 of generating the secondary histogram H2, among the pixels selected in step S30, pixels having an edgeness less than or less than the lower limit value T L of the binary edge threshold calculated in step S50 are selected. A second histogram H2 is generated with respect to the remaining pixels.

도 8은 도 1의 S60 단계에서 생성된 2차 히스토그램 및 S70 단계에서 연산된 이진 에지 임계값의 상한값을 표현한 히스토그램이다.FIG. 8 is a histogram expressing the secondary histogram generated in step S60 of FIG. 1 and the upper limit value of the binary edge threshold calculated in step S70 of FIG. 1 .

도 8에 도시된 바와 같이, 2차 히스토그램(H2) 역시 1차 히스토그램(H1)과 유사하게 가로축이 각 픽셀들의 에지도(edgeness)이고, 세로축이 픽셀의 수(Number of pixel)가 되도록 생성된다.As shown in FIG. 8 , the secondary histogram H2 is also generated such that the horizontal axis indicates the edgeness of each pixel and the vertical axis indicates the number of pixels, similar to the primary histogram H1 . .

도 8에 도시된 바와 같이, 2차 히스토그램(H2)에서는 제1 군(A1)에 해당되는 대부분의 픽셀들이 나타나지 않고, 제2 군(A2)과 제3 군(A3)의 픽셀들이 남아있게 된다. 제2 군(A2)에 이진 에지 임계값의 하한값(TL)보다 에지도(edgeness)가 낮은 일부 픽셀들이 포함되는 경우에는 해당 픽셀들은 2차 히스토그램(H2)에 나타나지 않을 수 있다.As shown in FIG. 8 , most pixels corresponding to the first group A1 do not appear in the second histogram H2 , and pixels of the second group A2 and the third group A3 remain. . When some pixels having an edgeness lower than the lower limit value T L of the binary edge threshold value are included in the second group A2 , the pixels may not appear in the secondary histogram H2 .

이진 에지 임계값의 상한값을 연산하는 단계(S70)에서는, S60 단계에서 생성된 2차 히스토그램(H2)을 기초로 이진 에지 임계값의 상한값(TU)을 연산한다.In the step of calculating the upper limit value of the binary edge threshold value ( S70 ), the upper limit value T U of the binary edge threshold value is calculated based on the secondary histogram H2 generated in step S60 .

이진 에지 임계값의 상한값(TU)은 2차 히스토그램(H2)의 평균으로 계산될 수 있다. 즉, 2차 히스토그램(H2)에 표현된 각 픽셀들의 에지도(edgeness)의 평균이 이진 에지 임계값의 상한값(TU)이 될 수 있다. The upper limit value T U of the binary edge threshold value may be calculated as an average of the quadratic histogram H2 . That is, the average of the edgeness of each pixel expressed in the secondary histogram H2 may be the upper limit value T U of the binary edge threshold value.

도 8에 도시된 바와 같이, 이진 에지 임계값의 상한값(TU)은 제3 군(A3) 내에 위치할 수 있다. 이진 에지 임계값의 상한값(TU)은 제2 군(A2)과 제3 군(A3)에 속하는 픽셀들의 개수에 따라 그 위치가 달라질 수 있지만, 일반적으로 제2 군(A2)과 제3 군(A3) 사이의 값 또는 제3 군(A3) 내의 낮은 에지도(edgeness)에 형성된다.As shown in FIG. 8 , the upper limit value T U of the binary edge threshold value may be located in the third group A3 . The upper limit value T U of the binary edge threshold value may have a different position depending on the number of pixels belonging to the second group A2 and the third group A3 , but in general, the second group A2 and the third group Values between (A3) or low edgeness within the third group (A3) are formed.

또는, 이진 에지 임계값의 상한값을 연산하는 단계(S70)는 2차 히스토그램(H2)을 생성하는 단계(S60)를 거치지 않고, 이진 에지 임계값의 하한값을 연산하는 단계(S50) 이후에 수행될 수 있다. 이 경우에는 2차 히스토그램(H2)을 별도로 생성하지 않고, S30 단계에서 선택된 픽셀들 중 이진 에지 임계값의 하한값(TL) 미만 또는 이하의 에지도(edgeness)를 갖는 픽셀들을 제외한 픽셀들의 에지도(edgeness)를 합산하고 해당 픽셀의 수로 나누어 이진 에지 임계값의 상한값(TU)을 연산할 수 있다.Alternatively, the step of calculating the upper limit value of the binary edge threshold value (S70) does not go through the step (S60) of generating the secondary histogram H2, and is to be performed after the step (S50) of calculating the lower limit value of the binary edge threshold value. can In this case, the secondary histogram H2 is not separately generated, and among the pixels selected in step S30, the edge maps of pixels except for pixels having an edgeness less than or less than the lower limit value T L of the binary edge threshold value. (edgeness) can be summed and divided by the number of pixels to calculate the upper limit value (T U ) of the binary edge threshold.

이진 에지 임계값을 선정하는 단계(S80)에서는, 도 8에 도시된 바와 같이, S50 단계에서 연산된 이진 에지 임계값의 하한값(TL)과 S70 단계에서 연산된 이진 에지 임계값의 상한값(TU) 사이에서 이진 에지 임계값(T)이 선정될 수 있다.In the step of selecting the binary edge threshold (S80), as shown in FIG. 8, the lower limit (T L ) of the binary edge threshold calculated in step S50 and the upper limit (T) of the binary edge threshold calculated in step S70 A binary edge threshold T may be chosen between U ).

이진 에지 임계값을 선정하는 단계(S80)에서는, 연산된 이진 에지 임계값의 하한값(TL) 및 이진 에지 임계값의 상한값(TU)을 디스플레이하여 사용자가 그 사이값을 이진 에지 임계값(T)으로 선정할 수 있도록 유도할 수 있다.In the step of selecting the binary edge threshold value (S80), the calculated lower limit value (T L ) of the binary edge threshold value and the upper limit value (T U ) of the binary edge threshold value are displayed, and the user selects a value between them as the binary edge threshold value ( T) can lead to selection.

또는, 소정의 알고리즘에 의해 연산된 이진 에지 임계값의 하한값(TL) 및 이진 에지 임계값의 상한값(TU)을 기초로 이진 에지 임계값(T)이 자동으로 연산될 수도 있다.Alternatively, the binary edge threshold value T may be automatically calculated based on the lower limit value T L of the binary edge threshold value calculated by a predetermined algorithm and the upper limit value T U of the binary edge threshold value.

일례로서, 이진 에지 임계값(T)은 다음과 같은 수식에 의해 연산될 수 있다.As an example, the binary edge threshold value T may be calculated by the following equation.

[수학식 1][Equation 1]

이진 에지 임계값(T)=(1-α)* 이진 에지 임계값의 하한값(TL)+ α* 이진 에지 임계값의 상한값(TU)Binary Edge Threshold (T)=(1-α)* Lower Binary Edge Threshold (T L )+ α* Upper Binary Edge Threshold (T U )

[수학식 2][Equation 2]

이진 에지 임계값(T)= α* 이진 에지 임계값의 하한값(TL)+ (1-α)* 이진 에지 임계값의 상한값(TU)Binary Edge Threshold (T)= α* Lower Binary Edge Threshold (T L )+ (1-α)* Upper Binary Edge Threshold (T U )

수학식 1 및 수학식 2에서 α은 사용자에 의해 미리 입력될 수 있다.In Equations 1 and 2, α may be input in advance by the user.

α값에 따라 이진 에지 임계값(T)은 이진 에지 임계값의 하한값(TL)과 이진 에지 임계값의 상한값(TU)을 포함하는 이진 에지 임계값의 하한값(TL)과 이진 에지 임계값의 상한값(TU)의 사이값으로 연산된다.Depending on the value of α, the binary edge threshold (T) is the lower bound of the binary edge threshold (T L ) and the binary edge threshold including the lower bound (T L ) of the binary edge threshold and the upper limit (T U ) of the binary edge threshold. It is calculated as a value between the upper limit of the value (T U ).

도 8에 도시된 바와 같이, 이진 에지 임계값(T)이 대략 이진 에지 임계값의 하한값(TL)과 이진 에지 임계값의 상한값(TU)의 중간값이 되도록 α값을 0.4 ~ 0.6 또는 0.3 ~ 0.7 범위 내에서 설정하는 경우에는, 제2 군(A2)과 제3 군(A3)을 구별할 수 있는 이진 에지 임계값(T)이 선정된다.As shown in FIG. 8 , the value of α is set to 0.4 to 0.6 or so that the binary edge threshold value T is approximately the middle value between the lower limit value T L of the binary edge threshold value and the upper limit value T U of the binary edge threshold value. When set within the range of 0.3 to 0.7, a binary edge threshold value T capable of distinguishing the second group A2 and the third group A3 is selected.

이진 에지 이미지를 생성하는 단계(S90)에서는 S80에서 선정된 이진 에지 임계값(T)을 기준으로 그레이 스케일 이미지의 각 픽셀들을 흑색 또는 백색으로 이진 처리한다.In the step S90 of generating the binary edge image, each pixel of the gray scale image is binary-processed as black or white based on the binary edge threshold value T selected in S80.

즉, 그레이 스케일 이미지의 각 픽셀들 마다 에지도(edgeness)를 이진 에지 임계값(T)과 비교하여, 에지도(edgeness)가 이진 에지 임계값(T) 보다 큰 경우에는 해당 픽셀의 이진 에지값(binary edge value)으로서 1을 할당하고 에지도(edgeness)가 이진 에지 임계값(T) 보다 작은 경우에는 해당 픽셀의 이진 에지값(binary edge value)으로서 0을 할당함으로서 그레이 스케일 이미지를 이진화할 수 있다. 에지도(edgeness)가 이진 에지 임계값(T)과 같은 픽셀에 대해서는 이진 에지 이미지를 생성하는 알고리즘에 따라 해당 픽셀의 이진 에지값(binary edge value)으로서 0 또는 1이 되도록 할 수 있다.That is, the edgeness of each pixel of the gray scale image is compared with the binary edge threshold value T, and when the edgeness is greater than the binary edge threshold value T, the binary edge value of the corresponding pixel A grayscale image can be binarized by assigning 1 as the (binary edge value) and assigning 0 as the binary edge value of the pixel when the edgeness is less than the binary edge threshold (T). have. For a pixel whose edgeness is equal to the binary edge threshold value T, it may be set to 0 or 1 as a binary edge value of the pixel according to an algorithm for generating a binary edge image.

또는, 반대로 에지도(edgeness)가 이진 에지 임계값(T) 보다 큰 픽셀에 대해서는 이진 에지값(binary edge value)으로서 0을 할당하고, 에지도(edgeness)가 이진 에지 임계값(T) 보다 작은 픽셀에 대해서는 이진 에지값(binary edge value)으로서 1을 할당하여 그레이 스케일 이미지를 이진화할 수도 있다.Alternatively, conversely, 0 is assigned as a binary edge value to a pixel whose edgeness is greater than the binary edge threshold value T, and the edgeness is smaller than the binary edge threshold value T. A gray scale image may be binarized by assigning 1 as a binary edge value to a pixel.

각 픽셀 별로 0 또는 1로 할당된 이진 에지값(binary edge value)은 이진 에지 이미지에서 흑색과 백색으로 표현된다.A binary edge value assigned as 0 or 1 for each pixel is expressed in black and white in the binary edge image.

도 9는 도 1의 S90 단계에서 최종 생성된 이진 에지 이미지를 도시한 것이다.FIG. 9 illustrates a binary edge image finally generated in step S90 of FIG. 1 .

도 9에 도시된 바와 같이, 최종 생성된 이진 에지 이미지(I3)에서 에지도(edgeness)가 이진 에지 임계값(T) 보다 큰 픽셀들은 백색으로 표현되고, 에지도(edgeness)가 이진 에지 임계값(T) 보다 작은 픽셀들은 흑색으로 표현될 수 있다.As shown in FIG. 9 , in the finally generated binary edge image I3 , pixels having an edgeness greater than the binary edge threshold value T are expressed in white, and the edgeness is displayed as a binary edge threshold value. Pixels smaller than (T) may be expressed in black.

또는 반대로, 에지도(edgeness)가 이진 에지 임계값(T) 보다 큰 픽셀들은 흑색으로 표현되고, 에지도(edgeness)가 이진 에지 임계값(T) 보다 작은 픽셀들은 백색으로 표현될 수도 있다.Or, conversely, pixels having an edgeness greater than the binary edge threshold value T may be expressed in black, and pixels having an edgeness smaller than the binary edge threshold value T may be expressed in white.

도 3, 도 4, 도 8 및 도 9를 비교할 때, 도 9에 백색으로 표현된 부분은 도 3에서 가장 밝은 색으로 표현된 부품 에지이며, 대부분 도 8에서 제3 군(A3)에 포함된 픽셀들이며, 대부분 도 4에서는 부품 영역 내 유효 에지(Valid edge in part region)에 포함된 픽셀들에 해당된다.When comparing FIGS. 3, 4, 8 and 9, the part expressed in white in FIG. 9 is the part edge expressed in the lightest color in FIG. 3, and most of it is included in the third group (A3) in FIG. These are pixels, and most of them correspond to pixels included in a valid edge in a part region in FIG. 4 .

전술한 본 실시예에 본 발명의 일 실시예에 따른 이진 에지 이미지 획득 방법의 각 단계별 프로세스는 컴퓨터가 읽을 수 있는 소스 코드로 부호화되어 구현될 수 있으며, 각 단계별 프로세스를 순차적으로 실행하기 위한 프로그램으로서 컴퓨터로 읽을 수 있는 기록매체에 저장되는 형태로 구현될 수 있음은 물론이다. 컴퓨터 기록 매체는 컴퓨터 시스템에 의해 읽혀질 수 있도록 프로그램 및 데이터가 저장되는 모든 종류의 기록 매체가 포함되며, 그 예로는 ROM, RAM, CD, DVD-ROM, 자기테이프, 플로피디스크, 광데이터 저장장치, 플래시메모리 등이 있으며, 또한 인터넷을 통한 전송의 형태로 구현되는 것도 여기에 포함된다. 즉 이러한 기록 매체는 정보통신망으로 연결된 컴퓨터 시스템에 분산되어, 분산 방식으로 컴퓨터가 읽을 수 있는 코드가 저장되고 실행될 수 있다.Each step-by-step process of the method for obtaining a binary edge image according to an embodiment of the present invention in the above-described embodiment can be implemented by encoding a computer-readable source code, and as a program for sequentially executing each step-by-step process Of course, it can be implemented in the form of being stored in a computer-readable   recording medium. Computer recording media includes all kinds of recording media in which programs and data are stored so that they can be read by a computer system, for example, ROM, RAM, CD, DVD-ROM, magnetic tape, floppy disk, optical data storage device, There is a flash memory, etc., and also includes one implemented in the form of transmission through the Internet. That is, these recording media are distributed in computer systems connected through an information and communication network, and computer-readable codes can be stored and executed in a distributed manner.

본 발명이 속하는 기술분야의 통상의 지식을 가진 자는 본 발명이 그 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 실시될 수 있다는 것을 이해할 수 있을 것이다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적이 아닌 것으로 이해해야만 한다. 본 발명의 범위는 상기 상세한 설명보다는 후술하는 특허청구범위에 의하여 나타내어지며, 특허청구범위의 의미 및 범위 그리고 그 균등 개념으로부터 도출되는 모든 변경 또는 변형된 형태가 본 발명의 범위에 포함되는 것으로 해석되어야 한다.Those of ordinary skill in the art to which the present invention pertains will understand that the present invention may be embodied in other specific forms without changing the technical spirit or essential features thereof. Therefore, it should be understood that the embodiments described above are illustrative in all respects and not restrictive. The scope of the present invention is indicated by the following claims rather than the above detailed description, and all changes or modifications derived from the meaning and scope of the claims and their equivalent concepts should be interpreted as being included in the scope of the present invention. do.

H1: 1차 히스토그램
H2: 2차 히스토그램
I2: 소벨 연산 처리된 그레이 스케일 이미지
I3: 최종 생성된 이진 에지 이미지
T: 이진 에지 임계값
TL: 이진 에지 임계값의 하한값
TU: 이진 에지 임계값의 상한값
H1: 1st order histogram
H2: quadratic histogram
I2: grayscale image processed by Sobel operation
I3: Final generated binary edge image
T: Binary Edge Threshold
T L : lower bound of binary edge threshold
T U : upper bound of binary edge threshold

Claims (6)

그레이 스케일 이미지를 생성하는 단계;
상기 그레이 스케일 이미지 내의 복수의 영역에서 각 영역 별로 에지도(edgeness)가 높은 순서로 N개의 픽셀을 선정하는 단계;
상기 선정된 복수의 픽셀들의 에지도의 평균을 기초로 하한값을 연산하는 단계;
상기 선정된 복수의 픽셀들 중 에지도가 상기 하한값 이하 또는 미만인 픽셀을 제외한 나머지 픽셀들의 에지도의 평균을 기초로 상한값을 연산하는 단계;
상기 상한값과 상기 하한값 사이에서 이진 에지 임계값을 선정하는 단계; 및
상기 선정된 이진 에지 임계값을 기준으로 상기 그레이 스케일 이미지를 이진 처리하는 단계를 포함하는 이진 에지 이미지 획득 방법.
generating a grayscale image;
selecting N pixels from a plurality of regions in the gray scale image in an order of increasing edgeness for each region;
calculating a lower limit value based on an average of edge maps of the plurality of selected pixels;
calculating an upper limit value based on an average of edge maps of the remaining pixels except for a pixel having an edge map less than or equal to the lower limit among the selected plurality of pixels;
selecting a binary edge threshold between the upper limit value and the lower limit value; and
and binary-processing the gray scale image based on the selected binary edge threshold.
제1항에 있어서,
상기 그레이 스케일 이미지를 생성하는 단계에서,
상기 그레이 스케일 이미지는 소벨 연산에 의해 생성되는, 이진 에지 이미지 획득 방법.
According to claim 1,
In the step of generating the gray scale image,
wherein the gray scale image is generated by a Sobel operation.
제1항에 있어서,
상기 복수의 영역은 상기 그레이 스케일 이미지를 등분하도록 설정되는, 이진 에지 이미지 획득 방법.
According to claim 1,
wherein the plurality of regions are set to divide the gray scale image into equal parts.
제1항에 있어서,
상기 복수의 영역은 상기 그레이 스케일 이미지의 각 픽셀 열 또는 각 픽셀행인, 이진 에지 이미지 획득 방법.
According to claim 1,
wherein the plurality of regions is each pixel column or each pixel row of the gray scale image.
제1항에 있어서,
상기 그레이 스케일 이미지를 이진 처리하는 단계에서,
상기 그레이 스케일 이미지 내의 픽셀들 중, 상기 선정된 이진 에지 임계값보다 큰 에지도를 갖는 픽셀들은 에지값을 1로 설정하고, 상기 선정된 이진 에지 임계값보다 작은 에지도를 갖는 픽셀들은 에지값을 0으로 설정하는, 이진 에지 이미지 획득 방법.
According to claim 1,
In the step of binary processing the gray scale image,
Among the pixels in the gray scale image, pixels having an edge degree greater than the predetermined binary edge threshold have an edge value set to 1, and pixels having an edge degree smaller than the predetermined binary edge threshold have an edge value. Binary edge image acquisition method, set to zero.
제1항 내지 제5항 중 어느 한 항에 따른 이진 에지 이미지 획득 방법을 실행하기 위한 프로그램이 기록된 컴퓨터로 읽을 수 있는 기록 매체.A computer-readable recording medium in which a program for executing the binary edge image acquisition method according to any one of claims 1 to 5 is recorded.
KR1020150038982A 2015-03-20 2015-03-20 Method for acquiring binary edge image and computer readable recording medium having computer program recorded therefor KR102340303B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020150038982A KR102340303B1 (en) 2015-03-20 2015-03-20 Method for acquiring binary edge image and computer readable recording medium having computer program recorded therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020150038982A KR102340303B1 (en) 2015-03-20 2015-03-20 Method for acquiring binary edge image and computer readable recording medium having computer program recorded therefor

Publications (2)

Publication Number Publication Date
KR20160112738A KR20160112738A (en) 2016-09-28
KR102340303B1 true KR102340303B1 (en) 2021-12-15

Family

ID=57102003

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020150038982A KR102340303B1 (en) 2015-03-20 2015-03-20 Method for acquiring binary edge image and computer readable recording medium having computer program recorded therefor

Country Status (1)

Country Link
KR (1) KR102340303B1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005165925A (en) 2003-12-05 2005-06-23 Matsushita Electric Ind Co Ltd Method and system for binarization process
JP2013042415A (en) 2011-08-18 2013-02-28 Pfu Ltd Image processing apparatus, image processing method, and computer program

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5506917A (en) * 1990-07-13 1996-04-09 Nippon Telegraph And Telephone Corporation Thresholding method for segmenting gray scale image, method for determining background concentration distribution, and image displacement detection method
KR100974900B1 (en) * 2008-11-04 2010-08-09 한국전자통신연구원 Marker recognition apparatus using dynamic threshold and method thereof
KR101929560B1 (en) * 2013-01-29 2019-03-14 삼성전자주식회사 Method and apparatus for detecting edge in image

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005165925A (en) 2003-12-05 2005-06-23 Matsushita Electric Ind Co Ltd Method and system for binarization process
JP2013042415A (en) 2011-08-18 2013-02-28 Pfu Ltd Image processing apparatus, image processing method, and computer program

Also Published As

Publication number Publication date
KR20160112738A (en) 2016-09-28

Similar Documents

Publication Publication Date Title
CN110189349B (en) Image processing method and device
US6803920B2 (en) Method and apparatus for digital image segmentation using an iterative method
US9092892B2 (en) Image processing device determining binarizing threshold value
JP6052902B2 (en) Methods for processing highlight and saturation areas in digital images
US20130028520A1 (en) Image processing device identifying attribute of region included in image
CN109472271B (en) Printed circuit board image contour extraction method and device
CN107590447A (en) A kind of caption recognition methods and device
CN112686858A (en) Visual defect detection method, device, medium and equipment for mobile phone charger
JP2016505186A (en) Image processor with edge preservation and noise suppression functions
US9406140B2 (en) Method and apparatus for generating depth information
KR101549495B1 (en) An apparatus for extracting characters and the method thereof
US20130315489A1 (en) Pattern processing device, pattern processing method, and pattern processing program
CN105869122A (en) Image processing method and apparatus
CN103942756B (en) A kind of method of depth map post processing and filtering
CN111598076B (en) Method and device for detecting and processing date in label image
EP2833637A1 (en) Method for processing a current image of an image sequence, and corresponding computer program and processing device
US9235773B2 (en) Image processing device capable of determining types of images accurately
CN117152165B (en) Photosensitive chip defect detection method and device, storage medium and electronic equipment
RU2608239C1 (en) Method and system for determining suitability of document image for optical character recognition and other image processing operations
JP2004030188A (en) Method, apparatus and program for dividing image into areas
KR102340303B1 (en) Method for acquiring binary edge image and computer readable recording medium having computer program recorded therefor
CN109175718B (en) Picture laser engraving method based on halftone technology
US20170274285A1 (en) Method and apparatus for automating the creation of a puzzle pix playable on a computational device from a photograph or drawing
CN112040208B (en) Image processing method, image processing device, readable storage medium and computer equipment
CN110062151B (en) Smooth image generation device, abnormality determination device, and smooth image generation method

Legal Events

Date Code Title Description
N231 Notification of change of applicant
E701 Decision to grant or registration of patent right
GRNT Written decision to grant