CN109087354A - A kind of position algorithm of the best object distance of automatic search and image distance - Google Patents

A kind of position algorithm of the best object distance of automatic search and image distance Download PDF

Info

Publication number
CN109087354A
CN109087354A CN201810993405.8A CN201810993405A CN109087354A CN 109087354 A CN109087354 A CN 109087354A CN 201810993405 A CN201810993405 A CN 201810993405A CN 109087354 A CN109087354 A CN 109087354A
Authority
CN
China
Prior art keywords
image
servo
distance
object distance
algorithm
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
Application number
CN201810993405.8A
Other languages
Chinese (zh)
Inventor
陈斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Lin Yan Precision Technology Co Ltd
Original Assignee
Zhejiang Lin Yan Precision Technology Co Ltd
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 Zhejiang Lin Yan Precision Technology Co Ltd filed Critical Zhejiang Lin Yan Precision Technology Co Ltd
Priority to CN201810993405.8A priority Critical patent/CN109087354A/en
Publication of CN109087354A publication Critical patent/CN109087354A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection

Abstract

The invention discloses the position algorithms that one kind searches for best object distance and image distance automatically, comprising the following steps: servo origin resets and moves to zero point;From servo origin, each servo metric element shoots a picture by camera, and numbers storage, until servo motion to the upper limit is ended;The piece image of storage is shown, and given observation area, carry out image definition detection, the present invention is before testing product, acquire several product images, the optimum photographing position of product is analyzed according to image definition, servo position is corrected on this basis, to reach optimal camera site, it can be realized the image distance and object distance that best camera is switched fast after replacing product by the algorithm, without manual adjustment, efficiency greatly improves, and the judgement of clarity is also unified standard, previous artificial eye identification error is made to greatly reduce, the algorithm is widely used, with more vast market prospect, convenient for promoting.

Description

A kind of position algorithm of the best object distance of automatic search and image distance
Technical field
The present invention relates to automatic measurement technique field, specially a kind of position calculation for searching for best object distance and image distance automatically Method.
Background technique
During vision-based detection, due to the presence of the certain difference in height of measured object, not when shooting picture It can be operated with unique object distance with image distance, if it is desired to needing operator when individually checking the image of a certain height and position The image distance and object distance for manually adjusting shooting of work gradually, and the judgement of clarity is also to go to differentiate by artificial eye, in this way The mode of detection not only low efficiency, and artificial eye judgement also has certain subjectivity, and there are biggish errors.
Summary of the invention
The problem of for background technique, the present invention provides the positions that one kind searches for best object distance and image distance automatically Algorithm.
To achieve the above object, the invention provides the following technical scheme: a kind of position for searching for best object distance and image distance automatically Set algorithm, comprising the following steps:
S10: servo origin resets and moves to zero point;
S20: from servo origin, each servo metric element shoots a picture by camera, and numbers storage, End to servo motion to the upper limit;
S30: the piece image of storage being shown, and given observation area, carries out image definition detection.
As a preferred technical solution of the present invention, in step S30, the method for specific image definition detection Are as follows:
Image relative contrast is calculated according to the gray value of adjacent pixel values, after executing every time, image is returned and specifies region Contrast difference returns to contrast score, by the contrast point for analyzing each image by keeping all optical parameters consistent Number, obtains optimal contrast score, according to the number for the image for obtaining optimal contrast score, determines optimal servo bit It sets, realizes the adjusting of best image distance, object distance.
As a preferred technical solution of the present invention, in step S20, each servo metric element of object distance is 1mm.
Compared with prior art, the beneficial effects of the present invention are: the present invention is before testing product, several product figures are acquired Picture analyzes the optimum photographing position of product according to image definition, servo position is corrected on this basis, to reach optimal Camera site can be realized the image distance and object distance that best camera is switched fast after replacing product by the algorithm, adjust without artificial Section, efficiency greatly improve, and the judgement of clarity is also unified standard, and previous artificial eye identification error is made to subtract significantly Small, which is widely used, and has more vast market prospect, convenient for promoting.
Detailed description of the invention
Fig. 1 is the position algorithm flow diagram that one kind provided by the invention searches for best object distance and image distance automatically;
Fig. 2 is the position algorithm operation interface schematic diagram that one kind provided by the invention searches for best object distance and image distance automatically;
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
Please referring to Fig. 1 and Fig. 2, the present invention provides a kind of position algorithm for searching for best object distance and image distance automatically, including with Lower step:
S10: servo origin resets and moves to zero point;
S20: from servo origin, each servo metric element shoots a picture by camera, and numbers storage, End to servo motion to the upper limit;
S30: the piece image of storage being shown, and given observation area, carries out image definition detection.
The present invention adjusts servomechanism installation by assembling corresponding object distance and image distance in traditional visual detection equipment, passes through The burned above-mentioned algorithm of control cabinet is moved to control the servomechanism installation of corresponding object distance and image distance, finally realizes optimal object Away from and image distance position.
In the specific implementation process, in step S30, the method for specific image definition detection are as follows:
Image relative contrast is calculated according to the gray value of adjacent pixel values, after executing every time, image is returned and specifies region Contrast difference returns to contrast score, by the contrast point for analyzing each image by keeping all optical parameters consistent Number, obtains optimal contrast score, according to the number for the image for obtaining optimal contrast score, determines optimal servo bit It sets, realizes the adjusting of best image distance, object distance.
In the specific implementation process, in step S20, each servo metric element of object distance is 1mm.
Based on above-mentioned, present invention has the advantage that: the present invention acquires several product images, root before testing product According to the optimum photographing position of image definition analysis product, servo position is corrected on this basis, to reach optimal shooting Position can be realized the image distance and object distance that best camera is switched fast after replacing product by the algorithm, be not necessarily to manual adjustment, effect Rate greatly improves, and the judgement of clarity is also unified standard, makes previous artificial eye identification error greatly reduce, the calculation Method is widely used, and has more vast market prospect, convenient for promoting.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention Made any modifications, equivalent replacements, and improvements etc., should all be included in the protection scope of the present invention within mind and principle.

Claims (3)

1. the position algorithm that one kind searches for best object distance and image distance automatically, it is characterised in that the following steps are included:
S10: servo origin resets and moves to zero point;
S20: from servo origin, each servo metric element shoots a picture by camera, and numbers storage, until watching Clothes move to upper limit cut-off;
S30: the piece image of storage being shown, and given observation area, carries out image definition detection.
2. the position algorithm that one kind according to claim 1 searches for best object distance and image distance automatically, it is characterised in that: Yu Bu In rapid S30, the method for specific image definition detection are as follows:
Image relative contrast is calculated according to the gray value of adjacent pixel values, after executing every time, image is returned and specifies regional correlation Difference returns to contrast score, by analyzing the contrast score of each image, obtains by keeping all optical parameters consistent Optimal contrast score is taken, according to the number for the image for obtaining optimal contrast score, determines optimal servo position, it is real The now adjusting of best image distance, object distance.
3. the position algorithm that one kind according to claim 1 searches for best object distance and image distance automatically, it is characterised in that: Yu Bu In rapid S20, each servo metric element of object distance is 1mm.
CN201810993405.8A 2018-08-29 2018-08-29 A kind of position algorithm of the best object distance of automatic search and image distance Pending CN109087354A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810993405.8A CN109087354A (en) 2018-08-29 2018-08-29 A kind of position algorithm of the best object distance of automatic search and image distance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810993405.8A CN109087354A (en) 2018-08-29 2018-08-29 A kind of position algorithm of the best object distance of automatic search and image distance

Publications (1)

Publication Number Publication Date
CN109087354A true CN109087354A (en) 2018-12-25

Family

ID=64795164

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810993405.8A Pending CN109087354A (en) 2018-08-29 2018-08-29 A kind of position algorithm of the best object distance of automatic search and image distance

Country Status (1)

Country Link
CN (1) CN109087354A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030081137A1 (en) * 2001-10-26 2003-05-01 Fuji Photo Film Co., Ltd. Device and method for autofocus adjustment
CN101813946A (en) * 2009-02-19 2010-08-25 中国科学院自动化研究所 Automatic object distance adjusting method and device of imaging system
CN102062929A (en) * 2010-11-27 2011-05-18 长春迪瑞医疗科技股份有限公司 Automatic focusing method and device for microscope system
CN104215215A (en) * 2014-08-21 2014-12-17 深圳市金立通信设备有限公司 Ranging method
CN106154688A (en) * 2015-04-07 2016-11-23 中兴通讯股份有限公司 A kind of method and device of auto-focusing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030081137A1 (en) * 2001-10-26 2003-05-01 Fuji Photo Film Co., Ltd. Device and method for autofocus adjustment
CN101813946A (en) * 2009-02-19 2010-08-25 中国科学院自动化研究所 Automatic object distance adjusting method and device of imaging system
CN102062929A (en) * 2010-11-27 2011-05-18 长春迪瑞医疗科技股份有限公司 Automatic focusing method and device for microscope system
CN104215215A (en) * 2014-08-21 2014-12-17 深圳市金立通信设备有限公司 Ranging method
CN106154688A (en) * 2015-04-07 2016-11-23 中兴通讯股份有限公司 A kind of method and device of auto-focusing

Similar Documents

Publication Publication Date Title
KR101898947B1 (en) Defect detection method and defect detection system
CN109451289B (en) Method and system for detecting and correcting projector
CN105491271B (en) The method and device of secondary light source adjusting is carried out in Image Acquisition
KR20160148596A (en) Depth sensor calibration and per-pixel correction
CN105227802B (en) A kind of self-adaptation control method quickly scanned towards best quality image and system
WO2018121269A1 (en) Film detection system, detection method, and device
CN106226316A (en) A kind of single camera wide visual field vision thread detecting device and detection method thereof
CN106534683B (en) Intelligent camera replaces the method and its system of Background in real time
KR101347450B1 (en) Image sensing method using dual camera and apparatus thereof
CN105072330B (en) A kind of automatic focusing method of line-scan digital camera
CN109949362A (en) A kind of material visible detection method
CN110261069B (en) Detection method for optical lens
CN109886958B (en) Method, device and system for automatically identifying welding seam position based on square tube
CN111062961A (en) Contact lens edge defect detection method based on deep learning
CN107860773A (en) Automatic optical detecting system and its bearing calibration for PCB
CN116433780B (en) Automatic calibration method for laser structured light based on machine vision
CN110956627A (en) Intelligent optical detection sample characteristic and flaw intelligent lighting image capturing method and device
CN105865372A (en) Pipeline roundness value automatic detection system and detection method
CN110646431A (en) Automatic teaching method of gluing sensor
CN104197850A (en) Component pin detection method and device based on machine vision
CN109064439A (en) Single-sided illumination formula light guide plate shadow defect extracting method based on subregion
CN109087354A (en) A kind of position algorithm of the best object distance of automatic search and image distance
CN106152968B (en) A kind of pipeline circularities automatic testing method
CN104050676B (en) A kind of backlight image detecting method and device based on Logistic regression models
CN206114545U (en) Singly take photograph wide visual field of camera vision thread detection device

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
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20181225