KR100555883B1 - An Effective Bar Code Detection Method using Mathematical Algorithm - Google Patents

An Effective Bar Code Detection Method using Mathematical Algorithm Download PDF

Info

Publication number
KR100555883B1
KR100555883B1 KR1020040004627A KR20040004627A KR100555883B1 KR 100555883 B1 KR100555883 B1 KR 100555883B1 KR 1020040004627 A KR1020040004627 A KR 1020040004627A KR 20040004627 A KR20040004627 A KR 20040004627A KR 100555883 B1 KR100555883 B1 KR 100555883B1
Authority
KR
South Korea
Prior art keywords
barcode
block
image
value
pixels
Prior art date
Application number
KR1020040004627A
Other languages
Korean (ko)
Other versions
KR20040014626A (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 KR1020040004627A priority Critical patent/KR100555883B1/en
Publication of KR20040014626A publication Critical patent/KR20040014626A/en
Application granted granted Critical
Publication of KR100555883B1 publication Critical patent/KR100555883B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • General Health & Medical Sciences (AREA)
  • Toxicology (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

본 발명은 수학적 알고리즘을 이용하여 바코드의 기하학적 특징을 구하고 레이블링을 행하여 바코드의 영상 이미지를 효율적으로 추출하는 방법에 관한 것이다. 보다 구체적으로 본 발명은 a) 네 개의 라인 연산자 (line operator)를 이용하여 바코드의 이미지 화소가 가지는 방향을 구하는 단계와, b) 각 블록 별로 각 방향에 대한 화소의 누적 히스토그램 (histogram)을 구하는 단계와, c) 상기 누적 히스토그램에서 최대 값과 최소 값의 차이가 가장 큰 블록으로 바코드 영역의 블록을 결정하는 단계와, d) 상기 누적 히스토그램에서 최대 값과 최소 값의 차이가 가장 큰 것을 이용하여 문턱 값을 구하는 단계와, e) 상기 블록별로 히스토그램의 최대값과 최소값의 차이가 문턱값보다 큰 블록을 바코드의 기하학적 특징을 갖는 블록으로 분류하는 단계와, f) 기하학적 특징을 갖는 블록으로 확정된 바코드의 영상을 이진화하는 단계와, g) 상기 이진화된 바코드의 영상을 레이블링하여 바코드의 후보 블록을 결정하는 단계와, h) 상기 후보 블록들의 화소를 이용하여 바코드의 기울기와 중심점을 구하여 바코드와 수직이고 바코드의 중심을 지나가는 직선을 그어 바코드를 검출하는 단계로 이루어지는 바코드의 영상 이미지를 신속하고 정확하게 추출하는 방법을 제공하는데 그 특징이 있다.The present invention relates to a method of efficiently extracting image images of a barcode by obtaining and labeling geometric features of the barcode using a mathematical algorithm. More specifically, the present invention provides a method for determining a direction of an image pixel of a barcode using four line operators, and b) obtaining a cumulative histogram of pixels of each direction for each block. And c) determining a block of the barcode region as a block having the largest difference between the maximum value and the minimum value in the cumulative histogram, and d) a threshold using the largest difference between the maximum value and the minimum value in the cumulative histogram. Obtaining a value, e) classifying a block whose difference between the maximum value and the minimum value of the histogram for each block is larger than a threshold value as a block having a geometrical feature of a barcode, and f) a barcode determined as a block having a geometrical feature Binarizing the image of the barcode; and g) labeling the image of the binary barcode to determine a candidate block of the barcode; and h) A method for quickly and accurately extracting a video image of a barcode consisting of detecting a barcode by obtaining a slope and a center point of the barcode using pixels of the candidate blocks and drawing a straight line perpendicular to the barcode and passing through the center of the barcode. There is this.

바코드, 라인 연산자, 이진화, 레이블링, 기하학적 특징Barcode, Line Operator, Binarization, Labeling

Description

수학적 알고리즘을 이용한 효과적인 바코드 영상의 검출 방법{An Effective Bar Code Detection Method using Mathematical Algorithm}An Effective Bar Code Detection Method Using Mathematical Algorithm

도 1. 본 발명에 따른 (a) 바코드 영역의 블록과 (b) 바코드 영역 밖의 블록의 0°, 45°, 90°, 및 135° 방향에 따른 화소의 누적 히스토그램1. Cumulative histogram of pixels along the 0 °, 45 °, 90 °, and 135 ° directions of (a) a block in the barcode region and (b) a block outside the barcode region according to the present invention.

도 2. 본 발명에 따른 (a) 0°방향, (b) 45°방향, (c) 90°방향, 및 (d)135°방향의 라인 연산자2. Line operators in (a) 0 ° direction, (b) 45 ° direction, (c) 90 ° direction, and (d) 135 ° direction according to the present invention.

도 3. 본 발명에 따른 (a) 실험 영상과 이 영상에 대해 (b) 0°, (c) 45°, 그리고 (d) 90°방향의 라인 연산자를 적용한 결과 영상Fig. 3. (a) Experimental image according to the present invention and the resulting image by applying the line operator in (b) 0 °, (c) 45 °, and (d) 90 ° to this image

도 4. 본 발명에 따른 최대 히스토그램 값과 최소 히스토그램 값의 차가 최대인 바코드 영역의 블록4. A block of a barcode area having a maximum difference between a maximum histogram value and a minimum histogram value according to the present invention.

도 5. 본 발명에 따른 (a) 문턱값을 이용하여 구한 이진화 영상과 (b) 바코드 영역의 후보블록들5. (a) Binarized image obtained by using a threshold value and (b) Candidate blocks of a barcode region according to the present invention

도 6. 본 발명에 따른 (a) 바코드를 포함하는 블록과 (b) 바코드 영역의 후보블록들을 이용하여 구한 바코드 위를 지나가는 직선6. A straight line passing through a bar code obtained using (a) a block including a bar code and (b) candidate blocks in the bar code area according to the present invention.

도 7. 본 발명에 따라 제안된 알고리즘에 의해 검출된 바코드Fig. 7. Barcode detected by the proposed algorithm according to the present invention

도 8. 본 발명에 따른 (a) 실험 영상 1과 제안한 방법에 의한 (b) 바코드 위를 지나가는 직선 및 (c) 검출된 바코드8. (a) Experimental image 1 according to the present invention and (b) a straight line passing over the barcode by the proposed method and (c) the detected barcode

도 9. 본 발명에 따른 (a) 실험 영상 2와 제안한 방법에 의한 (b) 바코드 위를 지나가는 직선 및 (c) 검출된 바코드9. (a) Experimental image 2 according to the present invention and (b) the straight line passing over the barcode by the proposed method and (c) the detected barcode

본 발명은 수학적 알고리즘을 이용하여 바코드의 기하학적 특징을 구하고 레이블링을 행하여 바코드의 영상 이미지를 효율적으로 추출하는 방법에 관한 것이다. The present invention relates to a method of efficiently extracting image images of a barcode by obtaining and labeling geometric features of the barcode using a mathematical algorithm.

종래 기술로는 일정한 크기의 직선이 일정 영역 내부에 나열되어 있는 기하학적 특성을 가지고 있는 정보 저장매체로서의 바코드를 찾기 위한 방법으로는 화소가 가지는 기울기의 크기를 이용하는 방법, 신경망(neural networks)을 이용하는 방법 및 HT(hough transform)을 이용하는 방법 등이 있으나, 상기 화소가 가지는 기울기의 크기를 이용하는 방법은 바코드 영역의 화소라고 판단하는 기울기의 크기에 대한 문턱 값을 정하기 어렵고, 기울기의 크기가 문턱 값보다 큰 화소 중에서 바코드 영역의 화소만을 검출하기 위해 신경망이나 클러스터화(clustering)를 이용하므로 복잡하고 알고리즘 수행시간이 길다는 문제점이 있고, 바코드 영상을 학습시킨 후 학습된 신경망을 이용하여 바코드가 포함된 영상에서 바코드를 검출하는 방법은 학습을 하는 과정이 필요하므로 실시간 구현에 어려움이 있고, HT을 이용하여 바코드를 검출하는 방법은 HT을 하는 과정 때문에 실시간 구현에 어려움이 있으 며, 또한 HT에서 찾은 에지 성분들 중에서 바코드에 의해 나타나는 에지와 다른 에지 사이의 구별이 힘들다는 문제점이 있었다.In the prior art, a method of finding a barcode as an information storage medium having a geometric characteristic in which a straight line of a certain size is arranged in a certain area is used as a method of using a magnitude of a slope of a pixel or a method of using neural networks. And a method of using a HT (hough transform), but the method of using the magnitude of the gradient of the pixel is difficult to determine the threshold value of the magnitude of the gradient determined as the pixel of the barcode region, and the magnitude of the gradient is larger than the threshold value. The neural network or clustering is used to detect only the pixels in the barcode region among the pixels, which is complicated and takes a long time to perform the algorithm. Detecting barcodes requires a learning process. Therefore, it is difficult to implement in real time, and the method of detecting a barcode using HT is difficult in real time due to the process of performing HT, and also distinguishes between an edge represented by a barcode and another edge among the edge components found in HT. There was a problem with this difficulty.

본 발명이 이루고자 하는 기술적 과제는 상기와 같은 종래 기술의 문제점을 인식하고 안출된 것으로 바코드의 이미지 영상을 보다 신속하고 정확하게 추출하기 위하여 네 개의 라인 연산자 (line operator)를 이용하여 바코드의 이미지 화소가 가지는 방향을 구하고 각 블록 별로 각 방향에 대한 화소의 누적 히스토그램 (histogram)을 구하여 상기 누적 히스토그램에서 최대 값과 최소 값의 차이가 가장 큰 블록을 바코드 영역의 블록을 결정하고 상기 가장 큰 차이 값을 이용하여 문턱값을 구하여 상기 블록별로 히스토그램의 최대 값과 최소 값의 차이가 문턱 값보다 큰 블록을 바코드의 기하학적 특징을 갖는 블록의 대상으로 확정/분류하고 불록의 대상으로 확정된 바코드의 영상을 이진화하여 상기 이진화된 바코드의 영상을 레이블링 하여 바코드의 후보 블록을 결정하고 상기 후보 블록들의 화소를 이용하여 바코드의 기울기와 중심점을 구하여 바코드와 수직이고 바코드의 중심을 지나가는 직선을 그어 바코드를 검출하여 바코드의 영상 이미지를 효율적으로 추출하는 방법을 제공하는데 있다.The technical problem to be achieved by the present invention is to recognize the problems of the prior art as described above, and to extract the image image of the barcode more quickly and accurately by using four line operators (line operator) has the image pixels of the barcode Obtain a direction and obtain a cumulative histogram of the pixels for each block for each block, and determine the block of the bar code area that has the largest difference between the maximum value and the minimum value in the cumulative histogram and use the largest difference value. By determining a threshold value, the block whose difference between the maximum value and the minimum value of the histogram is larger than the threshold value for each block is determined / classified as the object of the block having the geometrical feature of the barcode, and the image of the barcode determined as the object of the block is binarized. Candidates for Barcodes by Labeling Images of Binary Barcodes It is to determine the lock and provide a method of the using the pixels of the candidate block, obtain the slope and center point of the bar code the bar code and the vertical and drawing a straight line passing through the center of the bar code by detecting the bar code efficiently extract a video image of a bar code.

본 발명은 수학적 알고리즘을 이용하여 바코드의 기하학적 특징을 구하고 레이블링을 행하여 바코드의 영상 이미지를 효율적으로 추출하는 방법에 관한 것이다. 먼저 본 발명에 따른 바코드의 이미지 영상을 신속하고 정확하게 읽어내는 알고리즘에 대하여 구체적으로 살펴보면, 레이저 빔으로 바코드를 읽은 영상에서 네 개의 방향을 고려한 라인 연산자를 이용하여 이미지 화소가 가지는 방향에 대한 히스토그램을 구한다. 블록 별로 각 방향에 대하여 최대 히스토그램 값과 최소 히스토그램 값의 차를 구하여 차이가 가장 큰 블록을 바코드 영역의 블록이라고 결정하고 그 때의 차이를 이용하여 문턱 값을 구한다. 문턱 값을 이용하여 블록 단위로 영상을 이진화 한 후 레이블링을 행하여 연결 성분이 가장 많은 블록들을 바코드 영역의 후보 블록으로 결정한다. 후보 블록들의 모든 화소를 이용하여 바코드의 기울기와 중심점을 구한 후 바코드와 수직이고 바코드의 중심을 지나가는 점들을 연결하여 직선을 긋고 바코드를 검출한다. 수직선이 지나갈 때 화소 값을 순차적으로 획득함으로써 바코드가 가지고 있는 정보를 파악한다. 화소의 방향성과 바코드 영역의 블록 결정에 대하여 보다 구체적으로 살펴보면, 바코드는 바 (bar)와 공백 (space)을 특정한 형태로 조합을 이루고 문자, 숫자 및 기호 등을 광학적으로 판독하기 쉽게 부호화한 것으로 바코드의 시작과 끝을 명확하게 구분하기 위해서 첫 번째 문자의 앞과 마지막 문자의 뒤에는 공백 부분이 있다. 이러한 바코드가 포함된 영상에서 바코드가 있는 영역은 바코드의 바와 공백의 조합으로 인한 일정한 크기의 직선이 일정 영역 내부에 나열되어 있는 기하학적 특성을 가지기 때문에 바코드의 영상은 다른 어느 부분보다 에지 성분이 많고 에지성분은 방향이 일정하며 에지에서의 영상은 다른 부분보다 동일한 방향을 가지는 화소들이 집중되어 있다. 따라서 블록 단위로 화소의 방향이 가장 일정한 블록들을 찾음으로써 바코드 영역을 찾을 수 있다. 각 화소가 가지는 방향을 결정하기 위해 네 개의 방향(0°, 45°, 90 ° 및 135°)을 고려하는 4개의 라인 연산자를 이용하여 방향의 크기를 계산한 후, 가장 큰 값을 가지는 방향을 그 화소의 방향이라고 결정한다. 따라서 임의의 화소에서 화소가 가지는 방향 θ(x, y) 은The present invention relates to a method of efficiently extracting image images of a barcode by obtaining and labeling geometric features of the barcode using a mathematical algorithm. First, the algorithm for quickly and accurately reading an image of a barcode according to the present invention will be described in detail. The histogram of the direction of an image pixel is obtained by using a line operator considering four directions in an image of a barcode read with a laser beam. . The difference between the maximum histogram value and the minimum histogram value for each direction is determined for each block, and the block having the largest difference is determined as the block of the barcode region, and the threshold value is obtained using the difference. After binarizing the image using a threshold value, labeling is performed to determine blocks having the largest number of connected components as candidate blocks of the barcode region. After obtaining the slope and the center point of the barcode using all the pixels of the candidate blocks, a straight line is detected by connecting points perpendicular to the barcode and passing through the center of the barcode. When the vertical line passes by, pixel values are sequentially obtained to grasp the information of the barcode. In more detail, the directionality of the pixels and the block determination of the barcode region are described in detail. The barcode is formed by combining a bar and a space in a specific form and codes the letters, numbers, and symbols optically for easy reading. In order to clearly distinguish the beginning and end of, there is a space before and after the first character. The image of the barcode has more edge components and edges than any other part because the region with the barcode in the image containing the barcode has a geometric characteristic in which a straight line of uniform size due to the combination of the bar and the space of the barcode is arranged inside the region. The component has a constant direction, and the image at the edge is concentrated with pixels having the same direction as other parts. Accordingly, the barcode region can be found by finding blocks having the most uniform pixel direction in blocks. To determine the direction of each pixel, calculate the size of the direction using four line operators that consider four directions (0 °, 45 °, 90 °, and 135 °), and then select the direction with the largest value. Determine the direction of the pixel. Therefore, in any pixel, the direction θ (x, y) that the pixel has

Figure 112004002756626-pat00001
(1)
Figure 112004002756626-pat00001
(One)

로 결정된다. 여기에서

Figure 112004002756626-pat00002
는 라인 연산자,
Figure 112004002756626-pat00003
는 고려된 네 개의 방향을 나타내며
Figure 112004002756626-pat00004
에 대해 각각
Figure 112004002756626-pat00005
을 나타낸다. Is determined. From here
Figure 112004002756626-pat00002
Is a line operator,
Figure 112004002756626-pat00003
Represents the four directions considered
Figure 112004002756626-pat00004
For each
Figure 112004002756626-pat00005
Indicates.

화소가 가지는 방향 구한 후 영상에서 바코드 영역을 블록 단위로 찾는다. 도 1은 화소가 가지는 방향을 구한 후 특정 블록의 각 방향에 대한 화소의 누적 히스토그램을 나타낸 것이다. 도 1에서 볼 수 있는 것처럼 블록 단위로 영상을 나누었을 때 배경이나 문자를 포함하는 블록, 즉 바코드 영역 밖의 블록은 다양한 방향을 가지는 화소들로 구성이 되어 있으므로 각 방향에 대한 화소 수의 누적 히스토그램 값이 비슷하다. 그러나 바코드를 포함하는 블록은 같은 방향의 에지를 많이 포함하므로 각 방향에 대한 화소의 수를 누적한 히스토그램에서 바코드의 직선 방향에 따라 특정 방향의 히스토그램 값이 다른 방향의 히스토그램 값보다 상대적으로 크다. 따라서 바코드 영역의 블록은 각 방향에 대한 최대 히스토그램 값과 최소 히스토그램 값과의 차이가 크므로 네 개의 방향에 대하여 화소의 개수를 누적한 히스토그램을 구한 후 각 방향에 대한 최대 히스토그램 값과 최소 히스토그램 값과의 차이를 구한다. 각 방향에 대한 최대 히스토그램 값과 최소 히스토그램 값과의 차 이는After finding the direction of the pixel, the barcode area is searched in blocks. FIG. 1 illustrates a cumulative histogram of pixels in each direction of a specific block after obtaining directions of the pixels. As shown in FIG. 1, when the image is divided into blocks, a block including a background or a character, that is, a block outside the barcode area is composed of pixels having various directions, and thus the cumulative histogram value of the number of pixels in each direction. This is similar. However, since the block including the barcode includes many edges in the same direction, the histogram value in a specific direction is relatively larger than the histogram value in another direction according to the straight line direction of the barcode in the histogram in which the number of pixels in each direction is accumulated. Therefore, the block of the bar code area has a large difference between the maximum and minimum histogram values for each direction. Therefore, after obtaining a histogram obtained by accumulating the number of pixels in four directions, the maximum and minimum histogram values for each direction are determined. Find the difference. The difference between the maximum and minimum histogram values for each direction

Figure 112004002756626-pat00006
Figure 112004002756626-pat00006

와 같다. 여기에서

Figure 112004002756626-pat00007
Figure 112004002756626-pat00008
는 수행되고 있는 블록
Figure 112004002756626-pat00009
에서 방향
Figure 112004002756626-pat00010
Figure 112004002756626-pat00011
를 가지는 화소의 누적 히스토그램 값을 나타낸다. 그리고
Figure 112004002756626-pat00012
에 대해
Figure 112004002756626-pat00013
Figure 112004002756626-pat00014
이며
Figure 112004002756626-pat00015
Figure 112004002756626-pat00016
는 동일하지 않다. 이렇게 구해진 값이 가장 큰 블록은 같은 방향의 화소를 가장 많이 포함하고 있으므로 동일한 방향의 직선을 가지는 동일한 방향의 에지들로 구성된 바코드의 기하학적인 특징을 가장 잘 나타내는 바코드 영역의 블록이다. 레이블링에 의한 바코드 영역 검출에 대하여 구체적으로 살펴보면, 바코드의 정보 해석을 위해서는 바코드의 중심을 지나가는 직선이 필요하다. 각 블록에 대해 네 개의 방향에 대한 화소의 개수를 누적한 히스토그램에서 각 방향에 대한 최대 히스토그램 값과 최소 히스토그램 값과의 차이가 가장 큰 블록을 이용하여 바코드의 기울기와 중심좌표를 구할 수 있으나, 바코드의 정확한 기울기와 중심점을 찾기 위해서는 바코드 영역의 더 많은 후보 블록들이 필요하다. 따라서 바코드 영역의 블록들을 찾기 위해 최대 히스토그램 값과 최소 히스토그램 값의 차 중에서 가장 큰 값을 이용하여 문턱 값을 결정한다. 이때 문턱 값은 Same as From here
Figure 112004002756626-pat00007
Wow
Figure 112004002756626-pat00008
Is the block being executed
Figure 112004002756626-pat00009
Direction
Figure 112004002756626-pat00010
Wow
Figure 112004002756626-pat00011
A cumulative histogram value of a pixel having And
Figure 112004002756626-pat00012
About
Figure 112004002756626-pat00013
And
Figure 112004002756626-pat00014
And
Figure 112004002756626-pat00015
Wow
Figure 112004002756626-pat00016
Is not the same. The block having the largest value is the block of the barcode area that best represents the geometrical characteristics of the barcode composed of the edges of the same direction having straight lines of the same direction since the block contains the largest number of pixels in the same direction. Looking at the bar code area detection by labeling in detail, a straight line passing through the center of the bar code is required to interpret the bar code information. In the histogram that accumulates the number of pixels in four directions for each block, the slope and the center coordinate of the barcode can be obtained by using the block having the largest difference between the maximum and minimum histogram values for each direction. More candidate blocks of the barcode area are needed to find the exact slope and center point of. Therefore, the threshold value is determined using the largest value among the difference between the maximum histogram value and the minimum histogram value to find the blocks of the barcode region. The threshold is

Figure 112004002756626-pat00017
Figure 112004002756626-pat00017

이며, 여기에서

Figure 112004002756626-pat00018
는 임의의 상수이다. 문턱 값을 이용하여 각 블록의 각 방향에 대한 최대 히스토그램 값과 최소 히스토그램 값의 차가 문턱 값보다 큰 블록 을 바코드의 기하학적 특징을 갖는 바코드를 포함하는 블록으로 확정/분류하고 확정된 블록을 대상으로 바코드 이미지영상을 이진화 한다. 바코드의 기하학적 특징을 갖는 블록들은 바코드 영역 밖에도 존재하지만 주로 바코드 영역의 다른 블록들과 인접하여 많이 분포한다. 그러므로 바코드 영역의 후보 블록들을 추출하기 위하여 이진화 한 이미지영상에 대하여 레이블링을 행하여 연결 성분이 가장 많은 블록들을 바코드 영역의 후보 블록으로 결정한다. 그리고 바코드를 포함하는 바코드 영역의 블록으로 결정된 블록들이 최대 히스토그램 값과 최소 히스토그램 값의 차이가 가장 큰 블록을 포함하고 있는지를 확인함으로써 검출된 후보 블록들이 바코드 영역의 블록들임을 확인한다. 바코드 기울기와 중심점 계산 및 바코드 검출에 대하여 구체적으로 살펴보면, 바코드 영역의 후보 블록들을 이용함으로써 각 방향에 대한 최대 히스토그램 값과 최소 히스토그램 값의 차이가 가장 큰 블록 하나만을 이용할 때보다 바코드의 기울기와 중심점을 좀더 정확하게 구할 수 있다. 바코드 영역의 후보 블록들의 모든 화소에 대해 수평방향으로의 변화량과 수직방향으로의 변화량을 구하여 바코드의 기울기를 구하고 후보 블록들의 중심점들의 평균을 구하여 바코드의 중심점을 구한다. 이때 바코드의 중심점을 지나는 직선의 기울기는 바코드를 구성하는 직선의 기울기와 수직이므로 직선의 기울기 는 식 (4), 식 (5), 및 식 (6)을 이용하여 구한다., Where
Figure 112004002756626-pat00018
Is any constant. By using the threshold value, the block whose difference between the maximum histogram value and the minimum histogram value in each direction of each block is larger than the threshold value is determined / classified as a block including the barcode having the geometrical characteristics of the barcode, and the barcode is determined based on the determined block. Binarize the image. Blocks having the geometrical characteristics of a barcode exist outside the barcode region but are mainly distributed adjacent to other blocks of the barcode region. Therefore, labeling is performed on the binarized image image to extract candidate blocks of the barcode region, and the blocks having the most connection components are determined as candidate blocks of the barcode region. In addition, it is confirmed that the detected candidate blocks are blocks of the barcode region by checking whether the blocks determined as the blocks of the barcode region including the barcode include the blocks having the largest difference between the maximum histogram value and the minimum histogram value. Looking at the barcode slope and center point calculation and barcode detection in detail, the candidate blocks of the barcode area are used to determine the slope and the center point of the barcode compared to using only one block having the largest difference between the maximum and minimum histogram values in each direction. You can get it more accurately. The slope of the barcode is obtained by calculating the change in the horizontal direction and the change in the vertical direction for all the pixels of the candidate blocks in the barcode area, and the center point of the barcode is obtained by calculating the average of the center points of the candidate blocks. At this time, since the slope of the straight line passing through the center point of the barcode is perpendicular to the slope of the straight line constituting the barcode, the slope of the straight line is obtained using equations (4), (5), and (6).

Figure 112004002756626-pat00019
Figure 112004002756626-pat00019

Figure 112004002756626-pat00020
Figure 112004002756626-pat00020

Figure 112004002756626-pat00021
Figure 112004002756626-pat00021

여기에서

Figure 112004002756626-pat00022
는 추출된 바코드 영역의 후보블록들을,
Figure 112004002756626-pat00023
는 수평과 수직 방향에 대한 필터를 각각 나타낸다. 이렇게 구한 기울기와 중심점을 이용하여 바코드와 수직이고 바코드의 중심을 지나가는 직선을 그을 수 있다. 또한 바코드 영역의 후보블록들을 이용하여 4개의 최외각 점을 구하여 바코드가 포함된 직사각형의 영역을 만든 후, 기울기와 중심점을 이용하여 직사각형을 회전함으로써 바코드를 검출한다. 수직선이 지나갈 때의 화소 값을 순차적으로 획득함으로써 바코드가 가지고 있는 정보를 파악한다. 즉, 본 발명은 a) 화소의 방향성과 바코드 영역의 블록 결정 단계와, b) 레이블링에 의한 바코드 영역 검출 단계와, c) 바코드 기울기와 중심점 계산 및 바코드 검출 단계를 거치면서 바코드의 이미지영상이 가지고 있는 정보를 신속하고 정확하게 읽어낸다. From here
Figure 112004002756626-pat00022
Candidate blocks of the extracted barcode region,
Figure 112004002756626-pat00023
Denotes filters for the horizontal and vertical directions, respectively. Using the obtained slope and the center point, a straight line passing perpendicular to the barcode and passing through the center of the barcode can be drawn. In addition, four outermost points are obtained using candidate blocks of the barcode area to make a rectangular area including a barcode, and then the barcode is detected by rotating the rectangle using a slope and a center point. By acquiring the pixel values when the vertical line passes, the information possessed by the barcode is identified. That is, the present invention includes the image image of the barcode through a) the pixel orientation and the block determination of the barcode region, b) the barcode region detection by labeling, and c) the barcode slope and the center point calculation and the barcode detection stage. Read the information quickly and accurately.

실시 예 [ Example ]

본 발명에 따른 실시 예를 도면에 기초하여 구체적으로 살펴보면, 다양한 분야에서 널리 사용되는 CODE39, 국내외 상품관리용으로 사용되는 KAN, 미국과 캐나다에서 상품관리를 위해 사용되는 UPC, 미국과 캐나다 이외의 지역에서 상품관리를 위해 사용되는 EAN 및 서적을 포함한 연속간행물의 관리를 위해 사용되는 ISBN 등 다양한 바코드를 포함하는 1024×1024 크기의 영상을 이용하였으며 결과 영상들은 바코드 영역을 중심으로 한 원영상에 대한 부분영상이다. 도 2는 블록 별로 , 45, 90 및 135° 등 네 개의 방향에 대한 화소의 수를 누적한 히스토그램을 구하기 위 하여 이용한 네 개의 라인 연산자를 도시한 것이고, 도2에서 수치 2는 라인 연산자에 의한 연산 값이 가장 큰 방향의 화소가 가지는 방향이며 네 개의 라인 연산자를 이용하여 구한 각 화소가 가지는 방향은 도 3과 같다. 도 1의 바코드를 포함하는 블록과 그렇지 않은 블록의 각 방향에 대한 화소의 개수를 누적한 히스토그램에서도 볼 수 있었던 것처럼 바코드 영역에 동일한 방향을 가지는 화소들이 집중되어 있음을 볼 수 있다. 이러한 바코드 영역의 기하학적인 특징을 이용하여 검출된 방향에 대한 최대 히스토그램 값과 최소 히스토그램 값의 차이가 최대인 블록은 도 4에서 볼 수 있는 것처럼 바코드를 포함하는 영상에서 바코드 영역에 포함됨을 볼 수 있다. 바코드의 중심을 지나가는 직선의 정확한 기울기와 중심좌표를 찾기 위해 바코드를 포함하는 더 많은 후보 블록들을 검출하기 위해 문턱 값을 이용하여 블록을 대상으로 영상을 이진화 한다. 도 5의 (a)는 이진화 한 영상으로써 최대 히스토그램 값과 최소 히스토그램 값의 차가 문턱 값보다 큰 블록들은 바코드 영역에 많이 분포하고 있음을 볼 수 있다. 이진화 된 영상에 대해 레이블링을 행하여 연결 성분이 가장 많은 라벨이 붙은 블록들을 바코드를 포함하는 후보 블록으로 결정한다. 도 5의 (b)는 레이블링 후 바코드 영역의 후보 블록들을 나타낸다. 후보 블록들이 바코드 영역에 있음을 볼 수 있다. 도 6은 각 방향에 대한 최대 히스토그램 값과 최소 히스토그램 값의 차이가 최대인 블록만을 이용하여 구한 바코드의 중심을 지나가는 직선과 바코드 영역의 후보 블록들을 이용하여 구한 바코드의 중심을 지나가는 직선을 나타낸다. 도 6에서 보는 바와 같이 각 방향에 대한 최대 히스토그램 값과 최소 히스토그램 값의 차이가 최대인 블록만을 이용하여 직선을 구할 수 도 있지만 바코드 영역의 후보 블록들을 이용하여 구한 직선이 바코드의 중심을 좀더 정확하게 지나감을 볼 수 있다. 또한 본 발명에 따라 제안된 알고리즘에 의해서 바코드 검출이 가능함을 도 7을 통해서 확인할 수 있다. CODE39, KAN, UPC, 그리고 ISPN 등의 다양한 바코드와 배경을 포함하는 80개의 영상에 대한 알고리즘의 수행시간과 바코드 검출의 결과를 표 1에 나타내었다. 팬티엄3 CPU 866GHz와 256MB의 DRAM을 탑재한 개인용 PC에서 수행되었다. 평균 0.89초의 검출 시간과 95%의 바코드 검출률을 보였다. 하지만, 복잡한 배경을 가지는 영상에서는 문턱 값보다 큰 값을 가지는 블록이 많기 때문에 블록 단위의 레이블링 과정에서 바코드 검출 시간이 길어지고 바코드 검출에 다소 어려움을 겪는 경우도 있다.Looking at the embodiment according to the present invention in detail based on the drawings, CODE39 widely used in various fields, KAN used for domestic and foreign product management, UPC used for product management in the United States and Canada, regions other than the United States and Canada Used images of 1024 × 1024 including various barcodes such as EAN used for product management and ISBN used for managing serials including books. It is a video. FIG. 2 illustrates four line operators used to obtain a histogram that accumulates the number of pixels in four directions, such as 45, 90, and 135 °, for each block. In FIG. 3 is a direction of pixels having the largest value, and the direction of each pixel obtained using four line operators is shown in FIG. 3. It can be seen that pixels having the same direction are concentrated in the barcode region as can be seen in the histogram in which the number of pixels in each direction of the block including the barcode of FIG. As shown in FIG. 4, a block having a maximum difference between the maximum histogram value and the minimum histogram value for the detected direction using the geometric features of the barcode area may be included in the barcode area in the image including the barcode. . The image is binarized using the threshold value to detect more candidate blocks including the barcode to find the exact slope and the center coordinate of the straight line passing through the center of the barcode. 5 (a) shows a binarized image, in which blocks having a difference between a maximum histogram value and a minimum histogram value larger than a threshold value are distributed in a barcode region. Labeling is performed on the binarized image to determine the labeled blocks having the largest number of connected components as candidate blocks including barcodes. 5B shows candidate blocks of the barcode area after labeling. It can be seen that the candidate blocks are in the barcode region. FIG. 6 shows a straight line passing through the center of the barcode obtained using only the block having the largest difference between the maximum histogram value and the minimum histogram value in each direction, and a straight line passing through the center of the barcode obtained using candidate blocks of the barcode area. As shown in FIG. 6, a straight line may be obtained using only blocks having a maximum difference between the maximum histogram value and the minimum histogram value in each direction, but the straight line obtained using candidate blocks in the barcode area passes through the center of the barcode more accurately. You can see the sense. In addition, it can be seen from FIG. 7 that barcode detection is possible by the proposed algorithm according to the present invention. Table 1 shows the execution time and the result of barcode detection for 80 images including various barcodes and backgrounds such as CODE39, KAN, UPC, and ISPN. It was run on a personal PC with a Pentium 3 CPU 866GHz and 256MB of DRAM. The average detection time was 0.89 seconds and the barcode detection rate was 95%. However, since many blocks have a value larger than a threshold value in an image having a complex background, a barcode detection time may be lengthened in some block-by-block labeling process, and a barcode may be difficult to detect.

표 1. 바코드 검출 시간 및 검출율Table 1. Barcode Detection Time and Detection Rate

바코드 검출 시간  Barcode detection time 바코드 검출율 [%]   Barcode Detection Rate [%] 최소 검출 시간[s]  Detection time [s] 최대 검출 시간[s] Detection time [s] 평균 검출 시간[s] Average detection time [s] 0.622  0.622 1.42 1.42 0.89 0.89 95 95

표준으로 사용되고 있는 여러 종류의 바코드를 대상으로 본 발명에 따라 제안된 알고리즘의 신뢰도를 확인하기 위해 바코드의 각도와 배경의 패턴을 다양하게 하면서 바코드 검출 실험을 행하였고 그 결과 중 일부분을 도 8과 도 9에 나타내었 다. 제안한 방법을 임의의 배경과 각도로 회전된 바코드를 포함하는 영상에 적용한 결과, 바코드를 지나가는 직선을 그을 수 있었고 바코드를 검출할 수 있었다.In order to confirm the reliability of the proposed algorithm according to the present invention, various bar code detection experiments were performed with various bar code angles and background patterns. 9 is shown. As a result of applying the proposed method to the image including the barcode rotated at an arbitrary background and angle, we could draw a straight line passing through the barcode and detect the barcode.

본 발명은 수학적 알고리즘을 이용하여 바코드의 이미지 화소가 가지는 방향을 구하고 각 블록 별로 각 방향에 대한 화소의 누적 히스토그램 (histogram)을 구하여 상기 누적 히스토그램에서 최대 값과 최소 값의 차이가 가장 큰 블록을 바코드 영역의 블록을 결정하고 상기 가장 큰 차이 값을 이용하여 문턱값을 구하여 상기 블록별로 히스토그램의 최대값과 최소값의 차가 문턱값보다 큰 블록을 바코드의 기하학적 특징을 갖는 블록의 대상으로 분류하고 불록의 대상으로 확정된 바코드의 영상을 이진화하여 상기 이진화된 바코드의 영상을 레이블링을 행하여 바코드의 후보 블록을 결정하고 상기 후보 블록들의 화소를 이용하여 바코드의 기울기와 중심점을 구하여 바코드와 수직이고 바코드의 중심을 지나가는 직선을 그어 바코드를 검출하여 바코드의 영상 이미지를 신속하고 정확하게 추출하는 작용효과가 있다.The present invention obtains the direction of the image pixels of the barcode using a mathematical algorithm and obtains a cumulative histogram of the pixels in each direction for each block to determine the barcode having the largest difference between the maximum value and the minimum value in the cumulative histogram. Determining the block of the area and obtaining a threshold value using the largest difference value, classifies the block having the geometrical feature of the barcode as the object of the block with the difference between the maximum value and the minimum value of the histogram greater than the threshold value for each block. Binary image of the determined barcode by labeling the image of the binary barcode to determine the candidate block of the barcode and using the pixels of the candidate blocks to obtain the slope and the center point of the barcode to perpendicular to the barcode and to pass through the center of the barcode Draw a straight line to detect the bar code It has the effect of extracting video images quickly and accurately.

Claims (2)

수학적 알고리즘을 이용하여 바코드의 기하학적 특징을 구하고 레이블링을 행하여 바코드의 영상 이미지를 효율적으로 추출하는 방법에 있어서,In the method of extracting the image image of the barcode by obtaining the geometric features of the barcode using a mathematical algorithm and labeling, a) 라인 연산자를 이용하여 바코드의 이미지 화소가 가지는 방향을 구하는 단계와, a) using the line operator to determine the direction of the image pixels of the barcode; b) 상기 각 방향에 대한 화소의 누적 히스토그램을 구하는 단계와, b) obtaining a cumulative histogram of pixels for each direction; c) 상기 누적 히스토그램에서 최대 값과 최소 값의 차이가 가장 큰 블록으로 바코드 영역의 블록을 결정하는 단계와, c) determining a block of the barcode region as a block having a largest difference between a maximum value and a minimum value in the cumulative histogram; d) 상기 누적 히스토그램에서 최대 값과 최소 값이 가장 큰 값을 이용하여 문턱 값을 구하는 단계와, d) obtaining a threshold value using the largest and smallest values in the cumulative histogram; e) 상기 블록별로 히스토그램의 최대 값과 최소 값의 차가 상기 문턱 값보다 큰 블록을 바코드의 기하학적 특징을 갖는 블록으로 분류하는 단계와, e) classifying a block having a geometric characteristic of a barcode as a block having a difference between a maximum value and a minimum value of a histogram greater than the threshold value for each block; f) 상기 기하학적 특징을 갖는 블록을 대상으로 확정된 바코드의 영상을 이진화 하는 단계와, f) binarizing an image of a barcode determined for the block having the geometrical feature; g) 상기 이진화된 바코드의 영상을 레이블링 하여 바코드의 후보 블록을 결정하는 단계와, g) labeling an image of the binary barcode to determine a candidate block of the barcode; h) 상기 후보 블록들의 화소를 이용하여 바코드의 기울기와 중심점을 구하여 바코드와 수직이고 바코드의 중심을 지나가는 직선을 그어 바코드를 검출하는 단계를 구비함을 특징으로 하는 바코드의 영상 이미지를 신속하고 정확하게 추출하는 방법.h) extracting the image image of the barcode quickly and accurately by obtaining a slope and a center point of the barcode using the pixels of the candidate blocks and drawing a straight line perpendicular to the barcode and passing through the center of the barcode. How to. 청구항1에 있어서,The method according to claim 1, 상기 a) 단계에서 바코드의 이미지 화소가 가지는 방향을 0°, 45°, 90° 및 135°로 하여 4 개의 라인 연산자에 의하여 검출됨을 특징으로 하는 바코드의 영상 이미지를 신속하고 정확하게 추출하는 방법.Method of extracting a video image of a barcode quickly and accurately, characterized in that the four lines operator is detected by the direction of the image pixels of the barcode in step a) 0 °, 45 °, 90 ° and 135 °.
KR1020040004627A 2004-01-26 2004-01-26 An Effective Bar Code Detection Method using Mathematical Algorithm KR100555883B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020040004627A KR100555883B1 (en) 2004-01-26 2004-01-26 An Effective Bar Code Detection Method using Mathematical Algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020040004627A KR100555883B1 (en) 2004-01-26 2004-01-26 An Effective Bar Code Detection Method using Mathematical Algorithm

Publications (2)

Publication Number Publication Date
KR20040014626A KR20040014626A (en) 2004-02-14
KR100555883B1 true KR100555883B1 (en) 2006-03-03

Family

ID=37321410

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020040004627A KR100555883B1 (en) 2004-01-26 2004-01-26 An Effective Bar Code Detection Method using Mathematical Algorithm

Country Status (1)

Country Link
KR (1) KR100555883B1 (en)

Also Published As

Publication number Publication date
KR20040014626A (en) 2004-02-14

Similar Documents

Publication Publication Date Title
Katona et al. Efficient 1D and 2D barcode detection using mathematical morphology
Gaur et al. Recognition of 2D barcode images using edge detection and morphological operation
US8146818B2 (en) Apparatus and method for symbol information reading
US9251430B2 (en) Apparatus, method, and program for character recognition using minimum intensity curve of image data
JP6268023B2 (en) Character recognition device and character cutout method thereof
JP2010123090A (en) Method and device for recognizing character string
CN107016394B (en) Cross fiber feature point matching method
JPH0896059A (en) Bar code reader
Tribak et al. QR code recognition based on principal components analysis method
Namane et al. Fast real time 1D barcode detection from webcam images using the bars detection method
Zamberletti et al. Neural 1D barcode detection using the Hough transform
Lin et al. Automatic location for multi-symbology and multiple 1D and 2D barcodes
CN113643274A (en) Method and device for screening two-dimensional code candidate area
Karrach et al. Recognition of data matrix codes in images and their applications in production processes
Faraji et al. EREL: extremal regions of extremum levels
KR100555883B1 (en) An Effective Bar Code Detection Method using Mathematical Algorithm
Yun et al. Vision-based 1D barcode localization method for scale and rotation invariant
CN116469090A (en) Method and device for detecting code spraying pattern, electronic equipment and storage medium
Lin et al. Multi-symbology and multiple 1d/2d barcodes extraction framework
Mohammad et al. Practical recognition system for text printed on clear reflected material
Aghajari et al. A text localization algorithm in color image via new projection profile
Arai et al. Text extraction from TV commercial using blob extraction method
Royer et al. Benchmarking keypoint filtering approaches for document image matching
Nurhaida et al. Indonesian license plate recognition with improved horizontal-vertical edge projection
JP6144892B2 (en) Image processing apparatus, image processing method, and program

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
LAPS Lapse due to unpaid annual fee