KR20220070735A - Device for calculating focus of image and method thereof - Google Patents

Device for calculating focus of image and method thereof Download PDF

Info

Publication number
KR20220070735A
KR20220070735A KR1020200157609A KR20200157609A KR20220070735A KR 20220070735 A KR20220070735 A KR 20220070735A KR 1020200157609 A KR1020200157609 A KR 1020200157609A KR 20200157609 A KR20200157609 A KR 20200157609A KR 20220070735 A KR20220070735 A KR 20220070735A
Authority
KR
South Korea
Prior art keywords
image
focus
window
pixel
size
Prior art date
Application number
KR1020200157609A
Other languages
Korean (ko)
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 KR1020200157609A priority Critical patent/KR20220070735A/en
Publication of KR20220070735A publication Critical patent/KR20220070735A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • G06T7/55Depth or shape recovery from multiple images
    • G06T7/571Depth or shape recovery from multiple images from focus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T5/002
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10141Special mode during image acquisition
    • G06T2207/10148Varying focus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20182Noise reduction or smoothing in the temporal domain; Spatio-temporal filtering

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Studio Devices (AREA)

Abstract

An image focus calculation device and method are provided. An image focus calculation device according to an embodiment of the present invention includes a memory for storing a focus calculation target image obtained from a camera, and a control part for calculating a focus value for the image stored in the memory. Here, the control part sets the size of an image window for focus calculation of the focus calculation target image, calculates a focus value in the image window for each pixel of the target image, and assigns a weight the focus value calculated in the image window for each pixel of the target image.

Description

영상 초점 연산 장치 및 방법{Device for calculating focus of image and method thereof} Device for calculating focus of image and method thereof

본 발명은 영상 초점 측정 연산 및 방법에 관한 것으로, 특히, 가변 윈도우를 통한 가중치 할당을 통하여 영상 초점을 정확하게 연산할 수 있는 영상 초점 측정 연산 및 방법에 관한 것이다. The present invention relates to an image focus measurement operation and method, and more particularly, to an image focus measurement operation and method capable of accurately calculating an image focus through weight assignment through a variable window.

기존의 영상 초점 측정 연산자들은 고정된 영상 윈도우의 크기를 갖는다. 이 경우, 영상 윈도우 크기가 작으면, 영상 내의 텍스처가 없는 영역에서 최적의 영상 초점을 획득하기가 어렵다. 아울러, 영상 윈도우 크기가 크면, 샘플의 3차원 형상을 복원할 때 블러링을 유발한다. Existing image focus measurement operators have a fixed image window size. In this case, if the image window size is small, it is difficult to obtain an optimal image focus in a texture-free region in the image. In addition, if the image window size is large, blurring is caused when the 3D shape of the sample is restored.

또한, 기존의 영상 초점 측정 연산자들은 고정된 영상 윈도우 내의 각 초점값에 일정한 가중치들을 할당하기 때문에 스키드로더의 어라운드뷰 시스템에서 사용되는 영상 초점 연산 정확도가 떨어지는 문제점이 발생한다.In addition, since the existing image focus measurement operators assign constant weights to each focus value within a fixed image window, there is a problem in that the image focus operation accuracy used in the around-view system of the skid loader is lowered.

KRKR 2007-00503202007-0050320 AA

상기와 같은 종래 기술의 문제점을 해결하기 위해, 본 발명의 일 실시예는 가변 윈도우를 통한 가중치 할당을 통하여 영상 초점을 정확하게 연산할 수 있는 영상 초점 연산 장치 및 방법을 제공하고자 한다.In order to solve the above problems of the prior art, an embodiment of the present invention is to provide an image focus calculation apparatus and method capable of accurately calculating an image focus through weight assignment through a variable window.

다만, 본 발명이 해결하고자 하는 과제는 이상에서 언급한 과제에 제한되지 않으며, 언급되지 않은 또 다른 과제들은 아래의 기재로부터 당업자에게 명확하게 이해될 수 있을 것이다.However, the problems to be solved by 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.

위와 같은 과제를 해결하기 위한 본 발명의 일 측면에 따르면, 카메라에서 획득된 초점 연산 대상 영상을 저장하는 메모리; 및 상기 메모리에 저장된 영상에 대한 초점값을 연산하는 제어부를 포함하고, 상기 제어부는 상기 초점 연산 대상 영상에 대한 초점 연산을 위한 영상 윈도우의 크기를 설정하며, 상기 대상 영상의 각 픽셀에 대하여, 상기 영상 윈도우 내에서 초점값을 연산하고, 상기 대상 영상의 각 픽셀에 대하여, 상기 영상 윈도우 내에서 상기 연산된 초점값에 대한 가중치를 할당하는 영상 초점 연산 장치가 제공된다. According to an aspect of the present invention for solving the above problems, a memory for storing a focus operation target image obtained from a camera; and a control unit for calculating a focus value for the image stored in the memory, wherein the control unit sets a size of an image window for focus operation on the focus operation target image, and for each pixel of the target image, the An image focus operation apparatus is provided for calculating a focus value within an image window and assigning a weight to the calculated focus value within the image window to each pixel of the target image.

일 실시예에서, 상기 제어부는 상기 대상 영상의 각 픽셀에 대하여 상기 영상 윈도우 내에서 상기 가중치 적용된 초점값의 노이즈를 제거할 수 있다.In an embodiment, the controller may remove noise of the weighted focus value within the image window with respect to each pixel of the target image.

일 실시예에서, 상기 제어부는 상기 대상 영상의 각 픽셀에 대하여 상기 영상 윈도우 내에서 상기 가중치 적용된 초점값들을 합산할 수 있다.In an embodiment, the controller may add the weighted focus values for each pixel of the target image within the image window.

일 실시예에서, 상기 제어부는 상기 영상 윈도우의 크기를 감소시키면서, 각 영상 윈도우에 대한 밝기의 분산차가 가장 작은 경우의 영상 윈도우의 크기를 상기 초점 연산을 위한 영상 윈도우의 크기로 결정할 수 있다.In an embodiment, the controller may determine the size of the image window for the focus operation when the size of the image window is reduced while the size of the image window when the variance difference of brightness for each image window is smallest.

일 실시예에서, 상기 제어부는 해당 픽셀에 대하여, 상기 영상 윈도우 내의 다른 픽셀과의 거리에 따라 가중치를 적용할 수 있다.In an embodiment, the controller may apply a weight to the corresponding pixel according to a distance from another pixel in the image window.

일 실시예에서, 상기 제어부는 상기 대상 영상을 그레이 레벨 영상으로 변환할 수 있다.In an embodiment, the controller may convert the target image into a gray level image.

일 실시예에서, 상기 제어부는 하기의 수학식에 따라 상기 초점값을 연산할 수 있다:In an embodiment, the control unit may calculate the focus value according to the following equation:

Figure pat00001
Figure pat00001

여기서, ML(x,y)는 해당 픽셀 (x,y)에 대한 초점값, Here, ML(x,y) is the focal value of the corresponding pixel (x,y),

I(x,y)는 해당 픽셀 (x,y)에서 그레이 레벨 밝기.I(x,y) is the gray level brightness at that pixel (x,y).

일 실시예에서, 상기 제어부는 하기의 수학식에 따라 가중치를 할당할 수 있다:In an embodiment, the control unit may allocate weights according to the following equation:

Figure pat00002
Figure pat00002

여기서, AWML(x,y)는 해당 픽셀 (x,y)에 대한 가중치 적용 초점값,Here, AWML(x,y) is the weighted focus value for the pixel (x,y),

Figure pat00003
는 상기 설정된 영상 윈도우의 크기.
Figure pat00003
is the size of the set image window.

일 실시예에서, 상기 제어부는 하기의 수학식에 따라 노이즈를 제거할 수 있다: In an embodiment, the control unit may remove noise according to the following equation:

Figure pat00004
Figure pat00004

여기서, ASWML(x,y)는 해당 픽셀(x,y)에 대한 노이즈 제거된 초점값.Here, ASWML(x,y) is the denoised focus value for the corresponding pixel (x,y).

본 발명의 다른 측면에 따르면, 초점 연산 대상 영상에 대한 초점 연산을 위한 영상 윈도우의 크기를 설정하는 단계; 상기 대상 영상의 각 픽셀에 대하여, 상기 영상 윈도우 내에서 초점값을 연산하는 단계; 및 상기 대상 영상의 각 픽셀에 대하여, 상기 영상 윈도우 내에서 상기 연산된 초점값에 대한 가중치를 할당하는 단계;를 포함하는 영상 초점 연산 방법이 제공된다. According to another aspect of the present invention, the method comprising: setting a size of an image window for focus operation with respect to a focus operation target image; calculating a focus value within the image window for each pixel of the target image; and allocating a weight to the calculated focus value within the image window to each pixel of the target image.

일 실시예에서, 상기 영상 초점 연산 방법은 상기 대상 영상의 각 픽셀에 대하여 상기 영상 윈도우 내에서 상기 가중치 적용된 초점값의 노이즈를 제거하는 단계를 더 포함할 수 있다.In an embodiment, the image focus calculation method may further include removing noise of the weighted focus value within the image window with respect to each pixel of the target image.

일 실시예에서, 상기 노이즈를 제거하는 단계는 상기 대상 영상의 각 픽셀에 대하여 상기 영상 윈도우 내에서 상기 가중치 적용된 초점값들을 합산할 수 있다.In an embodiment, the removing of the noise may include summing the weighted focus values within the image window for each pixel of the target image.

일 실시예에서, 상기 영상 윈도우의 크기를 설정하는 단계는 상기 영상 윈도우의 크기를 감소시키면서, 각 영상 윈도우에 대한 밝기의 분산차가 가장 작은 경우의 영상 윈도우의 크기를 상기 초점 연산을 위한 영상 윈도우의 크기로 결정할 수 있다.In an embodiment, the step of setting the size of the image window decreases the size of the image window and sets the size of the image window when the variance difference in brightness for each image window is the smallest of the image window for the focus operation. size can be determined.

일 실시예에서, 상기 가중치를 할당하는 단계는 해당 픽셀에 대하여, 상기 영상 윈도우 내의 다른 픽셀과의 거리에 따라 가중치를 적용할 수 있다.In an embodiment, the assigning of the weight may include applying the weight to the corresponding pixel according to a distance from another pixel in the image window.

일 실시예에서, 상기 영상 초점 연산 방법은 상기 대상 영상을 그레이 레벨 영상으로 변환하는 단계를 더 포함할 수 있다.In an embodiment, the image focus calculation method may further include converting the target image into a gray level image.

일 실시예에서, 상기 초점값을 연산하는 단계는 하기의 수학식에 따라 상기 초점값을 연산할 수 있다:In an embodiment, the calculating of the focus value may include calculating the focus value according to the following equation:

Figure pat00005
Figure pat00005

여기서, ML(x,y)는 해당 픽셀 (x, y)에 대한 초점값, Here, ML(x,y) is the focal value of the corresponding pixel (x, y),

I(x,y)는 해당 픽셀 (x, y)에서 그레이 레벨 밝기.I(x,y) is the gray level brightness at that pixel (x,y).

일 실시예에서, 상기 가중치를 할당하는 단계는 하기의 수학식에 가중치를 할당할 수 있다:In one embodiment, the assigning the weight may assign the weight to the following equation:

Figure pat00006
Figure pat00006

여기서, AWML(x,y)는 해당 픽셀 (x,y)에 대한 가중치 적용된 초점값,Here, AWML(x,y) is the weighted focus value for the corresponding pixel (x,y),

Figure pat00007
는 상기 설정된 영상 윈도우의 크기.
Figure pat00007
is the size of the set image window.

일 실시예에서, 상기 노이즈를 제거하는 단계는 하기의 수학식에 따라 노이즈를 제거할 수 있다:In an embodiment, the removing of the noise may remove the noise according to the following equation:

Figure pat00008
Figure pat00008

여기서, ASWML(x,y)는 해당 픽셀(x,y)에 대한 노이즈 제거된 초점값.Here, ASWML(x,y) is the denoised focus value for the corresponding pixel (x,y).

본 발명의 일 실시예에 따른 영상 초점 연산 장치 및 방법은 영상 윈도우의 크기를 가변적으로 설정하고, 영상 윈도우 내의 중심 픽셀로부터 거리에 따라 적절한 가중치를 할당함으로써 영상 초점을 정확하게 연산할 수 있으므로 영상 노이즈에 강건하고 영상 초점 연산 정확도를 향상시킬 수 있다. The image focus calculation apparatus and method according to an embodiment of the present invention can accurately calculate the image focus by setting the size of the image window variably and assigning an appropriate weight according to the distance from the central pixel in the image window, so that the image focus is reduced to image noise. It is robust and can improve the image focus operation accuracy.

도 1은 본 발명의 일 실시예에 따른 영상 초점 연산 장치의 블록도이다.
도 2는 도 1의 제어부의 세부 블록도이다.
도 3은 본 발명의 일 실시예에 따른 영상 초점 연산 장치의 가변 윈도우의 크기 설정을 설명하기 위한 도면이다.
도 4는 본 발명의 일 실시예에 따른 영상 초점 연산 장치의 가중치 할당을 설명하기 위한 도면이다.
도 5는 본 발명의 일 실시예에 따른 영상 초점 연산 방법의 순서도이다.
도 6은 도 5의 윈도우 크기 설정 절차의 순서도이다.
1 is a block diagram of an image focusing apparatus according to an embodiment of the present invention.
FIG. 2 is a detailed block diagram of the control unit of FIG. 1 .
3 is a view for explaining the setting of a size of a variable window of an image focus operation apparatus according to an embodiment of the present invention.
4 is a diagram for explaining weight assignment of an image focus operation apparatus according to an embodiment of the present invention.
5 is a flowchart of an image focus calculation method according to an embodiment of the present invention.
6 is a flowchart of a window size setting procedure of FIG. 5 .

이하, 첨부한 도면을 참고로 하여 본 발명의 실시예에 대하여 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 상세히 설명한다. 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시예에 한정되지 않는다. 도면에서 본 발명을 명확하게 설명하기 위해서 설명과 관계없는 부분은 생략하였으며, 명세서 전체를 통하여 동일 또는 유사한 구성요소에 대해서는 동일한 참조부호를 붙였다.Hereinafter, with reference to the accompanying drawings, embodiments of the present invention will be described in detail so that those of ordinary skill in the art can easily carry out the present invention. The present invention may be embodied in many different forms and is not limited to the embodiments described herein. In order to clearly explain the present invention in the drawings, parts irrelevant to the description are omitted, and the same reference numerals are given to the same or similar components throughout the specification.

본 발명의 실시예들은 당해 기술 분야에서 통상의 지식을 가진 자에게 본 발명을 더욱 완전하게 설명하기 위해 제공되는 것이며, 아래에 설명되는 실시예들은 여러 가지 다른 형태로 변형될 수 있으며, 본 발명의 범위가 아래의 실시예들로 한정되는 것은 아니다. 오히려, 이들 실시예는 본 발명을 더욱 충실하고 완전하게 하며 당업자에게 본 발명의 사상을 완전하게 전달하기 위하여 제공되는 것이다.The embodiments of the present invention are provided to more completely explain the present invention to those of ordinary skill in the art, and the embodiments described below may be modified in various other forms, The scope is not limited to the following examples. Rather, these examples are provided so as to more fully and complete the present invention, and to fully convey the spirit of the present invention to those skilled in the art.

본 명세서에서 사용된 용어는 특정 실시예를 설명하기 위하여 사용되며, 본 발명을 제한하기 위한 것이 아니다. 본 명세서에서 사용된 바와 같이 단수 형태는 문맥상 다른 경우를 분명히 지적하는 것이 아니라면, 복수의 형태를 포함할 수 있다. 또한, 본 명세서에서 사용되는 경우 "포함한다(comprise)" 및/또는 "포함하는(comprising)"은 언급한 형상들, 숫자, 단계, 동작, 부재, 요소 및/또는 이들 그룹의 존재를 특정하는 것이며, 하나 이상의 다른 형상, 숫자, 동작, 부재, 요소 및/또는 그룹들의 존재 또는 부가를 배제하는 것이 아니다. 본 명세서에서 사용된 바와 같이, 용어 "및/또는"은 해당 열거된 항목 중 어느 하나 및 하나 이상의 모든 조합을 포함한다. The terminology used herein is used to describe specific embodiments, not to limit the present invention. As used herein, the singular form may include the plural form unless the context clearly dictates otherwise. Also, as used herein, “comprise” and/or “comprising” refers to specifying the presence of the recited shapes, numbers, steps, actions, members, elements, and/or groups thereof. and does not exclude the presence or addition of one or more other shapes, numbers, movements, members, elements and/or groups. As used herein, the term “and/or” includes any one and all combinations of one or more of those listed items.

본 명세서에서 제1, 제2 등의 용어가 다양한 부재, 영역 및/또는 부위들을 설명하기 위하여 사용되지만, 이들 부재, 부품, 영역, 층들 및/또는 부위들은 이들 용어에 의해 한정되지 않음은 자명하다. 이들 용어는 특정 순서나 상하, 또는 우열을 의미하지 않으며, 하나의 부재, 영역 또는 부위를 다른 부재, 영역 또는 부위와 구별하기 위하여만 사용된다. 따라서 이하 상술할 제1 부재, 영역 또는 부위는 본 발명의 가르침으로부터 벗어나지 않고서도 제2 부재, 영역 또는 부위를 지칭할 수 있다.Although the terms first, second, etc. are used herein to describe various elements, regions and/or regions, it is to be understood that these elements, parts, regions, layers and/or regions are not limited by these terms. . These terms do not imply a specific order, upper and lower, or superiority, and are used only to distinguish one member, region or region from another member, region or region. Accordingly, a first member, region or region to be described below may refer to a second member, region or region without departing from the teachings of the present invention.

본 명세서에서, "또는", "적어도 하나" 등의 용어는 함께 나열된 단어들 중 하나를 나타내거나, 또는 둘 이상의 조합을 나타낼 수 있다. 예를 들어, "A 또는 B", "A 및 B 중 적어도 하나"는 A 또는 B 중 하나만을 포함할 수 있고, A와 B를 모두 포함할 수도 있다.In this specification, terms such as “or”, “at least one” and the like may indicate one of the words listed together, or a combination of two or more. For example, "A or B" or "at least one of A and B" may include only one of A or B, or both A and B.

이하, 본 발명의 실시예들은 본 발명의 실시예들을 개략적으로 도시하는 도면들을 참조하여 설명한다. 도면들에 있어서, 예를 들면, 제조 기술 및/또는 공차에 따라, 도시된 형상의 변형들이 예상될 수 있다. 따라서 본 발명의 실시예는 본 명세서에 도시된 영역의 특정 형상에 제한된 것으로 해석되어서는 아니 되며, 예를 들면 제조상 초래되는 형상의 변화를 포함하여야 한다.DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of the present invention will be described with reference to drawings schematically illustrating embodiments of the present invention. In the drawings, variations of the illustrated shape may be expected, for example depending on manufacturing technology and/or tolerances. Therefore, the embodiment of the present invention should not be construed as limited to the specific shape of the region shown in this specification, but should include, for example, a shape change caused by manufacturing.

도 1은 본 발명의 일 실시예에 따른 영상 초점 연산 장치의 블록도이고, 도 2는 도 1의 제어부의 세부 블록도이다. 1 is a block diagram of an image focusing apparatus according to an embodiment of the present invention, and FIG. 2 is a detailed block diagram of the controller of FIG. 1 .

도 1을 참조하면, 본 발명의 일 실시예에 따른 영상 초점 연산 장치(100)는 카메라(110), 제어부(120) 및 메모리(130)를 포함할 수 있다.Referring to FIG. 1 , an image focus operation apparatus 100 according to an embodiment of the present invention may include a camera 110 , a controller 120 , and a memory 130 .

본 발명의 일 실시예에 따른 영상 초점 연산 장치(100)는 스키드로더의 어라운드뷰 시스템에 적용하기 위한 것으로, 영상 윈도우 내의 그레이 레벨 영상 밝기의 분산을 사용하여 영상 윈도우의 크기를 가변적으로 설정하고, 영상 윈도우 내의 중심 픽셀로부터 거리에 따라 이웃 픽셀들에게 적절한 가중치를 할당함으로써 최적의 영상 초점을 획득할 수 있다.The image focus operation device 100 according to an embodiment of the present invention is to be applied to an around-view system of a skid loader, and variably sets the size of the image window by using the dispersion of the gray level image brightness within the image window, An optimal image focus may be obtained by allocating appropriate weights to neighboring pixels according to distances from the central pixel in the image window.

카메라(110)는 스키드로더에 장착되는 어라운드뷰 카메라일 수 있다. 카메라(110)는 스키드로더 주변의 영상을 촬영할 수 있다. 일례로, 카메라(110)는 흑백인 그레이 레벨 영상을 획득할 수 있다. 다른 예로서, 카메라(110)는 컬러인 RGB 영상을 획득할 수 있다.The camera 110 may be an around-view camera mounted on the skid loader. The camera 110 may take an image around the skid loader. For example, the camera 110 may acquire a gray level image in black and white. As another example, the camera 110 may acquire a color RGB image.

메모리(130)는 카메라(110)로부터 획득된 초점 연산 대상 영상을 저장할 수 있다. 일례로, 메모리(130)는 그 유형에 따라 하드디스크 타입(hard disk type), 마그네틱 매체 타입(Magnetic media type), CD-ROM(Compact Disc Read Only Memory), 광기록 매체 타입(Optical Media type), 자기-광 매체 타입(Magneto-optical media type), 멀티미디어 카드 마이크로 타입(Multimedia card micro type), 플래시 저장부 타입(flash memory type), 롬 타입(read only memory type), 또는 램 타입(randomaccess memory type) 등을 포함할 수 있으나, 이에 한정되는 것은 아니다. 또한, 메모리(130)는 그 용도/위치에 따라 캐시(cache), 버퍼, 주기억장치, 또는 보조기억장치이거나 별도로 마련된 저장 시스템일 수 있으나, 이에 한정되는 것은 아니다.The memory 130 may store a focus operation target image obtained from the camera 110 . For example, the memory 130 may be a hard disk type, a magnetic media type, a compact disc read only memory (CD-ROM), or an optical media type depending on the type. , a magneto-optical media type, a multimedia card micro type, a flash memory type, a read only memory type, or a random access memory type) and the like, but is not limited thereto. In addition, the memory 130 may be a cache, a buffer, a main memory, an auxiliary memory, or a separately provided storage system according to its purpose/location, but is not limited thereto.

제어부(120)는 카메라(110) 및 메모리(130)와 통신적으로 연결되어 이들을 제어할 수 있다. 일례로, 제어부(120)는 하드웨어인 프로세서(processor) 또는 해당 프로세서에서 수행되는 소프트웨어인 프로세스(process) 등을 포함할 수 있으나, 이에 한정되는 것은 아니다. The controller 120 may be communicatively connected to the camera 110 and the memory 130 to control them. As an example, the controller 120 may include a processor that is hardware or a process that is software that is executed in a corresponding processor, but is not limited thereto.

제어부(120)는 메모리(130)에 저장된 영상에 대한 초점값을 연산할 수 있다. 이때, 제어부(120)는 대상 영상이 RGB 영상 등과 같이 그레이 레벨 영상이 아닌 경우, 대상 영상을 그레이 레벨 영상으로 변환할 수 있다.The controller 120 may calculate a focus value for the image stored in the memory 130 . In this case, when the target image is not a gray level image such as an RGB image, the controller 120 may convert the target image into a gray level image.

도 2를 참조하면, 제어부(120)는 윈도우 설정부(122), 초점값 연산부(124), 가중치 할당부(126) 및 노이즈 제거부(128)를 포함할 수 있다. Referring to FIG. 2 , the control unit 120 may include a window setting unit 122 , a focus value calculating unit 124 , a weight assigning unit 126 , and a noise removing unit 128 .

윈도우 설정부(122)는 초점 연산 대상 영상에 대한 초점 연산을 위한 영상 윈도우의 크기를 설정할 수 있다.The window setting unit 122 may set the size of the image window for focus operation on the focus operation target image.

도 3은 본 발명의 일 실시예에 따른 영상 초점 연산 장치의 가변 윈도우의 크기 설정을 설명하기 위한 도면이다.FIG. 3 is a view for explaining setting of a size of a variable window of an image focusing apparatus according to an embodiment of the present invention.

도 3을 참조하면, 윈도우 설정부(122)는 영상 윈도우(W1~W4)의 크기를 감소시키면서, 각 영상 윈도우(W1~W4)에 대한 밝기의 분산차가 가장 작은 경우의 영상 윈도우의 크기를 초점 연산을 위한 영상 윈도우의 크기로 결정할 수 있다. 여기서, 해당 픽셀(중심 픽셀)은 적색 점으로 표시된다. 즉, 중심 픽셀에 대하여 영상 윈도우(W1~W4)는 크기가 가변될 수 있다.Referring to FIG. 3 , the window setting unit 122 reduces the size of the image windows W1 to W4 while focusing on the size of the image window when the variance difference in brightness for each image window W1 to W4 is smallest. It can be determined by the size of the image window for calculation. Here, the corresponding pixel (the central pixel) is indicated by a red dot. That is, the size of the image windows W1 to W4 with respect to the central pixel may vary.

이때, 윈도우 설정부(122)는 영상 윈도우 내의 그레이 레벨 영상 밝기의 분산을 사용하여 영상 윈도우 크기를 가변적으로 설정하기 위해 초기 영상 윈도우 크기를 일정한 크기(예를 들면 15×15)로 설정할 수 있다. 아울러, 윈도우 설정부(122)는 영상 윈도우 내의 그레이 레벨 영상 밝기의 분산값이 변하지 않을 때까지 영상 윈도우의 크기를 줄이고, 해당하는 윈도우의 크기를 초점 연산을 위한 영상 윈도우의 크기로 선택할 수 있다.In this case, the window setting unit 122 may set the initial image window size to a constant size (eg, 15×15) in order to variably set the image window size by using the dispersion of the gray level image brightness within the image window. In addition, the window setting unit 122 may reduce the size of the image window until the variance value of the gray level image brightness within the image window does not change, and select the size of the corresponding window as the size of the image window for focus operation.

일례로, 윈도우 설정부(122)는 초기 영상 윈도우의 크기(Wi)로 15를 설정할 수 있다. 이어서, 윈도우 설정부(122)는 윈도우의 크기를 1 감소시켜 다음 영상 윈도우의 크기(Wn)를 14로 설정할 수 있다.For example, the window setting unit 122 may set 15 as the size Wi of the initial image window. Subsequently, the window setting unit 122 may decrease the size of the window by 1 to set the size Wn of the next image window to 14.

이때, 윈도우 설정부(122)는 초기 영상 윈도우와 다음 영상 윈도우를 하기의 수학식 1에 따라 비교할 수 있다.In this case, the window setting unit 122 may compare the initial image window and the next image window according to Equation 1 below.

Figure pat00009
Figure pat00009

여기서, vi과 vn은 각각은 초기 영상 윈도우와 다음 영상 윈도우에 대한 그레이 레벨 영상 밝기의 분산값이고, T는 윈도우 크기의 가변에 따라 분산값이 변하지 않다고 판단할 수 있는 정도의 크기를 갖는 미리 설정된 임계값이다. Here, v i and v n are the variance values of the gray level image brightness for the initial image window and the next image window, respectively, and T is a size to a degree that it can be determined that the variance value does not change according to a change in the window size. It is a preset threshold.

즉, 윈도우 설정부(122)는 초기 영상 윈도우와 다음 영상 윈도우에 대한 그레이 레벨 영상 밝기의 분산차의 절대값이 임계값(T)을 초과하는지를 비교할 수 있다. 이때, 초기 영상 윈도우와 다음 영상 윈도우에 대한 그레이 레벨 영상 밝기의 분산차의 절대값이 임계값(T)보다 크면, 윈도우 설정부(122)는 초기 영상 윈도우의 크기(Wi)를 그대로 유지한 상태에서 다음 영상 윈도우의 크기(Wn)를 1만큼 감소시킬 수 있다.That is, the window setting unit 122 may compare whether the absolute value of the variance difference between the gray level image brightness for the initial image window and the next image window exceeds the threshold value T. At this time, if the absolute value of the variance difference between the gray level image brightness for the initial image window and the next image window is greater than the threshold value T, the window setting unit 122 maintains the size Wi of the initial image window as it is. may decrease the size (Wn) of the next image window by 1.

이어서, 윈도우 설정부(122)는 상술한 바와 같이 크기 15인 초기 영상 윈도우와 크기 13인 다음 영상 윈도우의 분산값을 비교할 수 있다.Next, as described above, the window setting unit 122 may compare the variance values of the initial image window having a size of 15 and a next image window having a size of 13 as described above.

이때, 초기 영상 윈도우와 다음 영상 윈도우에 대한 그레이 레벨 영상 밝기의 분산차의 절대값이 임계값(T) 이하이면, 윈도우 설정부(122)는 초기 영상 윈도우의 크기(Wi)를 1만큼 감소시킬 수 있다. 즉, 윈도우 설정부(122)는 초기 영상 윈도우의 크기(Wi)를 14로 설정할 수 있다.At this time, if the absolute value of the variance difference between the gray level image brightness for the initial image window and the next image window is less than or equal to the threshold value T, the window setting unit 122 may reduce the size Wi of the initial image window by 1. can That is, the window setting unit 122 may set the size Wi of the initial image window to 14.

이 경우에도, 다음 영상 윈도우의 크기(Wn)를 1만큼 감소시켜 다시 초기 영상 윈도우와 비교할 수 있다. 일례로, 윈도우 설정부(122)는 크기 14인 초기 영상 윈도우와 크기 13인 다음 영상 윈도우를 비교할 수 있다.Even in this case, the size Wn of the next image window may be decreased by 1 to be compared with the initial image window again. For example, the window setting unit 122 may compare an initial image window having a size of 14 with a next image window having a size of 13 .

이와 같이, 다음 영상 윈도우의 크기(Wn)가 1일 때까지 윈도우 설정부(122)는 초기 영상 윈도우와 다음 영상 윈도우를 크기 변경하면서 분산값을 비교할 수 있다. 여기서, 윈도우 설정부(122)는 최종적인 초기 영상 윈도우의 크기(Wi)를 초점 연산을 위한 영상 윈도우의 크기로 선택할 수 있다.As such, until the size Wn of the next image window is 1, the window setting unit 122 may compare the variance values while changing the sizes of the initial image window and the next image window. Here, the window setting unit 122 may select the size Wi of the final initial image window as the size of the image window for focus operation.

이에 의해, 본 발명의 일 실시예에 따른 영상 초점 연산 장치(100)는 대상 영상에서 텍스처가 없는 영역에서도 최적의 영상 초점을 획득할 수 있으면서도 대상 영상을 3차원 형상을 복원할 때 블러링을 유발하지 않도록 영상 윈도우를 적합한 크기로 설정할 수 있다.Accordingly, the image focus operation apparatus 100 according to an embodiment of the present invention can obtain an optimal image focus even in an area without a texture in the target image, and causes blurring when reconstructing a three-dimensional shape of the target image. You can set the video window to an appropriate size to avoid this.

다시 도 2를 참조하면, 초점값 연산부(124)는 대상 영상의 각 픽셀에 대하여, 영상 윈도우 내에서 초점값을 연산할 수 있다. 이때, 초점값 연산부(124)는 하기의 수학식 2에 따라 각 픽셀에 대한 초점값을 연산할 수 있다.Referring back to FIG. 2 , the focus value calculator 124 may calculate a focus value for each pixel of the target image within the image window. In this case, the focus value calculator 124 may calculate a focus value for each pixel according to Equation 2 below.

Figure pat00010
Figure pat00010

여기서, ML(x,y)는 해당 픽셀 (x,y)에 대한 초점값이고, I(x,y)는 해당 픽셀 (x,y)에서 그레이 레벨 밝기이다. 아울러, 해당 픽셀은 영상 윈도우 내에서 중심 픽셀일 수 있다. 이때, ML(x,y)은 중심 픽셀(x,y)에서 ML(Modified Laplacian) 연산자를 적용한 것으로 이해될 수 있다.Here, ML(x,y) is the focus value of the corresponding pixel (x,y), and I(x,y) is the gray level brightness of the corresponding pixel (x,y). In addition, the corresponding pixel may be a central pixel within the image window. In this case, ML(x,y) may be understood as applying a Modified Laplacian (ML) operator to the central pixel (x,y).

가중치 할당부(126)는 대상 영상의 각 픽셀에 대하여, 영상 윈도우 내에서 연산된 초점값(ML)에 대한 가중치를 할당할 수 있다.The weight allocator 126 may allocate a weight to the focus value ML calculated within the image window to each pixel of the target image.

도 4는 본 발명의 일 실시예에 따른 영상 초점 연산 장치의 가중치 할당을 설명하기 위한 도면이다. 4 is a diagram for explaining weight assignment of an image focus operation apparatus according to an embodiment of the present invention.

도 4를 참조하면, 영상 윈도우(W) 내에서, 중심 픽셀(적색 점)로부터 거리가 멀어질수록 중심 픽셀에 대한 영향이 작고, 가까울수록 중심 픽셀에 대한 영향이 크게 되도록 가중치가 할당될 수 있다.Referring to FIG. 4 , in the image window W, weights may be assigned so that as the distance from the central pixel (red dot) increases, the influence on the central pixel is small, and the closer the distance from the central pixel (red dot) is, the greater the influence on the central pixel. .

이때, 가중치 할당부(126)는 해당 픽셀(중심 픽셀; 적색 점)에 대하여, 영상 윈도우(W) 내의 다른 픽셀과의 거리에 따라 가중치를 적용할 수 있다. 일례로, 가중치 할당부(126)는 하기의 수학식 3에 따라 초점값(ML)에 가중치를 할당할 수 있다.In this case, the weight allocator 126 may apply a weight to the corresponding pixel (the central pixel; the red dot) according to a distance from other pixels in the image window W. Referring to FIG. For example, the weight allocator 126 may allocate a weight to the focus value ML according to Equation 3 below.

Figure pat00011
Figure pat00011

여기서, AWML(x,y)는 해당 픽셀 (x,y)에 대한 가중치 적용 초점값이고,

Figure pat00012
는 설정된 영상 윈도우의 크기이다. 이때, AWML(x,y)은 중심 픽셀(x,y)에서 AWML(Adaptive Weighted Modified Laplacian) 연산자를 적용한 것으로 이해될 수 있다.Here, AWML(x,y) is the weighted focus value for the pixel (x,y),
Figure pat00012
is the size of the set image window. In this case, AWML(x,y) may be understood as applying an Adaptive Weighted Modified Laplacian (AWML) operator to the central pixel (x,y).

즉, 가중치 적용된 초점값(AWML)은 해당 픽셀(x,y)을 중심으로 하는 영상 윈도우(W) 내에서 가중치가 적용된 모든 픽셀의 합으로 나타낼 수 있다. 이때, 해당 픽셀(x,y)을 중심으로 하는 영상 윈도우(W) 내에서 해당 픽셀 사이의 거리에 따라 각 픽셀의 가중치가 결정될 수 있다.That is, the weighted focus value AWML may be expressed as the sum of all pixels to which the weight is applied within the image window W centered on the corresponding pixel (x,y). In this case, the weight of each pixel may be determined according to a distance between the corresponding pixels within the image window W centered on the corresponding pixel (x, y).

이에 의해, 본 발명의 일 실시예에 따른 영상 초점 연산 장치(100)는 별도의 노이즈 제거 처리를 하지 않은 경우에도, 영상 노이즈에 강건하고 영상 초점 연산 정확도를 향상시킬 수 있다. Accordingly, the image focus operation apparatus 100 according to an embodiment of the present invention can be robust to image noise and improve image focus operation accuracy even when a separate noise removal process is not performed.

다시 도 2를 참조하면, 노이즈 제거부(128)는 대상 영상의 각 픽셀에 대하여 영상 윈도우 내에서 가중치 적용된 초점값(AWML)의 노이즈를 제거할 수 있다. 이때, 노이즈 제거부(128)는 대상 영상의 각 픽셀에 대하여 영상 윈도우 내에서 가중치 적용된 초점값(AWML)들을 합산할 수 있다.Referring back to FIG. 2 , the noise removing unit 128 may remove noise of a focus value AWML that is weighted within an image window with respect to each pixel of the target image. In this case, the noise removing unit 128 may sum the weighted focus values AWML for each pixel of the target image within the image window.

일례로, 노이즈 제거부(128)는 하기의 수학식 4에 따라 가중치 적용된 초점값(AWML)의 노이즈를 제거할 수 있다.As an example, the noise removing unit 128 may remove noise of the focus value AWML to which a weight is applied according to Equation 4 below.

Figure pat00013
Figure pat00013

여기서, ASWML(x,y)는 해당 픽셀(x,y)에 대한 노이즈 제거된 초점값이다. 이때, ASWML(x,y)은 중심 픽셀(x,y)에서 ASWML(Adaptive Sum of Weighted Modified Laplacian) 연산자를 적용한 것으로 이해될 수 있다.Here, ASWML(x,y) is the denoised focus value of the corresponding pixel (x,y). In this case, ASWML(x,y) may be understood as applying an Adaptive Sum of Weighted Modified Laplacian (ASWML) operator to the central pixel (x,y).

이에 의해, 본 발명의 일 실시예에 따른 영상 초점 연산 장치(100)는 영상 초점을 정확하게 연산할 수 있으므로 영상 노이즈에 강건하고 영상 초점 연산 정확도를 향상시킬 수 있다. Accordingly, since the image focus operation apparatus 100 according to an embodiment of the present invention can accurately calculate the image focus, it is robust to image noise and improves the image focus operation accuracy.

이하, 도 5 및 도 6을 참조하여 본 발명의 영상 초점 연산 방법을 설명한다.Hereinafter, an image focus calculation method of the present invention will be described with reference to FIGS. 5 and 6 .

도 5는 본 발명의 일 실시예에 따른 영상 초점 연산 방법의 순서도이다. 5 is a flowchart of an image focus calculation method according to an embodiment of the present invention.

영상 초점 연산 방법(200)은 윈도우 크기 설정 단계(S210), 영상 윈도우 내 초점값 연산 단계(S220), 초점값에 가중치 할당 단계(S230) 및 가중치 적용된 초점값에 노이즈 제거 단계(S240)를 포함할 수 있다.The image focus calculation method 200 includes a window size setting step (S210), a focus value calculation step within the image window (S220), a weight assignment step (S230) to the focus value, and a noise removal step (S240) for the weighted focus value can do.

보다 상세히 설명하면, 도 5에 도시된 바와 같이, 먼저, 영상 초점 연산 장치(100)는 초점 연산 대상 영상에 대한 초점 연산을 위한 영상 윈도우의 크기를 설정한다(단계 S210). 이때, 영상 초점 연산 장치(100)는 영상 윈도우의 크기를 감소시키면서, 각 영상 윈도우에 대한 밝기의 분산차가 가장 작은 경우의 영상 윈도우의 크기를 상기 초점 연산을 위한 영상 윈도우의 크기로 결정할 수 있다. 구체적인 방법은 도 6을 참조하여 후술한다. More specifically, as shown in FIG. 5 , first, the image focus operation apparatus 100 sets the size of an image window for focus operation on a focus operation target image (step S210 ). In this case, the image focus operation apparatus 100 may determine the size of the image window for the case where the variance difference of brightness for each image window is smallest as the size of the image window for the focus operation while reducing the size of the image window. A specific method will be described later with reference to FIG. 6 .

이때, 대상 영상이 RGB 영상 등과 같이 그레이 레벨 영상이 아닌 경우, 영상 초점 연산 장치(100)는 대상 영상을 그레이 레벨 영상으로 변환할 수 있다. 여기서, 그레이 레벨 영상 변환은 영상 윈도우 크기 설정 이전에 수행될 수 있다.In this case, when the target image is not a gray level image, such as an RGB image, the image focusing apparatus 100 may convert the target image into a gray level image. Here, the gray level image conversion may be performed before setting the image window size.

다음으로, 영상 초점 연산 장치(100)는 대상 영상의 각 픽셀에 대하여, 영상 윈도우 내에서 초점값을 연산한다(단계 S220). 이때, 영상 초점 연산 장치(100)는 상기의 수학식 2에 따라 각 픽셀에 대한 초점값(ML)을 연산할 수 있다.Next, the image focus operation apparatus 100 calculates a focus value for each pixel of the target image within the image window (step S220 ). In this case, the image focus operation apparatus 100 may calculate a focus value ML for each pixel according to Equation 2 above.

다음으로, 영상 초점 연산 장치(100)는 대상 영상의 각 픽셀에 대하여, 영상 윈도우 내에서 연산된 초점값(ML)에 대한 가중치를 할당한다(단계 S230). 여기서, 영상 윈도우 내에서, 중심 픽셀로부터 거리가 멀어질수록 중심 픽셀에 대한 영향이 작고, 가까울수록 중심 픽셀에 대한 영향이 크게 되도록 가중치가 할당될 수 있다.Next, the image focus operation apparatus 100 allocates a weight to the focus value ML calculated within the image window to each pixel of the target image (step S230 ). Here, in the image window, weights may be assigned so that the farther the distance from the center pixel is, the smaller the effect on the center pixel is, and the closer the distance from the center pixel is, the greater the effect on the center pixel is.

이때, 영상 초점 연산 장치(100)는 해당 픽셀에 대하여, 영상 윈도우 내의 다른 픽셀과의 거리에 따라 가중치를 적용할 수 있다. 일례로, 영상 초점 연산 장치(100)는 상기의 수학식 3에 따라 초점값(ML)에 가중치를 할당할 수 있다.In this case, the image focus operation apparatus 100 may apply a weight to the corresponding pixel according to a distance from another pixel in the image window. For example, the image focus operation apparatus 100 may assign a weight to the focus value ML according to Equation 3 above.

여기서, 가중치 적용된 초점값(AWML)은 해당 픽셀(x,y)을 중심으로 하는 영상 윈도우 내에서 가중치가 적용된 모든 픽셀의 합으로 나타낼 수 있다. 이때, 해당 픽셀(x,y)을 중심으로 하는 영상 윈도우 내에서 해당 픽셀 사이의 거리에 따라 각 픽셀의 가중치가 결정될 수 있다.Here, the weighted focus value AWML may be expressed as the sum of all pixels to which the weight is applied in the image window centered on the corresponding pixel (x,y). In this case, the weight of each pixel may be determined according to the distance between the corresponding pixels in the image window centered on the corresponding pixel (x, y).

이에 의해, 본 발명의 일 실시예에 따른 영상 초점 연산 방법(200)은 별도의 노이즈 제거 처리를 하지 않은 경우에도, 영상 노이즈에 강건하고 영상 초점 연산 정확도를 향상시킬 수 있다. Accordingly, the image focus operation method 200 according to an embodiment of the present invention can be robust to image noise and improve image focus operation accuracy even when a separate noise removal process is not performed.

다음으로, 영상 초점 연산 장치(100)는 대상 영상의 각 픽셀에 대하여 영상 윈도우 내에서 가중치 적용된 초점값(AWML)의 노이즈를 제거한다(단계 S240). 이때, 영상 초점 연산 장치(100)는 대상 영상의 각 픽셀에 대하여 영상 윈도우 내에서 가중치 적용된 초점값(AWML)들을 합산할 수 있다.Next, the image focus operation apparatus 100 removes the noise of the weighted focus value AWML in the image window with respect to each pixel of the target image (step S240 ). In this case, the image focus operation apparatus 100 may sum the weighted focus values AWML for each pixel of the target image within the image window.

일례로, 영상 초점 연산 장치(100)는 상기의 수학식 4에 따라 가중치 적용된 초점값(AWML)의 노이즈를 제거할 수 있다. 따라서 영상 초점 연산 장치(100)는 최종적으로 노이즈 제거된 초점값(ASWML)을 산출할 수 있다.For example, the image focus operation apparatus 100 may remove noise from the focus value AWML to which a weight is applied according to Equation 4 above. Accordingly, the image focus operation apparatus 100 may finally calculate the noise-removed focus value ASWML.

이에 의해, 본 발명의 일 실시예에 따른 영상 초점 연산 방법(200)은 영상 초점을 정확하게 연산할 수 있으므로 영상 노이즈에 강건하고 영상 초점 연산 정확도를 향상시킬 수 있다. Accordingly, since the image focus calculation method 200 according to an embodiment of the present invention can accurately calculate the image focus, it is robust to image noise and improves the image focus operation accuracy.

도 6은 도 5의 윈도우 크기 설정 절차의 순서도이다. 6 is a flowchart of a window size setting procedure of FIG. 5 .

윈도우 크기 설정 절차(210)는 초기 영상 윈도우 크기 설정 단계(S211 및 S212), 및 영상 윈도우의 분산차 비교에 따라 영상 윈도우의 크기를 결정하는 단계(S213 내지 S216)를 포함할 수 있다.The window size setting procedure 210 may include initial image window size setting steps ( S211 and S212 ) and determining the image window size according to the comparison of variance difference between the image windows ( S213 to S216 ).

보다 상세히 설명하면, 도 6에 도시된 바와 같이, 먼저, 영상 초점 연산 장치(100)는 초기 영상 윈도우의 크기를 일정한 크기로 설정한다(단계 S211). 일례로, 영상 초점 연산 장치(100)는 초기 영상 윈도우의 크기(Wn)를 15로 설정할 수 있다. 즉, 초기 영상 윈도우는 15×15의 크기로 구성될 수 있다.In more detail, as shown in FIG. 6 , first, the image focus operation apparatus 100 sets the size of the initial image window to a constant size (step S211). For example, the image focus operation apparatus 100 may set the size Wn of the initial image window to 15. That is, the initial image window may have a size of 15×15.

다음으로, 영상 초점 연산 장치(100)는 영상 윈도우 크기가 감소된 다음 영상 윈도우를 설정한다(단계 S212). 일례로, 영상 초점 연산 장치(100)는 윈도우의 크기를 1 감소시켜 다음 영상 윈도우의 크기(Wn)를 14로 설정할 수 있다.Next, the image focus operation apparatus 100 sets the image window after the image window size is reduced (step S212). For example, the image focus operation apparatus 100 may decrease the size of the window by 1 and set the size Wn of the next image window to 14.

다음으로, 영상 초점 연산 장치(100)는 초기 영상 윈도우와 다음 영상 윈도우의 밝기의 분산차가 임계값(T) 이하인지를 판단한다(단계 S213). 여기서, 밝기 분산차는 영상 윈도우 내의 그레이 레벨 영상 밝기의 분산을 의미한다. Next, the image focus operation device 100 determines whether a difference in brightness between the initial image window and the next image window is equal to or less than a threshold value T (step S213 ). Here, the brightness dispersion difference means the dispersion of the gray level image brightness within the image window.

일례로, 영상 초점 연산 장치(100)는 상기의 수학식 1에 따라 초기 영상 윈도우와 다음 영상 윈도우를 비교할 수 있다. 즉, 영상 초점 연산 장치(100)는 초기 영상 윈도우와 다음 영상 윈도우에 대한 그레이 레벨 영상 밝기의 분산차의 절대값이 임계값(T)을 초과하는지를 비교할 수 있다. For example, the image focus operation apparatus 100 may compare the initial image window and the next image window according to Equation 1 above. That is, the image focus operation apparatus 100 may compare whether the absolute value of the variance difference between the gray level image brightness for the initial image window and the next image window exceeds the threshold value T.

단계 S213의 판단결과, 초기 영상 윈도우와 다음 영상 윈도우에 대한 그레이 레벨 영상 밝기의 분산차의 절대값이 임계값(T)보다 크면, 영상 초점 연산 장치(100)는 단계 S212로 복귀할 수 있다.If it is determined in step S213 that the absolute value of the variance difference between the gray level image brightness for the initial image window and the next image window is greater than the threshold value T, the image focus operation apparatus 100 may return to step S212 .

이때, 영상 초점 연산 장치(100)는 초기 영상 윈도우의 크기(Wi)를 그대로 유지한 상태에서 다음 영상 윈도우의 크기(Wn)를 1만큼 감소시킬 수 있다. 일례로, 영상 초점 연산 장치(100)는 단계 S212 내지 단계 S213을 반복하여 15인 초기 영상 윈도우와 크기 13인 다음 영상 윈도우의 분사값을 비교할 수 있다.In this case, the image focus operation apparatus 100 may decrease the size Wn of the next image window by 1 while maintaining the size Wi of the initial image window as it is. For example, the image focus operation apparatus 100 may repeat steps S212 to S213 to compare the injection values of the initial image window of 15 and the next image window of size 13.

단계 S213의 판단결과, 초기 영상 윈도우와 다음 영상 윈도우에 대한 그레이 레벨 영상 밝기의 분산차의 절대값이 임계값(T) 이하이면, 영상 초점 연산 장치(100)는 초기 영상 윈도우의 크기(Wi)를 1만큼 감소시킨다(단계 S214). 일례로, 영상 초점 연산 장치(100)는 초기 영상 윈도우의 크기(Wi)를 14로 설정할 수 있다.As a result of the determination in step S213, if the absolute value of the variance difference between the gray level image brightness for the initial image window and the next image window is less than or equal to the threshold value T, the image focusing apparatus 100 determines the size of the initial image window (Wi) is decreased by 1 (step S214). As an example, the image focus operation apparatus 100 may set the size Wi of the initial image window to 14.

다음으로, 영상 초점 연산 장치(100)는 모든 영상 윈도우의 크기에 대한 확인이 완료되었는지를 판단하여(단계 S215), 모든 영상 윈도우의 크기에 대한 확인이 완료되지 않았으면, 단계 S212로 복귀할 수 있다.Next, the image focus operation device 100 determines whether the size of all image windows has been checked (step S215). have.

이때, 영상 초점 연산 장치(100)는 단계 S212 내지 단계 S213을 반복하여 다음 영상 윈도우의 크기(Wn)를 1만큼 감소시켜 다시 초기 영상 윈도우와 비교할 수 있다. 일례로, 영상 초점 연산 장치(100)는 크기 14인 초기 영상 윈도우와 크기 13인 다음 영상 윈도우를 비교할 수 있다.In this case, the image focus operation apparatus 100 may repeat steps S212 to S213 to decrease the size Wn of the next image window by 1 and compare it with the initial image window again. For example, the image focus operation apparatus 100 may compare an initial image window having a size of 14 with a next image window having a size of 13 .

단계 S215의 판단결과, 모든 영상 윈도우의 크기에 대한 확인이 완료되었으면, 영상 초점 연산 장치(100)는 현재의 초기 영상 윈도우의 크기를 최종적으로 초점 연산을 위한 영상 윈도우의 크기로 결정한다(단계 S216). As a result of the determination in step S215, if the size of all image windows is checked, the image focus operation device 100 finally determines the size of the current initial image window as the size of the image window for focus operation (step S216). ).

이와 같이, 영상 초점 연산 장치(100)는 영상 윈도우 내의 그레이 레벨 영상 밝기의 분산값이 변하지 않을 때까지 영상 윈도우의 크기를 줄이고, 해당하는 윈도우의 크기를 초점 연산을 위한 영상 윈도우의 크기로 선택할 수 있다.As such, the image focus operation device 100 reduces the size of the image window until the variance value of the gray level image brightness within the image window does not change, and selects the size of the corresponding window as the size of the image window for focus operation. have.

일례로, 영상 초점 연산 장치(100)는 다음 영상 윈도우의 크기(Wn)가 1일 때까지 초기 영상 윈도우와 다음 영상 윈도우를 크기 변경하면서 분산값을 비교할 수 있다. 여기서, 영상 초점 연산 장치(100)는 최종적인 초기 영상 윈도우의 크기(Wi)를 초점 연산을 위한 영상 윈도우의 크기로 선택할 수 있다.For example, the image focus operation apparatus 100 may compare the variance values while changing the sizes of the initial image window and the next image window until the size Wn of the next image window is 1. Here, the image focus operation apparatus 100 may select the size Wi of the final initial image window as the image window size for the focus operation.

이에 의해, 본 발명의 일 실시예에 따른 영상 초점 방법(200)은 대상 영상에서 텍스처가 없는 영역에서도 최적의 영상 초점을 획득할 수 있으면서도 대상 영상을 3차원 형상을 복원할 때 블러링을 유발하지 않도록 영상 윈도우를 적합한 크기로 설정할 수 있다.Accordingly, the image focusing method 200 according to an embodiment of the present invention can obtain an optimal image focus even in an area without a texture in the target image, and does not cause blurring when reconstructing a three-dimensional shape of the target image. You can set the video window to a suitable size to avoid it.

상기와 같은 방법들은 도 1에 도시된 바와 같은 영상 초점 연산 장치(100)에 의해 구현될 수 있고, 특히, 이러한 단계들을 수행하는 소프트웨어 프로그램으로 구현될 수 있으며, 이 경우, 이러한 프로그램들은 컴퓨터 판독가능한 기록 매체에 저장되거나 전송 매체 또는 통신망에서 반송파와 결합된 컴퓨터 데이터 신호에 의하여 전송될 수 있다. 이때, 컴퓨터 판독가능한 기록 매체는 컴퓨터 시스템에 의해 판독가능한 데이터가 저장되는 모든 종류의 기록 장치를 포함할 수 있다. 예를 들면, ROM, RAM, CD-ROM, DVD-ROM, DVD-RAM, 자기 테이프, 플로피 디스크, 하드 디스크, 광 데이터 저장장치 등일 수 있다.The above methods may be implemented by the image focus computing device 100 as shown in FIG. 1 , and in particular, may be implemented as a software program for performing these steps, in this case, these programs are computer-readable It may be stored in a recording medium or transmitted by a computer data signal combined with a carrier wave in a transmission medium or a communication network. In this case, the computer-readable recording medium may include any type of recording device in which data readable by a computer system is stored. For example, it may be a ROM, RAM, CD-ROM, DVD-ROM, DVD-RAM, magnetic tape, floppy disk, hard disk, optical data storage device, and the like.

이상에서 본 발명의 일 실시예에 대하여 설명하였으나, 본 발명의 사상은 본 명세서에 제시되는 실시예에 제한되지 아니하며, 본 발명의 사상을 이해하는 당업자는 동일한 사상의 범위 내에서, 구성요소의 부가, 변경, 삭제, 추가 등에 의해서 다른 실시예를 용이하게 제안할 수 있을 것이나, 이 또한 본 발명의 사상범위 내에 든다고 할 것이다.Although one embodiment of the present invention has been described above, the spirit of the present invention is not limited to the embodiments presented herein, and those skilled in the art who understand the spirit of the present invention can add components within the scope of the same spirit. , changes, deletions, additions, etc. will be able to easily suggest other embodiments, but this will also fall within the scope of the present invention.

100 : 영상 초점 연산 장치 110 : 카메라
120 : 제어부 122 : 윈도우 설정부
124 : 초점값 연산부 126 : 가중치 할당부
128 : 노이즈 제거부 130 : 메모리
100: image focus operation device 110: camera
120: control unit 122: window setting unit
124: focus value calculating unit 126: weight allocating unit
128: noise removing unit 130: memory

Claims (18)

카메라에서 획득된 초점 연산 대상 영상을 저장하는 메모리; 및
상기 메모리에 저장된 영상에 대한 초점값을 연산하는 제어부를 포함하고,
상기 제어부는,
상기 초점 연산 대상 영상에 대한 초점 연산을 위한 영상 윈도우의 크기를 설정하며,
상기 대상 영상의 각 픽셀에 대하여, 상기 영상 윈도우 내에서 초점값을 연산하고,
상기 대상 영상의 각 픽셀에 대하여, 상기 영상 윈도우 내에서 상기 연산된 초점값에 대한 가중치를 할당하는 영상 초점 연산 장치.
a memory for storing a focus operation target image acquired by the camera; and
A control unit for calculating a focus value for the image stored in the memory,
The control unit is
Setting the size of the image window for focus operation on the focus operation target image,
For each pixel of the target image, a focus value is calculated within the image window;
An image focus calculation apparatus for allocating a weight to the calculated focus value within the image window, to each pixel of the target image.
제1항에 있어서,
상기 제어부는 상기 대상 영상의 각 픽셀에 대하여 상기 영상 윈도우 내에서 상기 가중치 적용된 초점값의 노이즈를 제거하는 영상 초점 연산 장치.
According to claim 1,
The control unit is configured to remove noise of the weighted focus value within the image window with respect to each pixel of the target image.
제2항에 있어서,
상기 제어부는 상기 대상 영상의 각 픽셀에 대하여 상기 영상 윈도우 내에서 상기 가중치 적용된 초점값들을 합산하는 영상 초점 연산 장치.
3. The method of claim 2,
The control unit is an image focus operation device for summing the weighted focus values in the image window with respect to each pixel of the target image.
제1항에 있어서,
상기 제어부는 상기 영상 윈도우의 크기를 감소시키면서, 각 영상 윈도우에 대한 밝기의 분산차가 가장 작은 경우의 영상 윈도우의 크기를 상기 초점 연산을 위한 영상 윈도우의 크기로 결정하는 영상 초점 연산 장치.
According to claim 1,
The control unit decreases the size of the image window and determines the size of the image window when the variance difference of brightness for each image window is smallest as the size of the image window for the focus operation.
제1항에 있어서,
상기 제어부는 해당 픽셀에 대하여, 상기 영상 윈도우 내의 다른 픽셀과의 거리에 따라 가중치를 적용하는 영상 초점 연산 장치.
According to claim 1,
The control unit applies a weight to the corresponding pixel according to a distance from another pixel in the image window.
제1항에 있어서,
상기 제어부는 상기 대상 영상을 그레이 레벨 영상으로 변환하는 영상 초점 연산 장치.
According to claim 1,
The control unit converts the target image into a gray level image.
제1항에 있어서,
상기 제어부는 하기의 수학식에 따라 상기 초점값을 연산하는 영상 초점 연산 장치.
Figure pat00014

여기서, ML(x,y)는 해당 픽셀 (x,y)에 대한 초점값,
I(x,y)는 해당 픽셀 (x,y)에서 그레이 레벨 밝기
According to claim 1,
The control unit is an image focus calculation device for calculating the focus value according to the following equation.
Figure pat00014

Here, ML(x,y) is the focal value of the corresponding pixel (x,y),
I(x,y) is the gray level brightness at that pixel (x,y)
제7항에 있어서,
상기 제어부는 하기의 수학식에 따라 가중치를 할당하는 영상 초점 연산 장치.
Figure pat00015

여기서, AWML(x,y)는 해당 픽셀 (x,y)에 대한 가중치 적용 초점값,
Figure pat00016
는 상기 설정된 영상 윈도우의 크기
8. The method of claim 7,
The control unit allocates weights according to the following equation.
Figure pat00015

Here, AWML(x,y) is the weighted focus value for the pixel (x,y),
Figure pat00016
is the size of the set image window
제8항에 있어서,
상기 제어부는 하기의 수학식에 따라 노이즈를 제거하는 영상 초점 연산 장치.
Figure pat00017

여기서, ASWML(x,y)는 해당 픽셀(x,y)에 대한 노이즈 제거된 초점값
9. The method of claim 8,
The control unit is an image focus operation device for removing noise according to the following equation.
Figure pat00017

Here, ASWML(x,y) is the denoised focus value for the corresponding pixel (x,y)
초점 연산 대상 영상에 대한 초점 연산을 위한 영상 윈도우의 크기를 설정하는 단계;
상기 대상 영상의 각 픽셀에 대하여, 상기 영상 윈도우 내에서 초점값을 연산하는 단계; 및
상기 대상 영상의 각 픽셀에 대하여, 상기 영상 윈도우 내에서 상기 연산된 초점값에 대한 가중치를 할당하는 단계;를 포함하는 영상 초점 연산 방법.
setting a size of an image window for focus operation on a focus operation target image;
calculating a focus value within the image window for each pixel of the target image; and
and assigning a weight to the calculated focus value within the image window to each pixel of the target image.
제10항에 있어서,
상기 대상 영상의 각 픽셀에 대하여 상기 영상 윈도우 내에서 상기 가중치 적용된 초점값의 노이즈를 제거하는 단계를 더 포함하는 영상 초점 연산 방법.
11. The method of claim 10,
The image focus operation method further comprising removing noise of the weighted focus value within the image window with respect to each pixel of the target image.
제11항에 있어서,
상기 노이즈를 제거하는 단계는 상기 대상 영상의 각 픽셀에 대하여 상기 영상 윈도우 내에서 상기 가중치 적용된 초점값들을 합산하는 영상 초점 연산 방법.
12. The method of claim 11,
The removing of the noise is an image focus calculation method of summing the weighted focus values within the image window with respect to each pixel of the target image.
제10항에 있어서,
상기 영상 윈도우의 크기를 설정하는 단계는 상기 영상 윈도우의 크기를 감소시키면서, 각 영상 윈도우에 대한 밝기의 분산차가 가장 작은 경우의 영상 윈도우의 크기를 상기 초점 연산을 위한 영상 윈도우의 크기로 결정하는 영상 초점 연산 방법.
11. The method of claim 10,
In the step of setting the size of the image window, the size of the image window is determined as the size of the image window for the focus operation when the size of the image window is reduced, and the difference in variance of brightness for each image window is smallest. How to calculate focus.
제10항에 있어서,
상기 가중치를 할당하는 단계는 해당 픽셀에 대하여, 상기 영상 윈도우 내의 다른 픽셀과의 거리에 따라 가중치를 적용하는 영상 초점 연산 방법.
11. The method of claim 10,
The assigning of the weight is an image focus calculation method of applying a weight to a corresponding pixel according to a distance from another pixel in the image window.
제10항에 있어서,
상기 대상 영상을 그레이 레벨 영상으로 변환하는 단계를 더 포함하는 영상 초점 연산 방법.
11. The method of claim 10,
Image focus calculation method further comprising the step of converting the target image to a gray level image.
제11항에 있어서,
상기 초점값을 연산하는 단계는 하기의 수학식에 따라 상기 초점값을 연산하는 영상 초점 연산 방법.
Figure pat00018

여기서, ML(x,y)는 해당 픽셀 (x, y)에 대한 초점값,
I(x,y)는 해당 픽셀 (x, y)에서 그레이 레벨 밝기
12. The method of claim 11,
The calculating of the focus value is an image focus calculation method of calculating the focus value according to the following equation.
Figure pat00018

Here, ML(x,y) is the focal value of the corresponding pixel (x, y),
I(x,y) is the gray level brightness at that pixel (x,y)
제16항에 있어서,
상기 가중치를 할당하는 단계는 하기의 수학식에 가중치를 할당하는 영상 초점 연산 방법.
Figure pat00019

여기서, AWML(x,y)는 해당 픽셀 (x,y)에 대한 가중치 적용된 초점값,
Figure pat00020
는 상기 설정된 영상 윈도우의 크기
17. The method of claim 16,
The step of allocating the weight is an image focus calculation method of allocating a weight to the following equation.
Figure pat00019

Here, AWML(x,y) is the weighted focus value for the corresponding pixel (x,y),
Figure pat00020
is the size of the set image window
제17항에 있어서,
상기 노이즈를 제거하는 단계는 하기의 수학식에 따라 노이즈를 제거하는 영상 초점 연산 방법.
Figure pat00021

여기서, ASWML(x,y)는 해당 픽셀(x,y)에 대한 노이즈 제거된 초점값
18. The method of claim 17,
The step of removing the noise is an image focus calculation method of removing the noise according to the following equation.
Figure pat00021

Here, ASWML(x,y) is the denoised focus value for the corresponding pixel (x,y)
KR1020200157609A 2020-11-23 2020-11-23 Device for calculating focus of image and method thereof KR20220070735A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200157609A KR20220070735A (en) 2020-11-23 2020-11-23 Device for calculating focus of image and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200157609A KR20220070735A (en) 2020-11-23 2020-11-23 Device for calculating focus of image and method thereof

Publications (1)

Publication Number Publication Date
KR20220070735A true KR20220070735A (en) 2022-05-31

Family

ID=81780868

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200157609A KR20220070735A (en) 2020-11-23 2020-11-23 Device for calculating focus of image and method thereof

Country Status (1)

Country Link
KR (1) KR20220070735A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070050320A (en) 2005-11-10 2007-05-15 광주과학기술원 Method for 3-d shape recovery using 3-d focus measure operator

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070050320A (en) 2005-11-10 2007-05-15 광주과학기술원 Method for 3-d shape recovery using 3-d focus measure operator

Similar Documents

Publication Publication Date Title
US11475653B2 (en) Perceptual importance maps for image processing
JP6469678B2 (en) System and method for correcting image artifacts
US8279930B2 (en) Image processing apparatus and method, program, and recording medium
KR101143218B1 (en) Color segmentation-based stereo 3d reconstruction system and process
US8131109B2 (en) Image processing method and apparatus for contrast enhancement using intensity mapping
CN110176010B (en) Image detection method, device, equipment and storage medium
KR101364860B1 (en) Method for transforming stereoscopic images for improvement of stereoscopic images and medium recording the same
CN113781406B (en) Scratch detection method and device for electronic component and computer equipment
CN117408890B (en) Video image transmission quality enhancement method and system
KR20110086826A (en) Method, apparatus and software for determining motion vectors
US9280846B2 (en) Method, apparatus, and computer-readable recording medium for depth warping based occlusion culling
CN112464829B (en) Pupil positioning method, pupil positioning equipment, storage medium and sight tracking system
KR102491674B1 (en) Method and apparatus for generating virtual viewpoint image
KR101865826B1 (en) Intra Prediction Coding Method and Device for Depth Image
CN113052754A (en) Method and device for blurring picture background
CN113888509A (en) Method, device and equipment for evaluating image definition and storage medium
KR20220070735A (en) Device for calculating focus of image and method thereof
KR20100064808A (en) Apparatus and method for enhancing image based on luminance information of pixel
US10554947B1 (en) Method and apparatus for stereo vision matching including disparity refinement based on matching merit values
Grundland et al. Automatic contrast enhancement by histogram warping
CN110136085B (en) Image noise reduction method and device
CN111652821A (en) Low-light-level video image noise reduction processing method, device and equipment based on gradient information
CN116563172A (en) VR globalization online education interaction optimization enhancement method and device
CN111161211B (en) Image detection method and device
CN116416290A (en) Method and device for calculating speckle structure light depth and electronic equipment