CN112067253A - Camera calibration method based on machine vision - Google Patents
Camera calibration method based on machine vision Download PDFInfo
- Publication number
- CN112067253A CN112067253A CN202010497239.XA CN202010497239A CN112067253A CN 112067253 A CN112067253 A CN 112067253A CN 202010497239 A CN202010497239 A CN 202010497239A CN 112067253 A CN112067253 A CN 112067253A
- Authority
- CN
- China
- Prior art keywords
- camera
- calibration
- machine vision
- angle
- detection function
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 28
- 238000009434 installation Methods 0.000 claims abstract description 10
- 238000003708 edge detection Methods 0.000 claims description 13
- 238000001514 detection method Methods 0.000 claims description 12
- 238000013461 design Methods 0.000 abstract description 3
- 238000003754 machining Methods 0.000 abstract 2
- 238000010586 diagram Methods 0.000 description 5
- 238000004519 manufacturing process Methods 0.000 description 4
- 230000000007 visual effect Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 3
- 230000007547 defect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 230000003416 augmentation Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000000087 stabilizing effect Effects 0.000 description 1
- 238000003860 storage Methods 0.000 description 1
- 238000003466 welding Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01M—TESTING STATIC OR DYNAMIC BALANCE OF MACHINES OR STRUCTURES; TESTING OF STRUCTURES OR APPARATUS, NOT OTHERWISE PROVIDED FOR
- G01M11/00—Testing of optical apparatus; Testing structures by optical methods not otherwise provided for
- G01M11/02—Testing optical properties
- G01M11/0242—Testing optical properties by measuring geometrical properties or aberrations
Landscapes
- Physics & Mathematics (AREA)
- Geometry (AREA)
- Chemical & Material Sciences (AREA)
- Analytical Chemistry (AREA)
- General Physics & Mathematics (AREA)
- Studio Devices (AREA)
Abstract
The invention provides a camera calibration method based on machine vision, which is characterized by comprising the following steps: step (1): the camera carries out image acquisition on the calibration pattern; step (2): calculating an included angle between the image and the horizontal direction; and (3): calibrating the camera according to the included angle; and (4): and (3) judging whether the angles of the cameras are parallel, if so, finishing the calibration of the cameras, and otherwise, continuing the step (2). After the method is assembled, the angle is corrected according to the real-time image of the camera, so that the installation errors introduced in each step can be compensated at one time, and the angle of the camera can be corrected in one step; the image angle is automatically identified through computer software, the angle does not need to be judged manually, and the means is scientific and quantitative; the clamp is simple in design, low in cost and low in machining cost, and can be manufactured without high-precision machining equipment.
Description
Technical Field
The invention relates to the technical field of machine vision, in particular to a camera calibration method based on machine vision.
Background
Along with the development of science and technology, the application scene of unmanned aerial vehicle that takes photo by plane is wider and wider, at small-size unmanned aerial vehicle lens module that takes photo by plane in assembly and production process, installation error can directly lead to shooting quality to descend, image distortion scheduling problem. The reason that this problem produced lies in, at the in-process of unmanned aerial vehicle production, unmanned aerial vehicle high definition camera lens module provides the factory production by the upper reaches supply chain as an solitary module, and CCD light sensing element in the camera lens module pastes the in-process of dress at the welding, can cause an angle error that is less than 2 degrees, when the camera lens module is installed the mechanical structure on unmanned aerial vehicle increases steady cloud platform, can cause the installation error about 1 degree again. Therefore, after the complete machine is assembled, the horizontal angle provided by the photosensitive element and the stability-increasing cradle head can generate an angle error which reaches 3 degrees to the maximum, and the angle is the installation angle error of the lens module. The presence of this error can cause the picture taken by the camera to be skewed.
The current common technical solution is to count the angle errors of a batch of lens modules, design the corresponding installation compensation angle, and offset the error angle of the lens modules on the installation structure. The prior art has the following defects: firstly, the specific error angle of the lens module is accurately measured without a scientific and quantitative means, and the horizontal inclination angle cannot be directly measured after the lens module is installed; secondly, due to the existence of manufacturing tolerance, the method of uniformly offsetting error angles in a mechanical structure mode cannot be suitable for all lens modules.
Therefore, after the camera is assembled, the inclination angle is determined according to the image of the camera, and a suitable horizontal offset angle is set in the stabilizing pan-tilt firmware of the camera, so that the picture shot by the camera is horizontal.
Disclosure of Invention
In view of the defects in the prior art, the invention aims to provide a camera calibration method based on machine vision.
In a first aspect, the present invention provides a camera calibration method based on machine vision, including the following steps:
step (1): the camera carries out image acquisition on the calibration pattern;
step (2): calculating an included angle between the image and the horizontal direction;
and (3): calibrating the camera according to the included angle;
and (4): and (3) judging whether the angles of the cameras are parallel, if so, finishing the calibration of the cameras, and otherwise, continuing the step (2).
Optionally, the step (1) comprises:
step (1-1): arranging the camera and the calibration pattern on a calibration fixture, and adjusting the camera and the calibration pattern to be horizontal through a bubble level meter;
step (1-2): the camera is started and a calibration pattern is photographed.
Optionally, between step (1) and step (2), further comprising:
step (2-0): the image is transmitted to a computer over a wireless network.
Optionally, the step (3) is specifically: and setting the included angle in holder software, and correcting the installation deviation of the camera through the holder software.
Optionally, the step (2) comprises:
step (2-1): extracting an image contour through an edge detection function;
step (2-2): extracting long straight lines meeting conditions from the image contour through a straight line detection function;
step (2-3): and measuring to obtain the angles between all the long straight lines and the horizontal line, and calculating the average value of the included angles.
Further, the edge detection function is a Canny edge detection function built in an OPENCV algorithm library.
Further, the straight line detection function is a HoughLines straight line detection function built in the OPENCV algorithm library.
Further, the step (2-3) is specifically: and when the number of the long straight lines exceeds a first threshold value and the average value of the angles of the long straight lines and the horizontal line is smaller than a second threshold value, the average value of the included angles is sent to holder software.
Compared with the prior art, the invention has the following beneficial effects:
1. according to the camera calibration method based on machine vision, provided by the invention, after the assembly is finished, the angle is corrected according to the real-time image of the camera, the installation error introduced in each step can be compensated at one time, and the camera angle is corrected in one step.
2. According to the camera calibration method based on machine vision, provided by the invention, the image angle is automatically identified through computer software, the angle does not need to be manually judged, and the means is scientific and quantitative.
3. The camera calibration method based on machine vision provided by the invention has the advantages of simple clamp design, low cost and low processing cost, and can be manufactured without high-precision processing equipment.
Drawings
Other features, objects and advantages of the present invention will become more apparent upon reading of the detailed description of the non-limiting embodiments with reference to the following drawings:
FIG. 1 is a schematic diagram of edge detection of a camera calibration method based on machine vision according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of line detection of a camera calibration method based on machine vision according to an embodiment of the present invention;
fig. 3 is a diagram illustrating an effect of line extraction in a camera calibration method based on machine vision according to an embodiment of the present invention.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
FIG. 1 is a schematic diagram of edge detection of a camera calibration method based on machine vision according to an embodiment of the present invention; FIG. 2 is a schematic diagram of line detection of a camera calibration method based on machine vision according to an embodiment of the present invention; referring to fig. 1 and 2, the method in the present embodiment includes the following steps:
step (1): the camera carries out image acquisition on the calibration pattern;
step (2): calculating an included angle between the image and the horizontal direction;
and (3): calibrating the camera according to the included angle;
and (4): and (3) judging whether the angles of the cameras are parallel, if so, finishing the calibration of the cameras, and otherwise, continuing the step (2).
In an alternative embodiment, the step (1) comprises:
step (1-1): arranging the camera and the calibration pattern on a calibration fixture, and adjusting the camera and the calibration pattern to be horizontal through a bubble level meter;
step (1-2): the camera is started and a calibration pattern is photographed.
In an optional embodiment, between the step (1) and the step (2), further comprising:
step (2-0): the image is transmitted to a computer over a wireless network.
In an optional embodiment, the step (3) is specifically: and setting the included angle in holder software, and correcting the installation deviation of the camera through the holder software.
In an alternative embodiment, the step (2) comprises:
step (2-1): extracting an image contour through an edge detection function;
step (2-2): extracting long straight lines meeting conditions from the image contour through a straight line detection function;
step (2-3): and measuring to obtain the angles between all the long straight lines and the horizontal line, and calculating the average value of the included angles.
In a further embodiment, the edge detection function is a Canny edge detection function built into the OPENCV algorithm library.
In a further embodiment, the line detection function is a HoughLines line detection function built into the OPENCV algorithm library.
In a further embodiment, the step (2-3) is specifically: and when the number of the long straight lines exceeds a first threshold value and the average value of the angles of the long straight lines and the horizontal line is smaller than a second threshold value, sending the average value of the included angles to holder software.
Generally speaking, a calibration fixture with a horizontal adjustment function and a visual calibration pattern can be manufactured, the visual calibration pattern can be a black and white checkerboard grid pattern or any pattern with a high-contrast horizontal straight line characteristic, and the arrangement angle of the fixture is adjusted through a bubble level meter, so that bubbles of the level meter are kept in the middle. The computer end stores upper computer software, can obtain the camera image in real time through the wireless network, process the picture gathered, extract the angle that the vision calibrates the pattern and put, and set up and correct the camera and install the deviation in the cloud terrace software.
In a specific embodiment, the following steps may be included:
1. the unmanned aerial vehicle camera is connected with the computer through WIFI, and for a person skilled in the art, the real-time image acquisition of the camera can be realized by different means, such as connecting the camera with a USB cable, or shooting a picture, storing the picture in a camera storage card and then exporting the picture to the computer;
2. extracting the image contour by using a Canny edge detection function built in an OPENCV algorithm library, processing the checkerboard visual calibration pattern to only reserve an edge part, and extracting the image contour by adopting different edge detection operators, such as: gradient operators, first order difference, Robert operators (cross difference), Sobel operators, Laplace operators (second order difference) and the like, and the purpose of extracting the image contour can be achieved through the operators by a person skilled in the art;
3. and extracting a long straight line meeting the conditions in the image contour by using a HoughLines straight line detection function built in an OPENCV algorithm library. Superposing and displaying red lines on a screen, averaging the angles of all horizontal straight lines, and displaying the final result as the angle of the visual calibration pattern;
4. when the detected straight lines are more than 6, the average angle of the straight lines is less than 3 degrees. Considering the angle to accord with the calibration condition, and sending the angle to the unmanned aerial vehicle stability augmentation holder software;
5. the cradle head receives the angle setting and automatically restarts, and the horizontal angle of the camera can be controlled to the angle sent in the previous step after restarting. The resulting image will appear horizontal. If there is still an angle greater than 0.1 degrees on the computer, the previous step will be repeated.
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by those skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.
Claims (8)
1. A camera calibration method based on machine vision is characterized by comprising the following steps:
step (1): the camera carries out image acquisition on the calibration pattern;
step (2): calculating an included angle between the image and the horizontal direction;
and (3): calibrating the camera according to the included angle;
and (4): and (3) judging whether the angles of the cameras are parallel, if so, finishing the calibration of the cameras, and otherwise, continuing the step (2).
2. The method of machine vision camera calibration according to claim 1, wherein the step (1) comprises:
step (1-1): arranging the camera and the calibration pattern on a calibration fixture, and adjusting the camera and the calibration pattern to be horizontal through a bubble level meter;
step (1-2): the camera is started and a calibration pattern is photographed.
3. The method for calibrating a camera for machine vision according to claim 1, wherein between the step (1) and the step (2), further comprising:
step (2-0): the image is transmitted to a computer over a wireless network.
4. The camera calibration method for machine vision according to claim 1, wherein the step (3) is specifically as follows: and setting the included angle in holder software, and correcting the installation deviation of the camera through the holder software.
5. The method of machine vision camera calibration of claim 1, wherein the step (2) comprises:
step (2-1): extracting an image contour through an edge detection function;
step (2-2): extracting long straight lines meeting conditions from the image contour through a straight line detection function;
step (2-3): and measuring to obtain the angles between all the long straight lines and the horizontal line, and calculating the average value of the included angles.
6. The method of machine vision camera calibration according to claim 5, wherein the edge detection function is a Canny edge detection function built in an OPENCV algorithm library.
7. The camera calibration method for machine vision according to claim 5, wherein the line detection function is a HoughLines line detection function built in an OPENCV algorithm library.
8. The camera calibration method for machine vision according to claim 5, wherein the steps (2-3) are specifically as follows: and when the number of the long straight lines exceeds a first threshold value and the average value of the angles of the long straight lines and the horizontal line is smaller than a second threshold value, the average value of the included angles is sent to holder software.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010497239.XA CN112067253A (en) | 2020-06-03 | 2020-06-03 | Camera calibration method based on machine vision |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010497239.XA CN112067253A (en) | 2020-06-03 | 2020-06-03 | Camera calibration method based on machine vision |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112067253A true CN112067253A (en) | 2020-12-11 |
Family
ID=73656461
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010497239.XA Pending CN112067253A (en) | 2020-06-03 | 2020-06-03 | Camera calibration method based on machine vision |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112067253A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113259598A (en) * | 2021-07-16 | 2021-08-13 | 深圳市赛菲姆科技有限公司 | Camera horizontal adjustment control method, system, terminal and storage medium |
CN113405528A (en) * | 2021-06-18 | 2021-09-17 | 天津市勘察设计院集团有限公司 | Total station assisted ball machine attitude measurement and leveling method and device |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102929074A (en) * | 2011-08-12 | 2013-02-13 | 华晶科技股份有限公司 | Lens calibration system of employing imaging technology and calibration method thereof |
CN103607540A (en) * | 2013-12-02 | 2014-02-26 | 南京南自信息技术有限公司 | Method for improving presetting bit accuracy of pan-tilt camera |
CN106485758A (en) * | 2016-10-31 | 2017-03-08 | 成都通甲优博科技有限责任公司 | Implementation method demarcated by a kind of unmanned plane camera calibration device, scaling method and streamline |
US20170372491A1 (en) * | 2016-06-28 | 2017-12-28 | Dassault Systemes | Computer-Implemented Method Of Calibrating A Camera |
CN108171669A (en) * | 2017-12-29 | 2018-06-15 | 星阵(广州)基因科技有限公司 | A kind of image correction method based on OpenCV algorithms |
CN109685800A (en) * | 2018-12-28 | 2019-04-26 | 豪威科技(上海)有限公司 | A kind of method of regulation mould plate and Fast Calibration camera external parameter |
CN110382358A (en) * | 2018-04-27 | 2019-10-25 | 深圳市大疆创新科技有限公司 | Holder attitude rectification method, holder attitude rectification device, holder, clouds terrace system and unmanned plane |
CN110992313A (en) * | 2019-11-15 | 2020-04-10 | 同致电子科技(厦门)有限公司 | Camera image center detection and center adjustment method based on machine vision |
-
2020
- 2020-06-03 CN CN202010497239.XA patent/CN112067253A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102929074A (en) * | 2011-08-12 | 2013-02-13 | 华晶科技股份有限公司 | Lens calibration system of employing imaging technology and calibration method thereof |
CN103607540A (en) * | 2013-12-02 | 2014-02-26 | 南京南自信息技术有限公司 | Method for improving presetting bit accuracy of pan-tilt camera |
US20170372491A1 (en) * | 2016-06-28 | 2017-12-28 | Dassault Systemes | Computer-Implemented Method Of Calibrating A Camera |
CN106485758A (en) * | 2016-10-31 | 2017-03-08 | 成都通甲优博科技有限责任公司 | Implementation method demarcated by a kind of unmanned plane camera calibration device, scaling method and streamline |
CN108171669A (en) * | 2017-12-29 | 2018-06-15 | 星阵(广州)基因科技有限公司 | A kind of image correction method based on OpenCV algorithms |
CN110382358A (en) * | 2018-04-27 | 2019-10-25 | 深圳市大疆创新科技有限公司 | Holder attitude rectification method, holder attitude rectification device, holder, clouds terrace system and unmanned plane |
CN109685800A (en) * | 2018-12-28 | 2019-04-26 | 豪威科技(上海)有限公司 | A kind of method of regulation mould plate and Fast Calibration camera external parameter |
CN110992313A (en) * | 2019-11-15 | 2020-04-10 | 同致电子科技(厦门)有限公司 | Camera image center detection and center adjustment method based on machine vision |
Non-Patent Citations (1)
Title |
---|
姚文韬: "一种优化的自适应摄像机标定算法", 《控制工程》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113405528A (en) * | 2021-06-18 | 2021-09-17 | 天津市勘察设计院集团有限公司 | Total station assisted ball machine attitude measurement and leveling method and device |
CN113405528B (en) * | 2021-06-18 | 2023-02-24 | 天津市勘察设计院集团有限公司 | Total station assisted ball machine attitude measurement and leveling method and device |
CN113259598A (en) * | 2021-07-16 | 2021-08-13 | 深圳市赛菲姆科技有限公司 | Camera horizontal adjustment control method, system, terminal and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112669394B (en) | Automatic calibration method for vision detection system | |
CN104581136B (en) | The calibration method of image calibration system and stereo camera | |
CN101377918B (en) | Electronic display screen system, method and system for correcting electronic display screen brightness | |
CN106600644B (en) | Parameter correction method and device for panoramic camera | |
CN109712192B (en) | Camera module calibration method and device, electronic equipment and computer readable storage medium | |
WO2017088469A1 (en) | High-precision automatic optical detection system and method based on mechanical arm | |
CN112067253A (en) | Camera calibration method based on machine vision | |
US20160104284A1 (en) | Post-manufacture camera calibration | |
CN103763546A (en) | Light source difference correction method for monomer correction of mobile phone camera | |
CN109410140B (en) | Distortion correction method, device and system and computer readable storage medium | |
CN105407342A (en) | Image Calibration System And Calibration Method Of A Stereo Camera | |
CN108234824A (en) | Shadow correction detection parameters determine, correct detection method and device, storage medium, fisheye camera | |
CN107995396B (en) | Two camera modules and terminal | |
CN105791786A (en) | System and method for automatically adjusting smoothness of projection surface | |
CN112767338A (en) | Assembled bridge prefabricated part hoisting and positioning system and method based on binocular vision | |
CN113793270A (en) | Aerial image geometric correction method based on unmanned aerial vehicle attitude information | |
CN114302121A (en) | Image correction inspection method, device, electronic equipment and storage medium | |
CN112616018A (en) | Stackable panoramic video real-time splicing method | |
CN116337412A (en) | Screen detection method, device and storage medium | |
CN111586401A (en) | Optical center testing method, device and equipment | |
US20200045246A1 (en) | Image processing method, electronic device, and computer-readable storage medium | |
CN110992430B (en) | Multi-camera calibration device and calibration method | |
CN110942434B (en) | Display compensation system and method of display panel | |
CN112615972A (en) | Method and device for automatically correcting DPI (deep Power Point) of high-speed scanner | |
CN109584313B (en) | Camera calibration method and device, computer equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20201211 |
|
RJ01 | Rejection of invention patent application after publication |