[go: up one dir, main page]

KR102386982B1 - Method and apparatus for camera calibration using image analysis - Google Patents

Method and apparatus for camera calibration using image analysis Download PDF

Info

Publication number
KR102386982B1
KR102386982B1 KR1020160064723A KR20160064723A KR102386982B1 KR 102386982 B1 KR102386982 B1 KR 102386982B1 KR 1020160064723 A KR1020160064723 A KR 1020160064723A KR 20160064723 A KR20160064723 A KR 20160064723A KR 102386982 B1 KR102386982 B1 KR 102386982B1
Authority
KR
South Korea
Prior art keywords
image
camera calibration
calibration
camera
image analysis
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
KR1020160064723A
Other languages
Korean (ko)
Other versions
KR20170133666A (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 KR1020160064723A priority Critical patent/KR102386982B1/en
Publication of KR20170133666A publication Critical patent/KR20170133666A/en
Application granted granted Critical
Publication of KR102386982B1 publication Critical patent/KR102386982B1/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/20Image signal generators
    • H04N13/204Image signal generators using stereoscopic image cameras
    • H04N13/246Calibration of cameras
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • G06T7/85Stereo camera calibration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N13/10Processing, recording or transmission of stereoscopic or multi-view image signals
    • H04N13/106Processing image signals
    • H04N13/122Improving the 3D impression of stereoscopic images by modifying image signal contents, e.g. by filtering or adding monoscopic depth cues
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • H04N5/23212
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N13/00Stereoscopic video systems; Multi-view video systems; Details thereof
    • H04N2013/0074Stereoscopic image analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)
  • Closed-Circuit Television Systems (AREA)

Abstract

영상 분석을 이용한 카메라 캘리브레이션 방법은, 캘리브레이션 장치가, 영상을 수신하는 단계와 상기 캘리브레이션 장치가, 상기 영상에서 하나 이상의 객체를 추출하는 단계와 상기 캘리브레이션 장치가, 상기 하나 이상의 객체 중에서 기준 물체로 사용할 객체를 선정하는 단계와 상기 캘리브레이션 장치가, 상기 기준 물체로 사용할 객체의 이미지와 매칭되는 이미지를 검색하는 단계 및 상기 캘리브레이션 장치가, 상기 검색된 이미지에 대응되는 크기 정보를 이용하여 카메라 캘리브레이션을 수행하는 단계를 포함할 수 있다.A camera calibration method using image analysis includes the steps of: receiving, by a calibration apparatus, an image; extracting, by the calibration apparatus, one or more objects from the image; selecting, by the calibration device, searching for an image matching an image of an object to be used as the reference object, and performing, by the calibration device, camera calibration using size information corresponding to the searched image may include

Description

영상 분석을 이용한 카메라 캘리브레이션 방법 및 그 장치 {Method and apparatus for camera calibration using image analysis}Camera calibration method and apparatus using image analysis {Method and apparatus for camera calibration using image analysis}

본 발명은 영상 분석을 이용하여, 카메라의 캘리브레이션(calibration)을 자동으로 수행하는 방법 및 그 장치에 관한 것이다. 보다 자세하게는 카메라가 촬영한 또는 촬영 중인 영상을 분석하여 상기 영상에서 객체를 추출하고, 추출된 객체의 정보를 이용하여 카메라 캘리브레이션을 자동으로 수행하는 방법 및 그 방법을 수행하는 장치에 관한 것이다.The present invention relates to a method and apparatus for automatically performing camera calibration using image analysis. More particularly, it relates to a method of extracting an object from the image by analyzing an image captured or being photographed by a camera, and automatically performing camera calibration using information on the extracted object, and an apparatus for performing the method.

영상 분석에서 카메라 캘리브레이션이란, 영상에서 검출된 객체의 실제 크기 정보를 얻기 위한 변환 매트릭스를 연산하는 과정을 말한다. 실제의 객체는 3차원 공간상에 존재하나, 영상에서의 객체는 2차원 화면 속에 존재하기 때문에, 자연스레 왜곡이 발생하게 된다. 즉 화면상에서 가까운 객체는 크게 보이고, 먼 객체는 작게 보이는 왜곡이다.In image analysis, camera calibration refers to a process of calculating a transformation matrix to obtain information on the actual size of an object detected in an image. Although an actual object exists in a three-dimensional space, an object in an image exists in a two-dimensional screen, so distortion naturally occurs. In other words, on the screen, near objects appear larger, and distant objects appear smaller on the screen.

이러한 왜곡을 보정하여 화면상에서 작게 표시되었더라도, 작게 표시된 객체의 실제 크기 정보, 즉 3차원 공간상의 가로와 세로 및 높이를 구할 수 있다면, 영상 분석을 통해서 많은 정보를 얻을 수 있다. 이를 위해서는 영상의 2D 좌표를 실제의 3D 좌표로 변환할 수 있는 변환 매트릭스가 필요하다. 즉 영상의 (x, y)의 좌표를 실제의 (X, Y, Z)로 변환할 수 있는 변환 매트릭스가 필요하다.Even if the distortion is corrected and displayed small on the screen, if information on the actual size of the small displayed object, that is, the width, length, and height in three-dimensional space, can be obtained, a lot of information can be obtained through image analysis. For this, a transformation matrix capable of converting 2D coordinates of an image into actual 3D coordinates is required. That is, a transformation matrix that can transform the (x, y) coordinates of the image into the actual (X, Y, Z) is required.

종래에는 이러한 변환 매트릭스를 구하기 위해 가로 및 세로를 이미 알고 있는 기준 물체를 카메라로 촬영하고, 영상 속에서 기준 물체의 좌표를 분석하여 카메라 캘리브레이션을 수행하였다. 그 과정에서 캘리브레이션 프로그램의 도움이 있기는 하지만, 기준 물체를 촬영하고자 하는 곳에 위치시키고 기준 물체의 좌표를 설정하는 등의 수작업이 완전히 없어진 것은 아니었다.Conventionally, in order to obtain such a transformation matrix, a reference object whose width and length are already known was photographed with a camera, and the coordinates of the reference object were analyzed in the image to perform camera calibration. Although the calibration program helped in the process, manual work such as positioning the reference object at the desired location and setting the coordinates of the reference object was not completely eliminated.

예를 들면 전자부품연구원의 KR 1545633 B1 "차량용 스테레오 카메라 캘리브레이션 방법 및 시스템" 발명을 살펴보면, 차량용 스테레오 카메라의 캘리브레이션을 수행하기 위해 차량의 보닛에 착탈 가능한 캘리브레이션 마커를 사용하는 것을 볼 수 있다. 이처럼 종래에는 캘리브레이션을 수행할 때마다 캘리브레이션 마커를 수작업으로 설치해야 하는 등, 시간과 비용이 소모되는 단계가 있었다.For example, looking at the invention of KR 1545633 B1 "Vehicle Stereo Camera Calibration Method and System" of the Korea Electronics Research Institute, it can be seen that a calibration marker detachable from the bonnet of the vehicle is used to perform the calibration of the vehicle stereo camera. As such, in the prior art, there was a step that consumes time and money, such as having to manually install a calibration marker every time calibration is performed.

만약 사용하려는 카메라가 PTZ 기능(Pan, Tilt, Zoom)이 있는 카메라인 경우, PTZ 동작 후에는 매번 카메라 캘리브레이션을 수행해야 영상을 분석하여 객체의 정보를 얻을 수 있다. 또한 PTZ 기능이 있는 카메라가 아니더라도 외부 요인에 의해 카메라의 위치가 틀어지는 경우, 그 때마다 수작업으로 카메라 캘리브레이션을 수행해야 하는 불편이 있었다.If the camera you want to use is a camera with PTZ function (Pan, Tilt, Zoom), you need to calibrate the camera every time after PTZ operation to analyze the image to obtain object information. In addition, even if the camera does not have a PTZ function, if the position of the camera is shifted due to external factors, it is inconvenient to manually calibrate the camera each time.

이에 사람의 수작업이 없이도 카메라의 캘리브레이션을 자동으로 수행할 수 있는 방법이 요구된다.Accordingly, there is a need for a method capable of automatically performing camera calibration without human manual intervention.

본 발명이 해결하고자 하는 기술적 과제는 영상 분석을 이용하여 카메라 캘리브레이션을 자동으로 수행하는 방법 및 그 장치를 제공하는 것이다.The technical problem to be solved by the present invention is to provide a method and an apparatus for automatically performing camera calibration using image analysis.

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

상기 기술적 과제를 해결하기 위한 본 발명의 일 태양에 따른 영상 분석을 이용한 카메라 캘리브레이션 방법은, 캘리브레이션 장치가, 영상을 수신하는 단계와 상기 캘리브레이션 장치가, 상기 영상에서 하나 이상의 객체를 추출하는 단계와 상기 캘리브레이션 장치가, 상기 하나 이상의 객체 중에서 기준 물체로 사용할 객체를 선정하는 단계와 상기 캘리브레이션 장치가, 상기 기준 물체로 사용할 객체의 이미지와 매칭되는 이미지를 검색하는 단계 및 상기 캘리브레이션 장치가, 상기 검색된 이미지에 대응되는 크기 정보를 이용하여 카메라 캘리브레이션을 수행하는 단계를 포함할 수 있다.In a camera calibration method using image analysis according to an aspect of the present invention for solving the above technical problem, the calibration apparatus receives an image, the calibration apparatus extracts one or more objects from the image, selecting, by a calibration device, an object to be used as a reference object from among the one or more objects; searching, by the calibration device, for an image matching an image of an object to be used as the reference object; and, by the calibration device, to the searched image The method may include performing camera calibration using the corresponding size information.

일 실시예에서, 상기 영상을 수신하는 단계는, 실시간 스트리밍 영상 또는 녹화 저장된 영상 중에 하나를 수신하는 단계를 포함할 수 있다.In an embodiment, the receiving of the image may include receiving one of a real-time streaming image or a recorded and stored image.

다른 실시예에서, 상기 영상에서 하나 이상의 객체를 추출하는 단계는, 상기 영상에 대해 윤곽선을 검출하는 알고리즘을 수행하여 객체의 윤곽선을 검출하는 단계를 포함할 수 있다.In another embodiment, the extracting of the one or more objects from the image may include detecting the outline of the object by performing an algorithm for detecting the outline on the image.

또 다른 실시예에서, 상기 기준 물체로 사용할 객체를 선정하는 단계는, 추출된 각 객체를 대상으로 객체의 면적을 연산하고 상기 면적을 점수화(scoring)하여 기준 물체로 사용할 객체를 선정하는 단계를 포함할 수 있다.In another embodiment, the selecting of the object to be used as the reference object includes calculating an area of the object for each extracted object and selecting an object to be used as a reference object by scoring the area can do.

또 다른 실시예에서, 상기 기준 물체로 사용할 객체를 선정하는 단계는, 추출된 각 객체를 대상으로 추출 영역의 면적에 대한 객체의 면적의 비율을 연산하고, 상기 비율을 점수화(scoring)하여 기준 물체로 사용할 객체를 선정하는 단계를 포함할 수 있다.In another embodiment, the selecting of the object to be used as the reference object includes calculating a ratio of the area of the object to the area of the extraction area for each extracted object, and scoring the ratio to determine the reference object It may include the step of selecting an object to be used as

또 다른 실시예에서, 상기 이미지를 검색하는 단계는, 웹 크롤링을 이용하여 특정 객체의 이미지와 상기 특정 객체의 크기 정보를 대응시켜 데이터베이스에 저장하는 단계를 포함할 수 있다.In another embodiment, the step of searching for the image may include storing the image of a specific object and size information of the specific object by using web crawling to correspond to each other in a database.

또 다른 실시예에서, 카메라 캘리브레이션을 수행한 후, 기준 물체로 사용한 객체를 추적하는 단계 및 상기 영상의 다른 프레임에서 카메라 캘리브레이션이 필요한 경우, 상기 추적한 기준 물체의 크기 정보를 이용하여 카메라 캘리브레이션을 다시 수행하는 단계를 포함할 수 있다.In another embodiment, after performing camera calibration, tracking an object used as a reference object and when camera calibration is required in another frame of the image, re-calibrate the camera using the size information of the tracked reference object It may include performing steps.

상기 기술적 과제를 해결하기 위한 본 발명의 일 태양에 따른 영상 분석을 이용한 카메라 캘리브레이션 방법은, 캘리브레이션 장치가, 사람을 촬영한 영상을 수신하는 단계와 상기 캘리브레이션 장치가, 상기 영상에서 사람을 추출하는 단계와 상기 캘리브레이션 장치가, 상기 추출된 사람의 얼굴을 인식하여 신원을 확인하는 단계 및 상기 캘리브레이션 장치가, 상기 신원이 확인된 사람의 키 정보를 이용하여 카메라 캘리브레이션을 수행하는 단계를 포함할 수 있다.A camera calibration method using image analysis according to an aspect of the present invention for solving the above technical problem includes the steps of: receiving, by a calibration apparatus, an image of a person; and extracting, by the calibration apparatus, a person from the image and confirming, by the calibration apparatus, the extracted face by recognizing the person's face, and performing, by the calibration apparatus, camera calibration using key information of the identified person.

본 발명의 몇몇 실시예에 따르면 영상을 분석하여 현재 촬영 중인 영상뿐만 아니라 과거에 촬영된 영상도 카메라 캘리브레이션을 수행할 수 있다. 즉 종래에는 기준 물체를 이용하여 카메라 캘리브레이션을 수행한 후에 영상을 촬영하여야만 영상 분석이 가능했는데, 본 발명에 따르면 카메라 캘리브레이션을 수행하지 않고 촬영한 영상이라고 하더라도 추후에 카메라 캘리브레이션이 가능하다.According to some embodiments of the present invention, by analyzing an image, camera calibration may be performed not only on an image currently being photographed but also on an image captured in the past. That is, conventionally, image analysis is possible only by photographing an image after performing camera calibration using a reference object. According to the present invention, even an image captured without performing camera calibration can be calibrated later.

또한 카메라 캘리브레이션을 수행할 때 사람이 반복적으로 기준 물체를 설치하고 좌표를 입력해야 하는 등의 수작업이 필요한 문제점을 개선할 수 있다. 이를 통해 카메라 캘리브레이션의 정확도를 향상시키고 과정을 효율화 할 수 있다. 뿐만 아니라 불필요한 인적 자원과 비용의 낭비를 줄일 수 있다.In addition, when performing camera calibration, it is possible to improve problems that require manual work, such as a person repeatedly installing a reference object and inputting coordinates. This can improve the accuracy of camera calibration and streamline the process. In addition, unnecessary waste of human resources and money can be reduced.

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

도 1은 카메라 캘리브레이션을 설명하기 위한 예시도이다.
도 2는 종래의 카메라 캘리브레이션 방법을 설명하기 위한 예시도이다.
도 3은 종래의 카메라 캘리브레이션 방법의 순서도이다.
도 4는 본 발명의 일 실시예에 따른 영상 분석을 이용한 카메라 캘리브레이션 장치의 하드웨어 구성도이다.
도 5a 내지 도 5f는 본 발명의 일 실시예에 따른 영상 분석을 이용한 카메라 캘리브레이션 장치의 각 구성을 설명하기 위한 예시도이다.
도 6a 내지 도 6b는 본 발명의 일 실시예에서 영상 분석을 통해 객체를 검출하는 기준을 설명하기 위한 예시도이다.
도 7은 본 발명의 일 실시예에 따른 얼굴 인식을 이용한 자동화된 카메라 캘리브레이션 방법의 순서도이다.
도 8은 본 발명의 일 실시예에 따른 제품 인식을 이용한 자동화된 카메라 캘리브레이션 방법의 순서도이다.
도 9는 본 발명의 일 실시예에 따라 자동차 블랙박스 영상에 카메라 캘리브레이션을 적용한 경우의 예시도이다.
도 9b는 본 발명의 일 실시예에 따라 객체를 추적하여 카메라 캘리브레이션을 수행하는 경우의 예시도이다.
도 10은 본 발명의 일 실시예에 따른 영상 분석을 이용한 카메라 캘리브레이션 방법의 순서도이다.
1 is an exemplary diagram for explaining camera calibration.
2 is an exemplary view for explaining a conventional camera calibration method.
3 is a flowchart of a conventional camera calibration method.
4 is a hardware configuration diagram of a camera calibration apparatus using image analysis according to an embodiment of the present invention.
5A to 5F are exemplary views for explaining each configuration of a camera calibration apparatus using image analysis according to an embodiment of the present invention.
6A to 6B are exemplary diagrams for explaining a criterion for detecting an object through image analysis in an embodiment of the present invention.
7 is a flowchart of an automated camera calibration method using face recognition according to an embodiment of the present invention.
8 is a flowchart of an automated camera calibration method using product recognition according to an embodiment of the present invention.
9 is an exemplary diagram illustrating a case in which camera calibration is applied to an image of a vehicle black box according to an embodiment of the present invention.
9B is an exemplary diagram illustrating a case of performing camera calibration by tracking an object according to an embodiment of the present invention.
10 is a flowchart of a camera calibration method using image analysis according to an embodiment of the present invention.

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

다른 정의가 없다면, 본 명세서에서 사용되는 모든 용어(기술 및 과학적 용어를 포함)는 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자에게 공통적으로 이해될 수 있는 의미로 사용될 수 있을 것이다. 또 일반적으로 사용되는 사전에 정의되어 있는 용어들은 명백하게 특별히 정의되어 있지 않는 한 이상적으로 또는 과도하게 해석되지 않는다. 본 명세서에서 사용된 용어는 실시예들을 설명하기 위한 것이며 본 발명을 제한하고자 하는 것은 아니다. 본 명세서에서, 단수형은 문구에서 특별히 언급하지 않는 한 복수형도 포함한다.Unless otherwise defined, all terms (including technical and scientific terms) used herein may be used with the meaning commonly understood by those of ordinary skill in the art to which the present invention belongs. In addition, terms defined in a commonly used dictionary are not to be interpreted ideally or excessively unless clearly defined in particular. The terminology used herein is for the purpose of describing the embodiments and is not intended to limit the present invention. In this specification, the singular also includes the plural unless specifically stated otherwise in the phrase.

명세서에서 사용되는 "포함한다 (comprises)" 및/또는 "포함하는 (comprising)"은 언급된 구성 요소, 단계, 동작 및/또는 소자는 하나 이상의 다른 구성 요소, 단계, 동작 및/또는 소자의 존재 또는 추가를 배제하지 않는다.As used herein, "comprises" and/or "comprising" refers to the presence of one or more other components, steps, operations and/or elements mentioned. or addition is not excluded.

이하, 본 발명에 대하여 첨부된 도면에 따라 보다 상세히 설명한다.Hereinafter, the present invention will be described in more detail with reference to the accompanying drawings.

도 1은 카메라 캘리브레이션을 설명하기 위한 예시도이다.1 is an exemplary diagram for explaining camera calibration.

도 1을 참고하면, 실공간(3D Real World)의 3차원 객체(131)를 카메라(210)로 촬영하는 경우, 이미지 평면(2D Image Plane)에서는 2차원으로 투영된 2차원 객체(135)로 표현되는 것을 볼 수 있다. 이렇게 2차원으로 표현되어 있음에도 불구하고, 사람이 2차원 영상을 인식할 때는 원근법으로 인해 거리감을 느낄 수 있다.Referring to FIG. 1 , when a three-dimensional object 131 in a real space is photographed with the camera 210, a two-dimensional object 135 projected in two dimensions in a 2D image plane is used. expression can be seen. In spite of being expressed in two dimensions, when a person recognizes a two-dimensional image, a sense of distance may be felt due to perspective.

문제는 3차원 객체(131)가 2차원 객체(135)로 투영되는 과정에서 왜곡이 일어나는 점이다. 이로 인해 3차원 공간상의 좌표와 2차원 공간상의 좌표에 차이게 있게 된다. 카메라 캘리브레이션이란 이러한 차이를 보정하기 위한 것으로서, 카메라 캘리브레이션을 이용하면 영상에서는 높이가 320 pixel로 측정된 2차원 객체(135)가 실공간상에서는 높이가 몇 meter인 3차원 객체(131)인지를 알 수 있다.The problem is that distortion occurs while the 3D object 131 is projected onto the 2D object 135 . As a result, there is a difference between the coordinates in the three-dimensional space and the coordinates in the two-dimensional space. Camera calibration is to compensate for such a difference. If camera calibration is used, it is possible to know how many meters in height the 3D object 131 is in the real space of the 2D object 135 measuring 320 pixels in height in the image. there is.

이처럼 카메라 캘리브레이션란 2차원으로 표현된 이미지상의 객체(135)를 실제 3차원의 공간상의 객체(131)로 복원하기 위해 내부 파라미터를 구하는 과정을 말한다. 투영된 2차원 데이터를 바탕으로 렌즈, 센서, 촬영 각도 등의 외부 요인을 제거하고 실제 크기를 측정한다. 이를 위해서 이미지에서 추출된 객체의 픽셀 정보와 실제 사물의 크기를 비교하는 과정을 통해 2차원 공간과 3차원 공간 사이의 상관 관계를 파악할 수 있다.As such, camera calibration refers to a process of obtaining internal parameters in order to restore an object 135 on a two-dimensional image to an actual object 131 on a three-dimensional space. Based on the projected two-dimensional data, external factors such as lenses, sensors, and shooting angles are removed and the actual size is measured. To this end, the correlation between the two-dimensional space and the three-dimensional space can be identified through the process of comparing the pixel information of the object extracted from the image and the size of the real object.

카메라 캘리브레이션을 수행하기 위해서 종래에는 기존에 이미 크기를 알고 있는 물체를 인위적으로 3차원 공간상에 배치하고 이를 촬영하여 카메라 캘리브레이션을 수행하였다. 종래의 카메라 캘리브레이션 방법에 대해서는 도 2 내지 도 3을 통해서 살펴보도록 한다.In order to perform camera calibration, conventionally, an object of known size is artificially placed in a three-dimensional space and photographed to perform camera calibration. A conventional camera calibration method will be described with reference to FIGS. 2 to 3 .

도 2는 종래의 카메라 캘리브레이션 방법을 설명하기 위한 예시도이다.2 is an exemplary view for explaining a conventional camera calibration method.

도 2를 참고하면 종래의 카메라 캘리브레이션 과정을 볼 수 있다. 종래에는 캘리브레이션 프로그램(120)의 입력 데이터를 얻기 위해 마커(110)을 카메라(210)로 촬영하였다. 그리고 마커(110)가 포함된 영상을 캘리브레이션 프로그램(120)에서 로딩(loading)한 후 마커(110)의 좌표를 식별하였다. 종래에는 마커(110)의 좌표를 용이하게 식별하기 위하여, 도 2에 도시된 것처럼 흑과 백이 체크 무늬로 교차하는 마커(110)를 주로 사용하였다. 또는 도 2에 도시된 마커(110) 외에도 특정 색상으로 이루어진 정사각형이나 직사각형의 패널(panel)을 기준 물체로 이용하기도 하였다.Referring to FIG. 2 , a conventional camera calibration process can be seen. Conventionally, the marker 110 was photographed with the camera 210 to obtain input data of the calibration program 120 . And after loading the image including the marker 110 in the calibration program 120, the coordinates of the marker 110 were identified. Conventionally, in order to easily identify the coordinates of the marker 110, as shown in FIG. 2, the marker 110 in which black and white intersect in a checkered pattern is mainly used. Alternatively, in addition to the marker 110 shown in FIG. 2, a square or rectangular panel made of a specific color was used as a reference object.

캘리브레이션 프로그램(120)에서는 로딩된 영상을 분석하여 마커(110) 또는 기준 물체의 각 꼭지점의 좌표를 추출한다. 실제 마커(110)나 기준 물체의 크기 정보와 영상 속에서의 좌표 정보를 비교하면 변환 매트릭스를 얻을 수 있다. 다만, 흑과 백이 체크 무늬로 교차하는 마커(110)나 특정 색상을 가지는 기준 물체를 이용하더라도 각 꼭지점의 좌표가 올바르게 추출되지 않는 경우도 많다. 이런 경우에는 도 2의 예시처럼 사람이 수작업으로 각 꼭지점의 좌표를 설정하는 과정이 추가적으로 필요하다.The calibration program 120 analyzes the loaded image and extracts the coordinates of each vertex of the marker 110 or the reference object. A transformation matrix can be obtained by comparing the size information of the actual marker 110 or the reference object with the coordinate information in the image. However, even if the marker 110 in which black and white intersect in a checkered pattern or a reference object having a specific color is used, the coordinates of each vertex are often not correctly extracted. In this case, as in the example of FIG. 2 , a process of manually setting the coordinates of each vertex by a person is additionally required.

도 2에서 살펴본 것처럼 기존의 카메라 캘리브레이션 과정에서는 1) 마커(110)나 기준 물체를 카메라(210)가 촬영 중인 공간에 설치하는 과정과, 2) 촬영된 영상을 분석하기 위한 캘리브레이션 프로그램(120)에서 마커(110)나 기준 물체의 좌표를 설정하는 과정을 사람이 직접 수행해야 했다. 그렇기 때문에 카메라(210)의 위치가 변경되면 다시 카메라 캘리브레이션을 수행하기 위해서 사람의 개입이 필요했다.As shown in FIG. 2 , in the existing camera calibration process, 1) a process of installing a marker 110 or a reference object in a space where the camera 210 is shooting, and 2) a calibration program 120 for analyzing the captured image. A person had to directly perform the process of setting the coordinates of the marker 110 or the reference object. Therefore, when the position of the camera 210 is changed, human intervention is required to perform camera calibration again.

물론 특정한 각도로 특정한 공간을 촬영하는 고정식 카메라의 경우 카메라(210)를 설치하는 과정에서 1회만 카메라 캘리브레이션을 수행하면 충분하므로 그나마 불편이 덜하다. 그러나 PTZ 카메라처럼 카메라(210)가 촬영하는 공간이 수시로 변경될 수 있는 경우에는, 그 때마다 다시 카메라 캘리브레이션을 수행하기란 불가능에 가깝다.Of course, in the case of a stationary camera that takes a picture of a specific space at a specific angle, it is sufficient to perform camera calibration only once in the process of installing the camera 210 , so it is less inconvenient. However, like a PTZ camera, if the space in which the camera 210 shoots can be changed from time to time, it is almost impossible to perform camera calibration again each time.

지금까지 도 2에서 살펴본 종래의 카메라 캘리브레이션 과정을 사용자의 개입이 필요한 단계와 캘리브레이션 프로그램(120)을 통해서 자동으로 수행되는 단계를 구분하여 순서도로 살펴보면 도 3과 같다.3 is a flowchart illustrating the conventional camera calibration process described in FIG. 2 by dividing a step requiring user intervention and a step automatically performed through the calibration program 120 as shown in FIG. 3 .

도 3은 종래의 카메라 캘리브레이션 방법의 순서도이다.3 is a flowchart of a conventional camera calibration method.

도 3에서는, 종래의 카메라 캘리브레이션 과정에서 수동으로 진행되는 단계는 좌측의 User Action 영역에, 자동으로 진행되는 단계는 우측의 Camera Calibration Program 영역에 도시하였다.In FIG. 3 , in the conventional camera calibration process, a manually performed step is shown in the left User Action area, and an automatically performed step is shown in the right Camera Calibration Program area.

우선 카메라 캘리브레이션을 수행하기 위해서는 마커(110)가 영상에 투영될 수 있도록 카메라(210)가 바라보는 곳에 마커(110)를 위치시킨다(S1100). 다음으로 마커(110)의 설치가 끝나면 카메라 캘리브레이션을 수행하기 위해 영상 분석 모드를 카메라 캘리브레이션 모드로 전환한다(S1200). 도 3에 도시된 것처럼 S1100 단계와 S1200 단계는 사람의 개입이 필요한 수동으로 진행되는 단계들이다.First, in order to perform camera calibration, the marker 110 is positioned where the camera 210 is looking so that the marker 110 can be projected on an image (S1100). Next, when the installation of the marker 110 is finished, the image analysis mode is switched to the camera calibration mode to perform camera calibration (S1200). As shown in FIG. 3 , steps S1100 and S1200 are manually performed steps requiring human intervention.

카메라 캘리브레이션을 수행하기 위한 준비가 끝나면 카메라(210)는 마커(110)가 포함된 공간을 촬영한다(S1300). 그리고 캘리브레이션 프로그램(120)은 촬영된 영상을 로드하고, 로딩된 영상을 분석하여 마커(110)가 자동으로 검출되는지 확인한다(S1400). 만약 마커(110)가 자동으로 검출된다면, 영상 속에서 마커(110)의 좌표를 추출한다(S1600). S1300 단계와 S1400 단계 및 S1600 단계는 캘리브레이션 프로그램(120) 내에서 자동으로 수행될 수 있는 단계이다. 그러나 촬영된 영상을 분석하여도 마커(110)가 자동으로 검출되지 않는 경우에는 다시 사람의 개입이 필요하다(S1500).When preparation for performing camera calibration is completed, the camera 210 captures a space including the marker 110 (S1300). Then, the calibration program 120 loads the captured image, analyzes the loaded image, and checks whether the marker 110 is automatically detected (S1400). If the marker 110 is automatically detected, the coordinates of the marker 110 are extracted from the image (S1600). Steps S1300, S1400, and S1600 are steps that can be automatically performed within the calibration program 120 . However, when the marker 110 is not automatically detected even after analyzing the captured image, human intervention is required again (S1500).

그렇기 때문에 종래에는 수작업을 줄이고자, 즉 촬영된 영상에서 마커(110)를 용이하게 검출하기 위해서, 도 2에 도시된 것처럼 흑과 백이 체크 무늬로 교차되는 마커(110)를 주로 사용하였다. 그러나 촬영 환경에 따라서 마커(110)의 검출이 어려운 경우도 있을 수 있다. 예를 들면 야외 공간을 촬영하는 카메라(210)인데 해당 공간이 어두운 경우나, 카메라(210)가 촬영하는 공간의 주된 색상과 마커(110)의 색상이 유사하여 보호색 효과로 마커(110)의 식별이 어려운 경우도 있을 수 있다.Therefore, in the prior art, in order to reduce manual labor, that is, to easily detect the marker 110 in a photographed image, as shown in FIG. 2 , the marker 110 in which black and white are crossed in a checkered pattern is mainly used. However, there may be cases in which it is difficult to detect the marker 110 depending on the photographing environment. For example, when the camera 210 takes pictures of an outdoor space and the space is dark, or the main color of the space where the camera 210 is photographed and the color of the marker 110 are similar, the marker 110 is identified by the protective color effect. This may be difficult.

이러한 경우에는 카메라 캘리브레이션 프로그램(120) 내에서 사람이 수작업으로 마커(110)의 좌표를 직접 특정하는 단계가 필요하다(S1500). 카메라 캘리브레이션 프로그램(120)에서 자동으로 마커(110)의 좌표를 추출하거나(S1600) 사람의 수작업에 의해서 추출한 후에는(S1500), 영상 속에서 추출된 좌표와 실제 좌표를 비교해서 변환 매트릭스를 연산한다(S1700).In this case, it is necessary for a person to manually specify the coordinates of the marker 110 in the camera calibration program 120 (S1500). After automatically extracting the coordinates of the marker 110 in the camera calibration program 120 (S1600) or extracting them manually (S1500), a transformation matrix is calculated by comparing the coordinates extracted from the image with the actual coordinates. (S1700).

즉 실제로는 x1의 크기(meter)를 가지는 물체가 카메라가 촬영한 영상 속에서는 x2의 크기(pixel)로 표시되는 상관 관계를 변환 매트릭스로 수치화 하는 것이다. 변환 매트릭스를 얻은 후에는 영상 분석 알고리즘에 변환 매트릭스를 전달하고 카메라 캘리브레이션 과정이 종료된다(S1800).That is, in reality, an object having a size of x1 (meter) is digitized as a transformation matrix by a correlation expressed by a size (pixel) of x2 in an image captured by the camera. After the transformation matrix is obtained, the transformation matrix is transmitted to the image analysis algorithm and the camera calibration process is terminated (S1800).

이 과정에서 변환 매트릭스의 정확도를 높이기 위해서 마커(110)를 촬영하는 과정이 반복 수행될 수 있다. 즉 도 3에서 점선으로 표시한 단계들을 반복 수행할 수 있다. 카메라(210)가 촬영중인 공간의 다른 위치에 마커(110)를 설치하고 영상을 촬영하여 좌표를 추출하고, 또 다른 위치에 마커(110)를 설치하고 영상을 촬영하여 좌표를 추출하는 단계를 더 수행할 수 있다. 이렇게 입력 데이터를 많이 수집할수록 변환 매트릭스의 정확도를 더욱 높일 수 있다. 물론 이 과정에서 사람의 수작업 또한 반복적으로 필요하다.In this process, the process of photographing the marker 110 may be repeatedly performed in order to increase the accuracy of the transformation matrix. That is, the steps indicated by dotted lines in FIG. 3 may be repeatedly performed. The camera 210 installs the marker 110 at another location in the space being photographed, extracts the coordinates by taking an image, and installs the marker 110 at another location and extracts the coordinates by taking the image. can be done The more input data is collected in this way, the more accurate the transformation matrix can be. Of course, human manual labor is also repeatedly required in this process.

본 발명에서는 사람의 수작업이 필요한 문제점을 해결하고자, 카메라 캘리브레이션을 자동을 수행할 수 있는 방법과 장치를 제안한다. 이를 위해서는 두 가지의 수작업 즉 1) 마커(110)를 설치하는 단계와 2) (필요한 경우) 마커(110)의 좌표를 추출하는 단계를 해결할 수 있어야 한다. 이를 위해서 본 발명에서는 인위적으로 기준 물체를 설치하고 촬영을 하는 것이 아니라, 이미 촬영된 영상에서 또는 촬영 중인 영상에서 기준 물체를 선정하여 카메라 캘리브레이션을 수행한다.The present invention proposes a method and apparatus capable of automatically performing camera calibration in order to solve a problem requiring human manual operation. To this end, it is necessary to be able to solve two kinds of manual tasks: 1) installing the marker 110 and 2) extracting the coordinates of the marker 110 (if necessary). To this end, in the present invention, the camera calibration is performed by selecting a reference object from an image already taken or from an image being photographed, rather than artificially installing a reference object and photographing.

도 4는 본 발명의 일 실시예에 따른 영상 분석을 이용한 카메라 캘리브레이션 장치의 하드웨어 구성도이다.4 is a hardware configuration diagram of a camera calibration apparatus using image analysis according to an embodiment of the present invention.

도 4를 참고하면 본 발명의 일 실시예에 따른 영상 분석을 이용한 카메라 캘리브레이션 장치(10)는 외부 입력을 통해서 영상(220)을 수신한다. 이 때 수신되는 영상(220)은 기존에 이미 촬영된 영상이여도 무방하고, 현재 촬영 중인 영상이여도 무방하다. 즉 녹화된 영상 및 실시간 스트리밍 모두를 입력으로 사용할 수 있다. 이처럼 영상 분석을 이용한 카메라 캘리브레이션 장치(10)는 외부의 카메라(210)를 통해서 촬영된 영상(220)을 수신부(310)를 통해서 수신한다.Referring to FIG. 4 , the camera calibration apparatus 10 using image analysis according to an embodiment of the present invention receives an image 220 through an external input. At this time, the received image 220 may be an image that has already been photographed or an image that is currently being photographed. That is, both recorded video and real-time streaming can be used as inputs. As such, the camera calibration apparatus 10 using the image analysis receives the image 220 photographed through the external camera 210 through the receiver 310 .

검출부(320)에서는 수신한 영상(220)을 분석하여 기준 물체로 사용하기 위한 객체들을 검출한다. 이 때 2가지의 기준에 의해서 객체를 선정할 수 있다. 하나는 객체의 크기이며 다른 하나는 검출 영역에서 객체가 차지하는 비율이다. 객체의 크기가 절대적인 기준이라면 객체의 비율은 상대적인 기준이다. 이에 대해서는 추후 도 6a 내지 도 6b에서 보다 자세하게 살펴보도록 한다.The detector 320 analyzes the received image 220 to detect objects to be used as reference objects. In this case, an object can be selected according to two criteria. One is the size of the object and the other is the proportion of the object in the detection area. If the size of an object is an absolute standard, the ratio of an object is a relative standard. This will be described in more detail later with reference to FIGS. 6A to 6B .

등록부(330)에서는 검출부(320)에서 검출한 객체와 비교할 객체들의 데이터베이스(database)를 구축한다. 즉 등록부(330)에서는 사전에 수작업 또는 자동화된 방법에 의해서 객체들의 이미지와 객체의 정보를 수집하여 데이터베이스로 구축한다. 이렇게 구축된 객체들의 데이터베이스는 추후 매칭부(340)에서 활용된다.The registration unit 330 builds a database of objects detected by the detection unit 320 and objects to be compared. That is, the registration unit 330 collects images of objects and object information by manual or automated methods in advance, and builds them into a database. The database of objects constructed in this way is later utilized by the matching unit 340 .

매칭부(340)는 영상(220)에서 검출된 객체와 데이터베이스에 저장된 객체를 비교하여 매칭하는 과정을 수행한다. 이를 통해 데이터베이스에 객체의 이미지와 함께 저장된 객체의 정보를 이용하여, 영상에서 검출된 객체의 정보를 알 수 있다. 즉 영상(220)에서 검출된 객체의 정보를 사전에 구축된 데이터베이스를 활용하여 파악한다.The matching unit 340 compares and matches the object detected in the image 220 with the object stored in the database. Through this, by using the object information stored together with the object image in the database, it is possible to know the information of the object detected in the image. That is, information on the object detected in the image 220 is grasped by using a database built in advance.

처리부(350)는 매칭부(340)를 통해서 파악한 영상(220)에서 검출된 객체의 2차원 이미지상의 정보와 3차원 실공간상의 정보를 비교하여 카메라 캘리브레이션을 수행한다. 2차원 이미지의 좌표와 3차원 실공간의 좌표를 이용하여 변환 매트릭스를 연산하는 과정은 종래의 카메라 캘리브레이션 알고리즘을 이용할 수 있다.The processing unit 350 performs camera calibration by comparing the information on the 2D image of the object detected from the image 220 identified through the matching unit 340 with the information on the 3D real space. The process of calculating the transformation matrix using the coordinates of the two-dimensional image and the coordinates of the three-dimensional real space may use a conventional camera calibration algorithm.

도 3과 도 4를 비교해 보면, 본 발명의 일 실시예에 따른 카메라 캘리브레이션 방법은 카메라(210)가 촬영 중인 공간에 인위적으로 기준 물체를 설치하는 과정이 생략되어 있다. 대신 영상 속에서 기준 물체가 될 수 있는 객체를 검출하여 카메라 캘리브레이션을 수행한다.3 and 4, in the camera calibration method according to an embodiment of the present invention, the process of artificially installing a reference object in a space in which the camera 210 is photographing is omitted. Instead, camera calibration is performed by detecting an object that can be a reference object in the image.

종래에는 영상을 촬영하기 전에 카메라 캘리브레이션을 수행하여야 영상의 분석이 가능하였다. 즉 카메라 캘리브레이션을 수행하지 않고서 촬영을 하는 경우에는 영상 분석을 통해 크기 정보를 파악할 수 없었다. 이에 비해 본 발명에서는 촬영과는 별개로 영상 분석을 통해서 기준 물체를 선정하고 카메라 캘리브레이션을 수행하므로 촬영 후에도 카메라 캘리브레이션이 가능하다.Conventionally, it is possible to analyze an image only by performing camera calibration before capturing an image. That is, in the case of shooting without performing camera calibration, size information could not be grasped through image analysis. In contrast, in the present invention, since a reference object is selected through image analysis and camera calibration is performed separately from shooting, camera calibration is possible even after shooting.

본 발명에서는 카메라 캘리브레이션을 수행하기 위해 필요한 기준 물체 설치라는 인위적인 전처리 작업을 생략함으로써, 영상의 촬영과 카메라 캘리브레이션을 독립적으로 수행할 수 있다. 사전에 카메라 캘리브레이션을 수행하지 않고서 촬영된 영상도, 사후적으로 카메라 캘리브레이션을 수행하고 영상을 분석하여 영상 속 객체들의 실제 크기 정보를 파악할 수 있다. 이를 통해, 촬영 중인 영상 뿐만 아니라, 기존에 이미 촬영된 영상들을 분석함에 있어서도 효율을 더욱 높일 수 있다.In the present invention, by omitting an artificial pre-processing task of installing a reference object required to perform camera calibration, image capturing and camera calibration can be performed independently. Even for an image captured without performing camera calibration in advance, camera calibration is performed and image analysis is performed to determine actual size information of objects in the image. Through this, it is possible to further increase the efficiency in analyzing not only the image being photographed but also images that have already been taken.

도 5a 내지 도 5f는 본 발명의 일 실시예에 따른 영상 분석을 이용한 카메라 캘리브레이션 장치의 각 구성을 설명하기 위한 예시도이다.5A to 5F are exemplary views for explaining each configuration of a camera calibration apparatus using image analysis according to an embodiment of the present invention.

도 5a는 본 발명에서 입력으로 사용하는 영상(220)을 설명하기 위한 도면이다. 영상(220)은 분석을 위해 기본적으로 필요한 필수 데이터이다. 여기서 영상(220)은 시스템에 입력된 다양한 영상 정보를 의미한다. 즉 종래의 카메라 캘리브레이션에서 사용하던 촬영 중인 영상 즉 실시간 영상 외에도 이미 촬영된 영상도 포함한다. 본 발명에서 영상(220)은 실시간 스트리밍 뿐만 아니라 저장된 동영상 파일도 포함하는 개념이다.5A is a diagram for explaining an image 220 used as an input in the present invention. The image 220 is essential data that is basically required for analysis. Here, the image 220 refers to various image information input to the system. That is, in addition to the image being photographed, that is, the real-time image used in the conventional camera calibration, it includes an image already captured. In the present invention, the image 220 is a concept that includes not only real-time streaming but also stored video files.

본 발명에서는 카메라(210)로 촬영 전에 기준 물체를 설치하여 카메라 캘리브레이션을 수행하는 것이 아니라, 촬영 중이거나 촬영된 영상(220)을 분석하여 기준 물체를 선정하여 카메라 캘리브레이션을 수행하므로 실시간 스트리밍 데이터 뿐만 아니라 이미 촬영되어 저장된 동영상에도 카메라 캘리브레이션을 수행할 수 있다. 이처럼 본 발명의 일 실시예에 따르면 종래의 카메라 캘리브레이션 방법이 영상(220)을 촬영하기 전에 수행해야 하는 문제점을 해결할 수 있다.In the present invention, the camera calibration is not performed by installing a reference object before photographing with the camera 210, but by analyzing the image 220 being photographed or photographed to select a reference object to perform camera calibration, so that not only real-time streaming data but also real-time streaming data is performed. Camera calibration can also be performed on videos that have already been recorded and stored. As described above, according to an embodiment of the present invention, it is possible to solve the problem that the conventional camera calibration method has to perform before capturing the image 220 .

도 5b는 본 발명의 일 실시예에 따른 카메라 캘리브레이션 장치(10)의 수신부(310)를 설명하기 위한 도면이다. 도 5b를 참고하면 본 발명의 카메라 캘리브레이션 장치(10)는 외부의 카메라(210)가 촬영한 영상(220)을 수신하여 입력으로 이용한다. 이 과정에서 수신부(310)는 영상(220)을 디코딩(decoding)할 수 있다. 디코딩된 영상은 추후 검출부(320)를 통해 프레임(frame) 단위로 분석하여 객체를 추출하고 기준 물체로 사용할지 여부를 결정할 수 있다.5B is a diagram for explaining the receiver 310 of the camera calibration apparatus 10 according to an embodiment of the present invention. Referring to FIG. 5B , the camera calibration apparatus 10 of the present invention receives an image 220 captured by an external camera 210 and uses it as an input. In this process, the receiver 310 may decode the image 220 . The decoded image may be later analyzed in units of frames through the detector 320 to extract an object and determine whether to use it as a reference object.

도 5c는 본 발명의 일 실시예에 따른 카메라 캘리브레이션 장치(10)의 검출부(320)를 설명하기 위한 도면이다. 도 5c를 참고하면 본 발명의 검출부(320)는 수신된 영상에서 캘리브레이션의 기준이 될 수 있는 객체(230)를 추출하는 역할을 수행한다. 즉 종래의 카메라 캘리브레이션 방법은 영상을 촬영하기 전에 기준 물체를 설치하고 이를 촬영한 반면에 본 발명에서는 이미 촬영된 영상에서 기준 물체를 선정하는 차이점이 있다.5C is a view for explaining the detection unit 320 of the camera calibration apparatus 10 according to an embodiment of the present invention. Referring to FIG. 5C , the detection unit 320 of the present invention serves to extract an object 230 that can be a reference for calibration from a received image. That is, in the conventional camera calibration method, a reference object is installed and photographed before an image is taken, whereas in the present invention, a reference object is selected from an image already taken.

영상 분석을 통해 객체(230)를 검출하고 검출된 객체(230)의 이미지를 사전에 구축된 데이터베이스와 비교함으로써, 종래의 영상을 촬영하기 전에 설치하는 기준 물체를 대신할 수 있다. 이를 위해서 검출부(320)는 기준 물체로 사용할 수 있는 객체들(230)을 추출한다. 추출된 객체들(230)은 몇가지 기준에 따라 기준 물체로 사용할지 여부를 판단할 수 있다. 이 과정에서 기준에 따라 스코어링(scoring)을 수행하여 점수가 높은 객체들만 우선하여 기준 물체로 이용할 수 있다.By detecting the object 230 through image analysis and comparing the image of the detected object 230 with a database built in advance, it can replace a reference object installed before taking a conventional image. To this end, the detector 320 extracts objects 230 that can be used as reference objects. The extracted objects 230 may determine whether to use them as reference objects according to several criteria. In this process, scoring is performed according to a criterion, and only objects with high scores can be used as reference objects with priority.

또한 기준 물체는 하나만 사용하는 것이 아니라 복수의 객체를 기준 물체로 사용하여 카메라 캘리브레이션을 수행함으로써 오차를 줄일 수 있다. 영상에서 추출된 객체 중에서 어떤 객체를 기준 물체로 사용할지 여부와 관련된 구체적인 기준은 도 6a 내지 도 6b에서 보다 자세히 살펴보도록 한다.In addition, error can be reduced by performing camera calibration using a plurality of objects as reference objects instead of using only one reference object. A detailed standard related to whether to use an object from among the objects extracted from the image as a reference object will be described in more detail with reference to FIGS. 6A to 6B .

검출부(320)가 객체를 추출하는 과정에는 영상을 분석하여 윤곽선을 검출하는 알고리즘(edge detection algorithm)이 활용될 수 있다. 윤곽선을 검출하는 알고리즘은 영상(220)을 분석하여 밝기가 불연속으로 변하는 지점을 윤곽선으로 판단하고 해당 지점의 픽셀을 추출한다. 윤곽선을 검출하는 알고리즘은 Sobel, Prewitt, Robert, Laplacian, Canny 등 다양한 알고리즘이 있으므로 이 중 하나 이상을 이용하여 경계선을 검출하고 객체(230)를 추출할 수 있다.In the process in which the detector 320 extracts the object, an edge detection algorithm for analyzing an image and detecting an outline may be used. An algorithm for detecting an outline analyzes the image 220 to determine a point where the brightness discontinuously changes as an outline, and extracts a pixel at the point. Since there are various algorithms such as Sobel, Prewitt, Robert, Laplacian, and Canny for detecting the outline, one or more of them may be used to detect the boundary and extract the object 230 .

도 5d는 본 발명의 일 실시예에 따른 카메라 캘리브레이션 장치(10)의 등록부(330)를 설명하기 위한 도면이다. 도 5d를 참고하면 본 발명의 등록부(330)는 두 가지 경로를 통해서 데이터베이스(331)를 구축한다. 그 중에서 첫번째는 자동화된 방식(Auto Data Gathering)으로 웹 페이지(240)를 크롤링(crawling)하여 특정 객체의 이미지와 정보를 매칭하여 데이터베이스(331)에 저장하는 방식이다.5D is a view for explaining the registration unit 330 of the camera calibration apparatus 10 according to an embodiment of the present invention. Referring to FIG. 5D , the registration unit 330 of the present invention builds the database 331 through two paths. Among them, the first is a method of crawling the web page 240 in an automated manner (Auto Data Gathering), matching the image and information of a specific object, and storing it in the database 331 .

예를 들면, 각종 쇼핑몰이나 제품의 홈페이지를 방문하면 제품을 설명하기 위한 이미지와 하단에 텍스트로 제품과 관련된 정보가 나열된 것을 볼 수 있다. 이러한 정보들을 봇(bot)이 자동으로 수집하여 데이터를 정제하고 가공하여 데이터베이스(331)에 저장하는 방식이다. 그렇기 때문에 본 발명에서 기준 물체로 사용될 수 있는 객체(230)들은 공산품인 경우가 많다. 즉 주변에서 많이 보일 수 있고, 각각의 객체의 가로와 세로 및 높이가 동일한 제품들의 이미지가 기준 물체로 활용될 수 있다.For example, if you visit various shopping malls or homepages of products, you can see product-related information listed in text at the bottom and images to explain the product. A bot automatically collects such information, purifies and processes the data, and stores it in the database 331 . Therefore, the objects 230 that can be used as reference objects in the present invention are often industrial products. That is, it can be seen a lot in the vicinity, and images of products having the same width, length, and height of each object can be used as a reference object.

자동차나 텔레비전, 냉장고처럼 그 크기가 크고 규격화된 객체들이 기준 물체로 이용될 수 있다. 그러나 반드시 이러한 공산품으로만 기준 물체가 한정되는 것은 아니다. 추후 도 7에서 살펴보겠지만, 사람의 이미지도 기준 물체로 활용될 수 있다. 즉 기준 물체로 이용될 수 있는 객체들은 1) 기 등록된 데이터베이스의 이미지와 비교가 가능할 것, 2) 이미지 비교를 통해서 영상(220)에 촬영된 객체의 실 공간상에서의 크기 정보(가로, 세로, 높이)를 조회할 수 있을 것이라는 두 가지 조건을 만족하기만 하면 충분한다.Large and standardized objects such as automobiles, televisions, and refrigerators can be used as reference objects. However, the reference object is not necessarily limited only to these industrial products. As will be seen later in FIG. 7 , an image of a person may also be used as a reference object. That is, objects that can be used as reference objects 1) can be compared with an image of a previously registered database, 2) size information (horizontal, vertical, horizontal, vertical, height), it is sufficient if two conditions are satisfied.

등록부(330)에서 데이터베이스(331)를 구축하는 나머지 방법은 수동적인 방법(Manual Data Gathering)으로 사용자 인터페이스(UI)를 제공하여, 사용자로부터 특정 객체의 이미지와 해당 특정 객체의 크기 정보를 입력받을 수 있다. 사용자가 카메라(210)에서 검출될 수 있는 객체들을 예측하여 사전에 저장함으로써 데이터베이스(331)를 구축할 수도 있다. 다만 수동적인 방법은 등록부(330)에서 데이터베이스(331)를 구축하기 위해 보조적으로 제공하는 방법이 될 것이다.The rest of the method of building the database 331 in the register 330 is a manual method (Manual Data Gathering) that provides a user interface (UI), so that an image of a specific object and size information of the specific object can be input from the user. there is. The user may build the database 331 by predicting and storing objects that can be detected by the camera 210 in advance. However, the passive method will be an auxiliary method provided by the registration unit 330 to build the database 331 .

도 5e는 본 발명의 일 실시예에 따른 카메라 캘리브레이션 장치(10)의 매칭부(340)를 설명하기 위한 도면이다. 도 5e를 참고하면 본 발명의 매칭부(340)는 검출부(320)에서 추출한 객체(251)와 데이터베이스(331)에 저장된 객체(259)를 비교하는 역할을 수행한다. 추출된 객체(251)와 등록된 객체(259)가 일치할 경우 등록된 객체(259)와 매칭되어 저장된 크기 정보를 검색하여 처리부(350)에 전송한다.5E is a view for explaining the matching unit 340 of the camera calibration apparatus 10 according to an embodiment of the present invention. Referring to FIG. 5E , the matching unit 340 of the present invention compares the object 251 extracted by the detection unit 320 with the object 259 stored in the database 331 . When the extracted object 251 and the registered object 259 match, the size information matched with the registered object 259 is searched and transmitted to the processing unit 350 .

처리부(350)에서는 추출된 객체(251)의 화면상에서의 크기 정보(단위가 pixel)과 등록된 객체(259)의 실공간상에서의 크기 정보(단위가 meter)를 이용하여 카메라 캘리브레이션을 수행할 수 있다. 예를 들면, 영상(220)에서 소화기가 검출되어 이를 매칭부(340)에서 데이터베이스(331)를 조회하였더니, 매칭되는 소화기가 검색되는 경우 데이터베이스(331)에 저장된 소화기의 제원을 처리부(350)에 전달할 수 있다.The processing unit 350 may perform camera calibration using size information (unit: pixel) on the screen of the extracted object 251 and size information (unit: meter) of the registered object 259 in real space. there is. For example, when a fire extinguisher is detected in the image 220 and the matching unit 340 searches the database 331, when a matching fire extinguisher is found, the fire extinguisher specification stored in the database 331 is processed by the processing unit 350 can be forwarded to

도 5f는 본 발명의 일 실시예에 따른 카메라 캘리브레이션 장치(10)의 처리부(350)를 설명하기 위한 도면이다. 도 5f를 참고하면 영상(220)에서의 추출된 객체(251)의 픽셀 단위로 표시된 크기 정보를 실공간상의 객체로 복원하여, 해당 객체의 미터 단위로 표시된 실제의 크기 정보를 구하는 과정을 볼 수 있다.5F is a diagram for explaining the processing unit 350 of the camera calibration apparatus 10 according to an embodiment of the present invention. Referring to FIG. 5F , it is possible to see the process of recovering the size information displayed in pixels of the extracted object 251 from the image 220 as an object in real space to obtain the actual size information displayed in meters of the object. there is.

이처럼 처리부(350)에서는 매칭된 객체의 크기 정보와 카메라 정보(초점 거리, 해상도, 센서 폭, 센서 높이, 카메라 높이 등)을 가지고 카메라 캘리브레이션을 수행한다. 이 과정에서 카메라 캘리브레이션과 관련된 구체적인 연산 과정 내지는 알고리즘은 종래의 카메라 캘리브레이션 방법에서 사용하는 matlab이나 opencv 등을 활용할 수 있다.As such, the processing unit 350 performs camera calibration with size information of the matched object and camera information (focal length, resolution, sensor width, sensor height, camera height, etc.). In this process, a specific calculation process or algorithm related to camera calibration may utilize matlab or opencv used in a conventional camera calibration method.

지금까지 도 5a 내지 5f를 통해 본 발명의 일 실시예에 따른 카메라 캘리브레이션 장치(10)의 각 구성요소를 살펴보았다. 여기서 검출부(320)가 영상(220)에서 윤곽선 검출(edge detection)을 통해 검출한 복수의 객체(230) 중에서 어떤 객체를 기준 물체로 사용할지에 관한 기준을 도 6a 내지 도 6b를 통해서 살펴보도록 한다.Up to now, each component of the camera calibration apparatus 10 according to an embodiment of the present invention has been described with reference to FIGS. 5A to 5F . Here, a criterion regarding which object is used as a reference object among a plurality of objects 230 detected by the detection unit 320 through edge detection in the image 220 will be described with reference to FIGS. 6A to 6B .

도 6a 내지 도 6b는 본 발명의 일 실시예에서 영상 분석을 통해 객체를 검출하는 기준을 설명하기 위한 예시도이다.6A to 6B are exemplary diagrams for explaining a criterion for detecting an object through image analysis in an embodiment of the present invention.

검출부(320)에서 윤곽선 검출을 통해서 검출한 객체(230) 중에서 어떤 객체를 기준 물체로 사용할지 여부는 2가지를 기준으로 선정할 수 있다. 하나는 검출된 객체의 크기로 이는 2차원 영상(220)에서 면적을 구하는 과정을 통해서 점수화될 수 있다. 다른 하나는 검출된 객체가 검출 영역에서 차지하는 비율로 이는 2차원 영상(220)에서 면적을 비교하는 과정을 통해서 점수화될 수 있다.Whether to use an object as a reference object among the objects 230 detected through the contour detection by the detector 320 may be selected based on two criteria. One is the size of the detected object, which may be scored through a process of obtaining an area from the 2D image 220 . The other is the ratio of the detected object to the detection area, which may be scored through a process of comparing areas in the 2D image 220 .

객체(230)의 크기가 절대적인 측면에서의 기준이고, 비율은 상대적인 측면에서의 기준이다. 영상(220)에서 추출된 객체(230)들을 매칭부(340)를 통해 데이터베이스(331)에 저장된 객체들의 이미지와 비교하여야 하므로, 추출된 객체(230)들의 크키가 클수록, 즉 2차원 영역에서 면적이 넓을수록, 매칭부(340)에서 이미지를 비교하기가 용이하다.The size of the object 230 is a criterion in absolute terms, and the ratio is a criterion in a relative dimension. Since the objects 230 extracted from the image 220 should be compared with the images of the objects stored in the database 331 through the matching unit 340, the larger the size of the extracted objects 230, that is, the area in the two-dimensional area. The wider the width, the easier it is to compare images in the matching unit 340 .

또한 영상(220)은 기본적으로 2차원 평면이므로 직사각형의 형태를 가지게 된다. 여기서 검출된 객체(230)의 윤곽이 직사각형에 가까울수록 매칭부(340)에서 이미지를 비교하기가 용이하다. 즉 면적이 동일하더라도 보다 직사각형에 가까운 객체가 데이터베이스(331)에 저장된 객체의 이미지과 비교하기 수월하다.Also, since the image 220 is basically a two-dimensional plane, it has a rectangular shape. Here, the closer the contour of the detected object 230 is to a rectangle, the easier it is to compare the images in the matching unit 340 . That is, even if the area is the same, it is easier to compare an object closer to a rectangle with the image of the object stored in the database 331 .

도 6a를 참고하면 객체 A(231a)와 객체 B(231b)의 비율을 비교하는 것을 볼 수 있다. 객체 A(231a)는 2차원 영상(220)에서는 ㄴ자 모양의 객체로 짧은 가로가 30pixel, 긴 가로가 100pixel, 짧은 세로가 40pixel, 긴 세로가 80pixel인 도형이다. 객체 A(231a)가 직사각형 영역(100x80)에서 차지하는 비율은 객체 A(231a)의 면적을 직사각형 영역(80x100)의 면적으로 나누는 과정을 통해서 구할 수 있다. 객체 A(231a)의 경우 (100 * 40 + (80 - 40) * 30) / (100 * 80) * 100 = 65% 의 수식을 통해, 실제 계산 결과는 65%인 것을 확인할 수 있다.Referring to FIG. 6A , it can be seen that the ratio of the object A 231a and the object B 231b is compared. The object A 231a is an L-shaped object in the two-dimensional image 220, and is a figure having a short width of 30 pixels, a long width of 100 pixels, a short length of 40 pixels, and a length of 80 pixels. The ratio that the object A 231a occupies in the rectangular area 100x80 can be obtained by dividing the area of the object A 231a by the area of the rectangular area 80x100. For object A(231a), through the formula (100 * 40 + (80 - 40) * 30) / (100 * 80) * 100 = 65% , It can be seen that the actual calculation result is 65%.

마찬가지로 객체 B(231b)는 2차원 영상(220)에서는 사다리꼴 모양의 객체로 높이는 80pixel, 윗변의 길이는 80pixel, 밑변의 길이는 100pixel인 도형이다. 객체 B(231b)가 직사각형 영역(100x80)에서 차지하는 비율은 ((100 + 80) * 80 / 2) / (100 * 80) * 100 = 90% 의 수식을 통해, 90%인 것을 확인할 수 있다. 객체 A(231a)에 비해서는 객체 B(231b)가 보다 더 직사각형에 가까운 도형임을 알 수 있다. 비율을 기준으로만 놓고 보면 객체 A(231a)보다는 객체 B(231b)가 보다 더 기준 물체에 적합하다.Similarly, the object B 231b is a trapezoidal object in the 2D image 220 and is a figure having a height of 80 pixels, an upper side length of 80 pixels, and a bottom side length of 100 pixels. It can be seen that the ratio of the object B 231b in the rectangular area 100x80 is 90% through the formula ((100 + 80) * 80 / 2) / (100 * 80) * 100 = 90%. It can be seen that the object B 231b is a figure closer to a rectangle than the object A 231a. In terms of the ratio only, object B (231b) is more suitable for the reference object than object A (231a).

도 6b를 참고하면 객체(230)의 크기를 구하는 과정을 볼 수 있다. 비율이 동일하더라도 객체의 크기가 더 큰 경우기 비교에 용이한 점에 착안한 것이다. 도 6b에서는 동일하게 ㄴ자 모양의 객체 A(231a)와 객체 C(231c)를 볼 수 있다. 객체 A(231a)와 객체 C(231c)는 닮은 꼴로 닮음비는 2:1인 관계이다. 도형의 모양은 동일하므로 비율은 계산해보면 도 6a에서 살펴본 것처럼 객체 A(231a)와 객체 C(231c) 모두 65%이다.Referring to FIG. 6B , a process of obtaining the size of the object 230 can be seen. It is based on the fact that it is easy to compare when the size of the object is larger even if the ratio is the same. In FIG. 6B , an L-shaped object A 231a and an object C 231c can be seen in the same way. Object A (231a) and object C (231c) are similar, and the similarity ratio is 2:1. Since the shape of the figure is the same, if the ratio is calculated, both the object A 231a and the object C 231c are 65% as shown in FIG. 6A .

그러나, 실제 면적을 구해보면 객체 A(231a)는 (100 * 40 + (80 - 40) * 30) = 4000 + 1200 = 5200 이고, 객체 C(231c)는 (50 * 20 + (40 - 20) * 15) = 1000 + 300 = 1300 이다. 객체 A(231a)와 객체 C(231c)의 닮은비가 2:1 이므로 면적비는 그 제곱인 4:1인 것을 확인할 수 있다. 직사각형 형태의 검출 영역에서 객체가 차지하는 비율이 동일하더라도 객체의 크기가 더 클수록 매칭부(340)에서 비교를 수행하기 용이하므로, 객체 C(231c)보다는 객체 A(231a)가 보다 더 기준 물체에 적합하다.However, when calculating the actual area, object A(231a) is (100 * 40 + (80 - 40) * 30) = 4000 + 1200 = 5200, and object C(231c) is (50 * 20 + (40 - 20) * 15) = 1000 + 300 = 1300. Since the similarity ratio of object A (231a) and object C (231c) is 2:1, it can be confirmed that the area ratio is 4:1, which is the square. Even if the proportion of objects in the rectangular detection area is the same, the larger the size of the object, the easier it is for the matching unit 340 to perform the comparison. Therefore, the object A 231a is more suitable for the reference object than the object C 231c. Do.

크기와 비율 두 가지 기준에 의해 영상(220)에서 추출된 객체(230) 중에서 기준 물체로 사용할 객체를 선정할 수 있다. 이 과정에서 스코어링(scoring) 및 스케일링(scaling)을 수행하여 추출된 객체(230) 별로 점수화를 할 수 있다. 예를 들면 객체(230)의 면적을 화면의 해상도로 나누어서 100보다 작은 값으로 스케일링을 수행하고, 이 값에 비율을 곱해서 추출된 객체(230)의 최종 점수를 연산할 수 있다.An object to be used as a reference object may be selected from among the objects 230 extracted from the image 220 based on two criteria of size and ratio. In this process, scoring may be performed for each extracted object 230 by performing scoring and scaling. For example, the final score of the extracted object 230 may be calculated by dividing the area of the object 230 by the screen resolution, performing scaling to a value less than 100, and multiplying this value by a ratio.

연산된 최종 점수를 기준으로 상위 5개의 객체를 기준 물체로 활용하여 매칭을 수행하고 카메라 캘리브레이션을 할 수 있다. 이를 통해 하나의 기준 물체를 이용하는 경우에 발생할 수 있는 오차를 최소화할 수 있다. 다만 지금 설명한 스코어링과 스케일링 과정은 하나의 예시일 뿐, 이 외에도 다양한 방법에 따라 크기와 비율을 수치화하여 각 객체(230)의 수치를 비교하여 기준 물체로 사용할 객체를 선정할 수 있다.Based on the calculated final score, the top 5 objects can be used as reference objects to perform matching and perform camera calibration. Through this, it is possible to minimize an error that may occur when one reference object is used. However, the scoring and scaling process described now is only an example, and in addition to this, an object to be used as a reference object may be selected by comparing the numerical value of each object 230 by digitizing the size and ratio according to various methods.

도 7은 본 발명의 일 실시예에 따른 얼굴 인식을 이용한 자동화된 카메라 캘리브레이션 방법의 순서도이다.7 is a flowchart of an automated camera calibration method using face recognition according to an embodiment of the present invention.

최근 기술 유출과 관련된 기사를 심심치 않게 접할 수 있다. 이처럼 보안이 중요시 되면서, 대부분의 기업은 직원들의 얼굴 사진이나 지문 등을 데이터베이스화하여 출입을 통제하기도 한다. 또한 얼굴 사진이나 지문 뿐만 아니라 직원들의 신체 정보들, 예를 들면 키나 몸무게 등을 이용하여 보안에 활용하는 경우도 있다.You can easily come across articles related to the recent technology leak. As security becomes so important, most companies control access by databaseizing employees' face photos or fingerprints. In addition, not only face photos or fingerprints, but also employee body information, such as height and weight, are sometimes used for security.

사전에 직원들의 얼굴 사진과 키가 데이터베이스(331)로 구축된 회사를 가정해보면, 데이터베이스(331)에 구축된 정보를 이용하여 회사에 설치된 여러 개의 감시 카메라을 대상으로 카메라 캘리브레이션을 수행할 수 있다. 즉 회사 곳곳에 감시 카메라를 설치하면서 각 카메라마다 카메라 캘리브레이션을 별도로 수행하는 것이 아니라, 카메라는 그저 설치하기만 하고, 데이터베이스(331)에 구축된 직원의 얼굴 사진과 키 정보를 이용하여 카메라 캘리브레이션을 수행할 수도 있다.If it is assumed that a company in which the face photos and keys of employees are previously constructed as a database 331 , camera calibration may be performed for several surveillance cameras installed in the company using the information constructed in the database 331 . That is, instead of separately performing camera calibration for each camera while installing surveillance cameras throughout the company, the camera is simply installed, and camera calibration is performed using the employee's face picture and key information built into the database 331 . You may.

도 7을 참고하면 감시 카메라가 촬영 중인 영상을 분석하여(S2100), 얼굴을 인식한다(S2200). 윤곽선 검출처럼 얼굴을 인식하는 과정에서는 종래의 다양한 얼굴 인식 알고리즘(Face Detection Algorithm)을 활용할 수 있다. 얼굴이 감지되지 않는 경우에는 다시 계속해서 영상을 모니터링하고(S2100), 얼굴이 감지된 경우에는 데이터베이스(331)에 저장된 얼굴 이미지와 비교할 수 있다(S2300).Referring to FIG. 7 , the surveillance camera analyzes an image being shot (S2100), and recognizes a face (S2200). In the process of recognizing a face like contour detection, various conventional face detection algorithms may be used. When the face is not detected, the image is continuously monitored (S2100), and when the face is detected, it can be compared with the face image stored in the database 331 (S2300).

데이터베이스(331)에 저장된 얼굴 이미지와 매칭되지 않는 경우 다시 계속해서 영상을 모니터링하고(S2100), 데이터베이스(331)에 저장된 얼굴 이미지와 매칭되는 경우에는 해당 얼굴의 객체 즉 사람에 관한 정보를 데이터베이스(331)에서 조회한다(S2500). 이를 통해 영상에서는 x pixel로 표시되는 사람의 키가 실제 공간상에서는 x' cm임을 이용하여, 카메라 캘리브레이션을 수행할 수 있다(S2600).If it does not match the face image stored in the database 331, the image is continuously monitored again (S2100), and when it matches the face image stored in the database 331, information about the face object, that is, the person ) inquires (S2500). Through this, camera calibration can be performed by using that the height of a person represented by x pixels in the image is x' cm in real space (S2600).

종래에는 회사 곳곳에 카메라를 설치하고 각 카메라 별로 기준 물체를 설치하여 카메라 캘리브레이션을 수행해야 했으나, 본 발명에서는 설치된 카메라에 데이터베이스(331)에 얼굴 이미지가 저장된 사람이 지나가는 것만으로도 카메라 캘리브레이션이 수행될 수 있다. 카메라 캘리브레이션에 필요한 수작업을 줄임으로써 영상 분석의 효율을 높일 수 있다.Conventionally, camera calibration had to be performed by installing cameras throughout the company and installing a reference object for each camera, but in the present invention, camera calibration is performed just by passing a person whose face image is stored in the database 331 in the installed camera. can By reducing the manual work required for camera calibration, the efficiency of image analysis can be increased.

도 8은 본 발명의 일 실시예에 따른 제품 인식을 이용한 자동화된 카메라 캘리브레이션 방법의 순서도이다.8 is a flowchart of an automated camera calibration method using product recognition according to an embodiment of the present invention.

도 8을 참고하면 특정 실내 공간을 촬영한 영상을 대상으로 카메라 캘리브레이션을 수행하는 과정을 볼 수 있다. 즉 도 8의 경우에는 이미 저장된 영상을 대상으로 카메라 캘리브레이션을 수행한다. 본 발명에서는 영상 내에서 기준 물체를 선정하기 때문에 이처럼 사후적인 카메라 캘리브레이션이 가능하다는 장점이 있다.Referring to FIG. 8 , a process of performing camera calibration on an image captured in a specific indoor space can be seen. That is, in the case of FIG. 8 , camera calibration is performed on an already stored image. In the present invention, since a reference object is selected in an image, there is an advantage that such a post-mortem camera calibration is possible.

우선 녹화된 영상을 분석하여(S3100), 객체를 인식한다(S3200). 이 과정에서 윤곽선 검출 알고리즘(Edge Detection Algorithm)을 활용할 수 있다. 객체가 감지되지 않는 경우에는 다시 계속해서 영상을 모니터링하고(S3100), 객체가 감지된 경우에는 데이터베이스(331)에 저장된 제품들의 이미지와 비교할 수 있다(S3300).First, the recorded image is analyzed (S3100), and an object is recognized (S3200). In this process, an edge detection algorithm can be used. When the object is not detected, the image is continuously monitored (S3100), and when the object is detected, it can be compared with images of products stored in the database 331 (S3300).

데이터베이스(331)에 저장된 TV 이미지와 매칭되지 않는 경우 다시 계속해서 영상을 모니터링하고(S3100), 데이터베이스(331)에 저장된 TV 이미지와 매칭되는 경우에는 해당 객체, 즉 TV에 관한 정보를 데이터베이스(331)에서 조회한다(S3500). 이를 통해 영상에서는 x pixel로 표시되는 제품의 높이가 실제 공간상에서는 x' cm임을 이용하여, 카메라 캘리브레이션을 수행할 수 있다(S3600).If it does not match the TV image stored in the database 331, the image is continuously monitored again (S3100), and when it matches the TV image stored in the database 331, the corresponding object, that is, information about the TV is stored in the database 331 Inquire at (S3500). Through this, camera calibration can be performed by using that the height of the product represented by x pixels in the image is x' cm in the real space (S3600).

카메라 캘리브레이션을 수행하면, 매장 내에 도둑이 든 경우라 하더라도 매장에 설치된 디스플레이를 이용하여, 녹화된 영상에 대해 카메라 캘리브레이션을 수행하고, 이를 통해 도둑의 키를 유추할 수 있다. 이처럼 본 발명에서 사용될 수 있는 기준 물체는 도 7처럼 사람이여도 무방하고 도 8처럼 공산품이여도 무방하다.If the camera is calibrated, even when a thief is found in the store, the camera calibration is performed on the recorded image using the display installed in the store, and the thief's key can be inferred through this. As such, the reference object that can be used in the present invention may be a human as shown in FIG. 7 or an industrial product as shown in FIG. 8 .

도 9a는 본 발명의 일 실시예에 따라 자동차 블랙박스 영상에 카메라 캘리브레이션을 적용한 경우의 예시도이다.9A is an exemplary diagram illustrating a case in which camera calibration is applied to an image of a vehicle black box according to an embodiment of the present invention.

본 발명은 영상을 분석해서 카메라 캘리브레이션을 수행하므로 영상 분석을 추가적으로 더 이용한 카메라 캘리브레이션 방법을 적용할 수 있다. 즉 특정 영상에서 객체를 선정하여 카메라 캘리브레이션을 수행한 후에 지속적으로 해당 객체를 추적하여 다시 카메라 캘리브레이션이 필요한 상황에서 재활용할 수도 있다.Since the present invention performs camera calibration by analyzing an image, a camera calibration method further using image analysis may be applied. That is, after camera calibration is performed by selecting an object from a specific image, the object can be continuously tracked and reused when camera calibration is required again.

도 9a를 참고하면 자동차 블랙박스에 옆 차선의 차량(261a)이 검출되어 이를 기준으로 카메라 캘리브레이션을 수행한 것을 볼 수 있다. 추후 시간이 흘러 옆 차선의 차량(261a)이 이동하여 크기가 작아져서 정확한 인식이 불가능한 경우에도(261b), 사전에 이미 카메라 캘리브레이션을 수행한 정보가 있으므로 카메라의 위치가 변경되어 다시 카메라 캘리브레이션이 필요한 상황에서도 이전에 옆 차선의 차량(261a)에 대해 적용하였던 카메라 캘리브레이션을 이용하여 다시 카메라 캘리브레이션을 수행할 수 있다.Referring to FIG. 9A , it can be seen that the vehicle 261a in the next lane is detected in the vehicle black box and camera calibration is performed based on this. Even when the vehicle 261a in the next lane moves and the size of the vehicle 261a in the next lane is reduced and accurate recognition is impossible (261b), since there is information that has already been calibrated in advance, the position of the camera is changed and camera calibration is required again. Even in a situation, camera calibration may be performed again using the camera calibration previously applied to the vehicle 261a in the next lane.

예를 들면 옆 차선의 차량(261a)이 마티즈로 실공간에서 3495*1495*1500mm의 제원을 가지는 차량이라고 할 때 도 9a의 첫번째 장면에서 가로가 80pixel로 검출되어 이를 기준으로 카메라 캘리브레이션을 수행하였다. 추후 차량이 주행중에 블랙박스가 촬영하는 화각이 변하거나 블랙박스의 위치 조정으로 촬영 중인 화면이 변경된 경우에는 다시 카메라 캘리브레이션을 수행해야 하는 경우가 있다.For example, assuming that the vehicle 261a in the next lane is a vehicle having dimensions of 3495*1495*1500mm in real space as the Matiz, the width is detected as 80 pixels in the first scene of FIG. 9A, and camera calibration is performed based on this. In the future, when the angle of view captured by the black box changes while the vehicle is driving or the screen being photographed is changed due to the location adjustment of the black box, camera calibration may need to be performed again.

이 때 종래에는 다시 수작업으로 기준 물체를 위치시키고 카메라 캘리브레이션을 수행해야했던 불편이 있었다. 그러나 본 발명에서는 이전에 카메라 캘리브레이션을 수행했던 객체를 추적하여, 데이버베이스(331)에 저장된 객체의 이미지와 비교할 필요도 없이, 다시 카메라 캘리브레이션을 수행할 수 있다.In this case, in the prior art, there was an inconvenience in that the reference object had to be manually positioned again and the camera had to be calibrated. However, in the present invention, the camera calibration can be performed again without the need to track the object on which the camera calibration has been performed before and compare it with the image of the object stored in the database 331 .

즉, 두번째 화면에서처럼 자동차 마티즈(261b)가 화면에서는 그 크기가 작아졌더라도 이전에 화면에서 검출된 차량(261a)의 정보를 이용하여 이번에 검출된 차량(261b)를 대상으로 카메라 캘리브레이션을 수행할 수 있다. 두번째 화면에서는 차량(261b)이 크기가 40pixel로 줄어들었더라도 크기가 줄어든 차량(261b)로 매칭부(340)에서 데이터베이스(331)를 조회하는 것이 아니라 첫번째 화면에서 검출된 차량(261a)를 가지고 카메라 캘리브레이션을 수행할 수 있다. 이를 통해 작은 이미지의 객체(261b)를 기준 물체로 카메라 캘리브레이션을 수행함에도 카메라 캘리브레이션의 정확도를 높일 수 있다.That is, as in the second screen, even if the size of the car Matiz 261b is reduced on the screen, camera calibration can be performed for the vehicle 261b detected this time using the information of the vehicle 261a previously detected on the screen. there is. In the second screen, even if the size of the vehicle 261b is reduced to 40 pixels, the matching unit 340 does not search the database 331 for the vehicle 261b that is reduced in size, but instead takes the vehicle 261a detected in the first screen and uses the camera. Calibration can be performed. Through this, even when the camera calibration is performed using the small image object 261b as the reference object, the accuracy of the camera calibration may be increased.

이는 본 발명이 영상 분석을 이용하여 카메라 캘리브레이션을 수행하므로, 현재 캘리브레이션을 수행하려는 영상의 프레임에 기준 물체로 사용할 적당한 객체가 없더라도 해당 영상 프레임의 전후로 기준 물체로 사용할 만한 객체가 있으면, 해당 객체를 추적하여 현재 프래임의 카메라 캘리브레이션이 가능하다는 장점이 있다.This is because the present invention performs camera calibration using image analysis, so even if there is no suitable object to be used as a reference object in the frame of the image to be currently calibrated, if there is an object that can be used as a reference object before and after the image frame, the object is tracked This has the advantage of being able to calibrate the camera of the current frame.

도 9b는 본 발명의 일 실시예에 따라 객체를 추적하여 카메라 캘리브레이션을 수행하는 경우의 예시도이다.9B is an exemplary diagram illustrating a case of performing camera calibration by tracking an object according to an embodiment of the present invention.

도 9b를 참고하면 시간 축을 기준으로 화면상에 객체 A, 객체 B, 객체 C가 일정 시간동안 노출되는 것을 볼 수 있다. 이 때 세개의 객체 중에서 가장 기준 물체로 적합한 객체는 객체 C라고 가정할 때, 객체 C > 객체 B > 객체 A 순으로 크기 정보를 구할 수 있다. 즉 객체 A가 촬영된 시점의 영상을 분석하기 위하여 카메라 캘리브레이션이 필요한 경우, 객체 C가 촬영된 시점의 영상을 기준으로 카메라 캘리브레이션을 수행하여, 객체 B의 실공간상의 크기 정보를 구하고, 이를 이용하여 다시 객체 A가 촬영된 시점의 영상에서 객체 A의 크기를 구할 수도 있다.Referring to FIG. 9B , it can be seen that object A, object B, and object C are exposed for a predetermined time on the screen based on the time axis. At this time, assuming that the object most suitable as a reference object among the three objects is object C, size information can be obtained in the order of object C > object B > object A. That is, if camera calibration is required to analyze the image at the time point A was photographed, camera calibration is performed based on the image at the time point object C was photographed to obtain information on the size of object B in real space, and using this Again, the size of the object A may be obtained from the image at the point in time when the object A is photographed.

도 10은 본 발명의 일 실시예에 따른 영상 분석을 이용한 카메라 캘리브레이션 방법의 순서도이다.10 is a flowchart of a camera calibration method using image analysis according to an embodiment of the present invention.

도 10을 참고하면, 본 발명의 일 실시예에 따른 영상 분석을 이용한 카메라 캘리브레이션 방법은 우선 현재 영상에 카메라 캘리브레이션 정보가 있는지 확인한다(S4100). 현재 카메라 캘리브레이션 정보가 유효한 경우에는 추가적인 카메라 캘리브레이션이 필요하지 않으므로 과정은 종료된다(S4200).Referring to FIG. 10 , in the method for calibrating a camera using image analysis according to an embodiment of the present invention, first, it is checked whether there is camera calibration information in the current image ( S4100 ). When the current camera calibration information is valid, since additional camera calibration is not required, the process ends (S4200).

그러나 만약 현재 카메라 캘리브레이션 정보가 카메라의 위치 변경이나 설정 변경 등으로 다시 카메라 캘리브레이션을 수행하여 해당 정보를 업데이트 해야 하는 경우에는 영상에서 객체를 검출하는 단계를 거친다(S4300). 검출된 객체들에 대해서는 크기와 비율을 기준으로 기준 물체로 사용할 객체를 선정한다(S4400).However, if the current camera calibration information needs to be updated by performing camera calibration again due to a camera position change or setting change, a step of detecting an object in the image is performed (S4300). For the detected objects, an object to be used as a reference object is selected based on the size and ratio (S4400).

기준 물체로 사용할 객체가 선정된 경우에는 매칭부(340)에 이를 전송하고(S4500), 매칭부(340)에서는 데이터베이스(331)에 저장된 객체의 이미지와 비교를 수행한다(S4600). 데이터베이스(331)에 저장된 이미지와 매칭이 되는 경우에는 해당 이미지의 제원을 조회하여 실공간상에서의 크기 정보를 확인한다(S4700).When an object to be used as a reference object is selected, it is transmitted to the matching unit 340 (S4500), and the matching unit 340 compares it with the image of the object stored in the database 331 (S4600). In the case of matching with the image stored in the database 331, the size information in the real space is checked by inquiring the specifications of the image (S4700).

이러한 과정을 통해 영상에서의 크기 정보와 실공간상에서의 크기 정보를 매칭시키고 이를 기준으로 카메라 캘리브레이션을 수행하여 2차원의 (x,y) 좌표를 3차원의 (X, Y, Z) 좌표로 변환할 수 있는 변환 매트릭스를 연산한다. 이렇게 연산한 변환 매트릭스를 이용하여 영상 내에서 기준 물체로 사용한 객체 외에 다른 객체의 실공간상에서의 크기 정보를 복원할 수 있다.Through this process, the size information in the image and the size information in real space are matched, and camera calibration is performed based on this to convert the two-dimensional (x,y) coordinates into three-dimensional (X, Y, Z) coordinates. Calculate the transformation matrix that can be done. By using the calculated transformation matrix, size information of an object other than the object used as a reference object in the image in real space can be restored.

이상 첨부된 도면을 참조하여 본 발명의 실시예들을 설명하였지만, 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자는 본 발명이 그 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 실시될 수 있다는 것을 이해할 수 있을 것이다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적이 아닌 것으로 이해해야만 한다.Although embodiments of the present invention have been described with reference to the accompanying drawings, those of ordinary skill in the art to which the present invention pertains can realize that the present invention can be implemented in other specific forms without changing the technical spirit or essential features. you will be able to understand Therefore, it should be understood that the embodiments described above are illustrative in all respects and not restrictive.

Claims (8)

캘리브레이션 장치가, 영상을 수신하는 단계;
상기 캘리브레이션 장치가, 상기 영상에서 하나 이상의 객체를 추출하는 단계;
상기 캘리브레이션 장치가, 상기 하나 이상의 객체 중에서 기준 물체로 사용할 객체를 선정하는 단계;
상기 캘리브레이션 장치가, 상기 기준 물체로 사용할 객체의 이미지와 매칭되는 이미지를 검색하는 단계; 및
상기 캘리브레이션 장치가, 상기 영상 내에서 상기 기준 물체로 사용할 객체를 표현하는 픽셀들이 차지하는 영역의 사이즈를 상기 검색된 이미지의 실공간상에서의 크기 정보를 이용하여 변환하는 카메라 캘리브레이션을 수행하는 단계를 포함하는,
영상 분석을 이용한 카메라 캘리브레이션 방법.
Receiving, by the calibration device, an image;
extracting, by the calibration device, one or more objects from the image;
selecting, by the calibration device, an object to be used as a reference object from among the one or more objects;
searching, by the calibration device, an image matching an image of an object to be used as the reference object; and
Comprising the step of performing, by the calibration apparatus, camera calibration converting the size of an area occupied by pixels representing an object to be used as the reference object in the image using size information in real space of the searched image,
A method of camera calibration using image analysis.
제1항에 있어서,
상기 영상을 수신하는 단계는,
실시간 스트리밍 영상 또는 녹화 저장된 영상 중에 하나를 수신하는 단계를 포함하는,
영상 분석을 이용한 카메라 캘리브레이션 방법.
The method of claim 1,
Receiving the image comprises:
Receiving one of a real-time streaming video or recorded and stored video,
A method of camera calibration using image analysis.
제1항에 있어서,
상기 영상에서 하나 이상의 객체를 추출하는 단계는,
상기 영상에 대해 윤곽선을 검출하는 알고리즘을 수행하여 객체의 윤곽선을 검출하는 단계를 포함하는,
영상 분석을 이용한 카메라 캘리브레이션 방법.
The method of claim 1,
Extracting one or more objects from the image comprises:
Comprising the step of detecting the outline of the object by performing an algorithm for detecting the outline on the image,
A method of camera calibration using image analysis.
제1항에 있어서,
상기 기준 물체로 사용할 객체를 선정하는 단계는,
추출된 각 객체를 대상으로 객체의 면적을 연산하고 상기 면적을 점수화(scoring)하여 기준 물체로 사용할 객체를 선정하는 단계를 포함하는,
영상 분석을 이용한 카메라 캘리브레이션 방법.
The method of claim 1,
The step of selecting an object to be used as the reference object comprises:
Comprising the step of calculating the area of the object for each extracted object and selecting an object to be used as a reference object by scoring the area,
A method of camera calibration using image analysis.
제1항에 있어서,
상기 기준 물체로 사용할 객체를 선정하는 단계는,
추출된 각 객체를 대상으로 추출 영역의 면적에 대한 객체의 면적의 비율을 연산하고, 상기 비율을 점수화(scoring)하여 기준 물체로 사용할 객체를 선정하는 단계를 포함하는,
영상 분석을 이용한 카메라 캘리브레이션 방법.
The method of claim 1,
The step of selecting an object to be used as the reference object comprises:
Comprising the step of calculating the ratio of the area of the object to the area of the extraction area for each extracted object, and selecting an object to be used as a reference object by scoring the ratio,
A method of camera calibration using image analysis.
제1항에 있어서,
상기 이미지를 검색하는 단계는,
웹 크롤링을 이용하여 특정 객체의 이미지와 상기 특정 객체의 크기 정보를 대응시켜 데이터베이스에 저장하는 단계를 포함하는,
영상 분석을 이용한 카메라 캘리브레이션 방법.
The method of claim 1,
The step of retrieving the image is
Comprising the step of storing the image of a specific object and the size information of the specific object in correspondence using web crawling in a database,
A method of camera calibration using image analysis.
제1항에 있어서,
카메라 캘리브레이션을 수행한 후, 기준 물체로 사용한 객체를 추적하는 단계; 및
상기 추적한 기준 물체의 크기 정보를 이용하여 카메라 캘리브레이션을 다시 수행하는 단계를 포함하는,
영상 분석을 이용한 카메라 캘리브레이션 방법.
The method of claim 1,
tracking an object used as a reference object after performing camera calibration; and
Comprising the step of performing camera calibration again using the size information of the tracked reference object,
A method of camera calibration using image analysis.
캘리브레이션 장치가, 사람을 촬영한 영상을 수신하는 단계;
상기 캘리브레이션 장치가, 상기 영상에서 사람 객체를 추출하는 단계;
상기 캘리브레이션 장치가, 상기 추출된 사람 객체의 얼굴을 인식하여 신원을 확인하는 단계; 및
상기 캘리브레이션 장치가, 상기 영상 내에서 상기 추출된 사람 객체를 표현하는 픽셀들이 차지하는 영역의 사이즈를 상기 신원이 확인된 사람의 실공간상에서의 키 정보를 이용하여 변환하는 카메라 캘리브레이션을 수행하는 단계를 포함하는,
영상 분석을 이용한 카메라 캘리브레이션 방법.
Receiving, by the calibration device, an image of a person;
extracting, by the calibration device, a human object from the image;
confirming, by the calibration device, an identity by recognizing the face of the extracted human object; and
performing camera calibration in which the calibration device converts the size of an area occupied by pixels representing the extracted human object in the image using key information in the real space of the person whose identity has been confirmed doing,
A method of camera calibration using image analysis.
KR1020160064723A 2016-05-26 2016-05-26 Method and apparatus for camera calibration using image analysis Active KR102386982B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020160064723A KR102386982B1 (en) 2016-05-26 2016-05-26 Method and apparatus for camera calibration using image analysis

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020160064723A KR102386982B1 (en) 2016-05-26 2016-05-26 Method and apparatus for camera calibration using image analysis

Publications (2)

Publication Number Publication Date
KR20170133666A KR20170133666A (en) 2017-12-06
KR102386982B1 true KR102386982B1 (en) 2022-04-14

Family

ID=60922485

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020160064723A Active KR102386982B1 (en) 2016-05-26 2016-05-26 Method and apparatus for camera calibration using image analysis

Country Status (1)

Country Link
KR (1) KR102386982B1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102020845B1 (en) * 2018-04-04 2019-09-11 주식회사 자비스넷 Calibration system and method for camera using object identification
KR102547321B1 (en) * 2018-06-01 2023-06-23 삼성전자주식회사 Image display device and operating method for the same
KR102628012B1 (en) * 2018-10-23 2024-01-22 삼성전자주식회사 Method and apparatus of auto calibration
KR102772950B1 (en) * 2021-12-06 2025-02-24 한국수산자원공단 Fish trait measurement method and computing device therefor

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100564372B1 (en) * 2003-07-01 2006-03-29 정욱진 Front Face Automatic Photography Camera System and Method for Automatic Cash Dispenser
CN106657812B (en) * 2008-03-03 2020-04-03 威智伦分析公司 A camera system and dynamic object classification method
KR102001659B1 (en) * 2012-11-19 2019-07-19 한국전자통신연구원 Method and apparatus for providing camera calibration for vehicles

Also Published As

Publication number Publication date
KR20170133666A (en) 2017-12-06

Similar Documents

Publication Publication Date Title
US9443143B2 (en) Methods, devices and systems for detecting objects in a video
AU2011202555B2 (en) Multi-view alignment based on fixed-scale ground plane rectification
JP4692371B2 (en) Image processing apparatus, image processing method, image processing program, recording medium recording image processing program, and moving object detection system
CN108111818A (en) Moving target active perception method and apparatus based on multiple-camera collaboration
KR102386982B1 (en) Method and apparatus for camera calibration using image analysis
US20140270362A1 (en) Fast edge-based object relocalization and detection using contextual filtering
US20180114067A1 (en) Apparatus and method for extracting objects in view point of moving vehicle
WO2014155979A1 (en) Tracking processing device and tracking processing system provided with same, and tracking processing method
US20210335010A1 (en) Calibration method and calibration apparatus
KR102152319B1 (en) Method of calculating position and size of object in 3d space and video surveillance system using the same
US10346709B2 (en) Object detecting method and object detecting apparatus
US9031355B2 (en) Method of system for image stabilization through image processing, and zoom camera including image stabilization function
US20190042869A1 (en) Image processing apparatus and control method therefor
KR101360999B1 (en) Real time data providing method and system based on augmented reality and portable terminal using the same
AU2014277855A1 (en) Method, system and apparatus for processing an image
CN113033348A (en) Overlook image correction method for pedestrian re-recognition, storage medium, and electronic device
Yamaguchi Three dimensional measurement using fisheye stereo vision
JP6860445B2 (en) Object distance detector
KR102050418B1 (en) Apparatus and method for alignment of images
CN112073640A (en) Panoramic information acquisition pose acquisition method, device and system
CN111833384A (en) Method and device for quickly registering visible light and infrared images
Schubert et al. Robust registration and filtering for moving object detection in aerial videos
JP6326622B2 (en) Human detection device
KR101300166B1 (en) Apparatus and method for detecting iris
CN112924707A (en) Vehicle speed detection device and method using image tracking

Legal Events

Date Code Title Description
PA0109 Patent application

Patent event code: PA01091R01D

Comment text: Patent Application

Patent event date: 20160526

PG1501 Laying open of application
A201 Request for examination
PA0201 Request for examination

Patent event code: PA02012R01D

Patent event date: 20201222

Comment text: Request for Examination of Application

Patent event code: PA02011R01I

Patent event date: 20160526

Comment text: Patent Application

E902 Notification of reason for refusal
PE0902 Notice of grounds for rejection

Comment text: Notification of reason for refusal

Patent event date: 20210920

Patent event code: PE09021S01D

E701 Decision to grant or registration of patent right
PE0701 Decision of registration

Patent event code: PE07011S01D

Comment text: Decision to Grant Registration

Patent event date: 20220330

GRNT Written decision to grant
PR0701 Registration of establishment

Comment text: Registration of Establishment

Patent event date: 20220412

Patent event code: PR07011E01D

PR1002 Payment of registration fee

Payment date: 20220412

End annual number: 3

Start annual number: 1

PG1601 Publication of registration