CN104284095B - The fast automatic focusing method and system of a kind of long-focus visible ray industrial lens - Google Patents

The fast automatic focusing method and system of a kind of long-focus visible ray industrial lens Download PDF

Info

Publication number
CN104284095B
CN104284095B CN201410585995.2A CN201410585995A CN104284095B CN 104284095 B CN104284095 B CN 104284095B CN 201410585995 A CN201410585995 A CN 201410585995A CN 104284095 B CN104284095 B CN 104284095B
Authority
CN
China
Prior art keywords
focus
image
focusing
definition
camera
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
CN201410585995.2A
Other languages
Chinese (zh)
Other versions
CN104284095A (en
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.)
Fujian Forecam Optics Co Ltd
Original Assignee
Fujian Forecam Optics 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 Fujian Forecam Optics Co Ltd filed Critical Fujian Forecam Optics Co Ltd
Priority to CN201410585995.2A priority Critical patent/CN104284095B/en
Publication of CN104284095A publication Critical patent/CN104284095A/en
Application granted granted Critical
Publication of CN104284095B publication Critical patent/CN104284095B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The present invention relates to the automatic focus area of long-focus visible ray industrial lens, the fast automatic focusing method and system of especially a kind of long-focus visible ray industrial lens based on graphical analysis, quick focusing strategy, adaptive rate/step length searching strategy, compatible direct current/stepper motor, colour/black white image self adaptation, the characteristic parameter of user's restructural and scalable definition Evaluation Strategy that the auto focusing method is linked using the adaptive algorithm based on graphical analysis, with focal length;The characteristics of FPGA and MCU is organically combined and is given full play to respective on Software for Design by the autofocus system on hardware, effectively task distribution and resource consolidation are carried out using device intrinsic advantage, so that circuit structure is fairly simple, automatic focusing function is more perfect, reliable and stable, rapid sensitive, the automatic focusing function of high accuracy can be realized, the fast automatic focusing demand of the most long-focus visible ray industrial lens of in the market is disclosure satisfy that.

Description

The fast automatic focusing method and system of a kind of long-focus visible ray industrial lens
Technical field
The present invention relates to the automatic focus area of long-focus visible ray industrial lens, especially a kind of long-focus visible ray industry The fast automatic focusing method and system of camera lens.
Background technology
With " safety China ", the iterative method of " smart city " work, security concepts increasingly go deep into ordinary citizen's Daily life, and no longer it is such as bank, prison institute, the exclusive symbol of key project, the importance of safety defense monitoring system is more convex It is existing.Conventional monitoring system pursues breakthrough from zero first, and deterrent effect occupies leading position, has developed into possess later The ability of the more high-level such as alarm, record.Recently constantly it is reported that, existing monitoring system generally existing distance is near, point The low shortcoming of resolution, the image of acquisition only can substantially be judged that the help that the detection to some burst cases is provided is limited, prestige Fear effect to substantially reduce.
For the demand to higher monitoring effect, the industrial lens in monitoring project are generally turned to long-focus system by people Row, the image higher to obtain farther, resolution ratio.But because the long focal length lens depth of field is limited, with the difference of object observing, gather Burnt position needs frequent regulation, and the demand focused on automatically is increasingly vigorous, but due to speed, target motion weight, atmospheric agitation etc. Influence, the automatic focusing of long-focus industrial lens implements not a duck soup, and the alternative product of in the market is actually rare.
The Techniques of Automatic Focusing that traditional long-focus pick-up lens is used is largely to be based on range measurement principle in the early time, such as red Outer telemetry and ultrasonic ranging method etc., extraordinary camera lens also have the case using somewhat complex design schemes such as zoom linkages, but cost Very high, most civilian, industrial occasions are difficult to bear.Techniques of Automatic Focusing based on image is in the wider short-focus mirror of field depth Head(Such as all-in-one, handheld device)Middle application is more, long-focus industrial lens then because field depth is smaller, atmospheric effect compared with The technical factor such as big and rarely have using traditional Techniques of Automatic Focusing based on image.
The content of the invention
It is applicable that scene is single, focusing speed conflicts, no with existing between focusing accuracy to solve existing auto focusing method The problem of long-focus industrial lens automatic focusing requirements can be met, it is an object of the invention to provide a kind of based on image procossing The fast automatic focusing method and system of long-focus visible ray industrial lens.
To achieve these goals, technical scheme one is:A kind of long-focus visible ray industrial lens it is quick Auto focusing method, comprises the following steps:
Step S1:Using focusing drive module driving focus motor, the distance of regulation camera lens and imaging sensor, to reach Best focus position, acquisition picture rich in detail;
Step S2:Real-time scenery image is obtained from camera lens using image capture module, collection is needed by subsequent analysis View data;
Step S3:Interference signal in every image, characteristic information extraction are filtered using image processing module, according to predetermined Analysis strategy, it is determined that the position of focal plane where optimal definition;
Step S4:Using camera integration control or the integration time for exposure of identification module control or identification camera, pass through The direction of drive module of focusing control focus motor rotation and speed, reach the purpose that definition is precisely obtained.
Further, in step s3, described image processing module is controlled using the SHUTT shuttle algorithm based on anticipation Focusing drive module, specific steps include:Direction anticipation extracts value of maximum articulation with determination, speed decision-making with determining, recording Searched for and final positioning with theoretical most clear place, gear clearance amendment is back to;Wherein, extract value of maximum articulation in record and return During the step that extremely theory is most clearly located, focus motor is moved using speed change/step-length, and focusing is divided into thick focusing gathers with fine In burnt two stages, different maximum value search strategies is used in the different stages, reaches after theoretical definition point, enters gear Clearance amendment is searched for and final positioning step.
Further, using different maximum value search strategies be in the different stages at camera lens in the fuzzy stage or When clearly trend is not obvious, using high speed/big step length searching;When camera lens, which is in, tends to clear state, using low speed/small step-length Search.
Further, in step s 2, the mark that described image acquisition module will be obtained by video frequency processing chip from camera The analog video data of quasi- format color or black-and-white image signal is converted into standard digital video data, and by standard digital video Data are sent to image processing module, regard this signal as focusing algorithm video source signal.
Further, in step s3, described image processing module includes image preprocessing submodule and image procossing Module, described image pretreatment submodule receives the standard digital video data sent of image capture module and carries out image filtering With brightness, color extraction, noise is filtered using many subdomain focus functions, image information useful, with a high credibility is obtained, it is ensured that after The reliability of continuous analysis;Described image handles the feature that submodule is distributed according to each image brightness, color, space clustering, leads to Cross follow-on weighting SOBEL algorithms object selection and initial analysis statistics is carried out to the definition of picture.
Further, in step s3, when described image processing module detects feature value changes beyond predetermined threshold, tool There is the ability for voluntarily starting and focusing on automatically, control compatible direct current or driving stepper motor camera lens, which go to most clear place, to be stopped;It is described Image processing module also carries out judging whether to start the observation of steps focused on automatically, is combined using definition values with brightness value Dual judgement, by compare the absolute difference of current scene and the automatic focus value of previous field whether be more than start it is automatic focus on it is set Fixed threshold value, and whether combine the absolute difference of the brightness value of current scene and the brightness value of previous field picture automatic poly- more than starting Threshold value set by Jiao, come judge whether start focus on or be defined as automatically next time it is gradual caused by natural environment, and then Alternative reference value, it is to avoid erroneous judgement.
Further, in step s3, described image processing module employs the focusing calculation that target area can be reconstructed automatically Method, to avoid high-speed moving object to the erroneous judgement caused by the influence of definition.
Further, in step s3, described image processing module uses the Fast Search linked with focal length, when certainly Dynamic focusing operation is that when being caused by camera lens zoom, the focal position fed back by camera lens judges that camera lens is in Yuan Jiao areas or nearly Jiao Area, does not very pay close attention in the of short duration time of definition still in image scaling, human eye, quickly determines to gather with reference to current zoom order Direction and step-length that burnt microscope group is moved first, realize the anticipation and action focused on during camera lens zoom, final to improve poly- Burnt speed.
Further, in step s 4, the camera integration control or identification module use Change of integral time or knowledge Other method, reduction focuses on the speed of microscope group within the time of integration of camera, and the influence that reduction motion is evaluated definition is obtained more Plus accurate definition evaluating, the number of repetition of focusing is especially reduced under severe conditions, improves quick focusing power.
To achieve these goals, technical scheme two is:A kind of long-focus visible ray industrial lens it is quick Autofocus system, it is characterised in that including:
Focusing drive module, the distance for driving focus motor, regulation camera lens and imaging sensor is optimal poly- to reach Burnt position, acquisition picture rich in detail;
Image capture module, for obtaining real-time scenery image from lens camera, is needed to gather picture number by subsequent analysis According to;
Image processing module, for filtering the interference signal in every image, characteristic information extraction, according to predetermined analysis Strategy, it is determined that the position of focal plane where optimal definition;And
Camera integration is controlled or identification module, the integration time for exposure for controlling or recognizing camera, is driven by focusing The direction of dynamic model block control focus motor rotation and speed, reach the purpose that definition is precisely obtained.
The present invention is conscientiously to have studied the adaptability of the auto-focusing algorithm based on image procossing, understands long-focus visible The picture matter and architectural characteristic of light microscopic head, are fully understanding and are passing through on the basis of lot of experiments to it, have drawn above-mentioned automatic Focus method and system.Auto-focusing algorithm based on image procossing its be based on the visual texture or object of measured target Cluster analysis, is digitized collection to scene image first, then by corresponding sharpness evaluation function to image clearly Degree is judged, and then microscope group movement is focused on by quick focusing search, control strategy control, to obtain optimal image matter Amount.Based on working method above, realizing the key problem of fast automatic focusing can be attributed to:The evaluation of image definition, The selection of focusing sampling window, focusing search control strategy, camera parameter compensation adjustment.
Wherein, the focusing automatically that the selection of focusing sampling window and focusing search control strategy are handled picture is most important. On the other hand global focus is not applied to for the Small object image that background accounts for significant proportion, is neglected due on the one hand computationally intensive Many defects such as field moving target influence proportion rise, occur in that adaptive local window focuses on the research of sampling.Focus on sampling The selection in region directly influences the speed and precision of focusing algorithm, and good local window, which focuses on sampling, can reduce relative computing Amount, reduction motion blur influence, ultimately help to improve focusing speed and focusing accuracy.For conditional camera, mould is focused on Block can control or obtain it and integrate the time for exposure, and actually such camera is not rarely seen in the market, in the time of integration The deceleration for focusing on microscope group even moves stopping, all contributing to the evaluation of image definition.
Compared with other common Techniques of Automatic Focusing solutions, the present invention has advantages below:The automatic focusing side Method is using the adaptive algorithm based on graphical analysis and the quick focusing strategy of focal length linkage, adaptive rate/step length searching plan Summary, compatible direct current/stepper motor, colour/black white image self adaptation, the characteristic parameter of user's restructural and scalable clear Spend Evaluation Strategy.FPGA and MCU is organically combined and given full play on Software for Design each by the autofocus system on hardware From the characteristics of, effectively utilize the progress task distribution and resource consolidation of device intrinsic advantage so that circuit structure is fairly simple, automatically Focusing function is more perfect, it is possible to achieve reliable and stable, rapid sensitive, the automatic focusing function of high accuracy, disclosure satisfy that city The fast automatic focusing demand of most long-focus visible ray industrial lens on field.
Make further details of elaboration to the present invention with reference to the accompanying drawings and detailed description.
Brief description of the drawings
Fig. 1 is the theory diagram of the embodiment of the present invention.
Fig. 2 is the exemplary plot of focusing sampling window.
In Fig. 1:A. preceding fixation group A, A-1. bear crescent moon lens A-1, A-2. biconvex lens A-2, A-3. biconvex lens A-3, A-4. biconcave lens A-4;B. zoom group B, B-1. biconcave lens B-1, B-2. biconcave lens B-2, B-3. biconvex lens B-3;C. The positive crescent moon lens C-2 of compensation group C, C-1. biconcave lens C-1, C-2.;D. iris component D;E. fixed group E, E-1. are double afterwards The positive positive crescent moon lens E- of crescent moon lens E-2, E-3. biconvex lens E-3, E-4. biconcave lens E-4, E-5. of convex lens E-1, E-2. 5, the E-6. positive crescent moon lens E-7 of negative crescent moon lens E-6, E-7..
Embodiment
As shown in figure 1, a kind of fast automatic focusing system of long-focus visible ray industrial lens, including:Focusing driving mould Block, the distance for driving focus motor, regulation camera lens and imaging sensor, to reach best focus position, obtain clear figure Picture;Image capture module, for obtaining real-time scenery image from lens camera, is needed to gather view data by subsequent analysis;Figure As processing module, for filtering the interference signal in every image, characteristic information extraction, according to predetermined analysis strategy, it is determined that Position of focal plane where optimal definition;And camera integration control or identification module, for controlling or recognizing camera The time for exposure is integrated, direction and the speed of focus motor rotation are controlled by drive module of focusing, reaches that definition is precisely obtained Purpose.
In the present embodiment, the autofocus system is connected to receive video counts by camera interface with camera/camcorder According to, be connected with camera lens by lens interface to adjust the position of camera lens, described image acquisition module carries out IMAQ and caching, Described image processing module carries out graphical analysis and decision-making/control, and the camera integration control or identification module carry out sequential control System, the positional information of described image acquisition module analysis camera lens simultaneously passes through the position of stepping/DC MOTOR CONTROL camera lens.
As shown in figure 1, a kind of fast automatic focusing method of long-focus visible ray industrial lens, comprises the following steps:
Step S1:Using focusing drive module driving focus motor, the distance of regulation camera lens and imaging sensor, to reach Best focus position, acquisition picture rich in detail;
Step S2:Real-time scenery image is obtained from camera lens using image capture module, collection is needed by subsequent analysis View data;
Step S3:Interference signal in every image, characteristic information extraction are filtered using image processing module, according to predetermined Analysis strategy, it is determined that the position of focal plane where optimal definition;
Step S4:Using camera integration control or the integration time for exposure of identification module control or identification camera, pass through The direction of drive module of focusing control focus motor rotation and speed, reach the purpose that definition is precisely obtained.
In the present embodiment, the image processing module of the step S3 is controlled using the SHUTT shuttle algorithm based on anticipation Focusing drive module, specific steps include:Direction anticipation extracts value of maximum articulation with determination, speed decision-making with determining, recording Searched for and final positioning with theoretical most clear place, gear clearance amendment is back to;Wherein, extract value of maximum articulation in record and return During the step that extremely theory is most clearly located, focus motor is moved using speed change/step-length, and focusing is divided into thick focusing gathers with fine In burnt two stages, different maximum value search strategies is used in the different stages, traditional algorithm focusing speed is solved well Slow the problem of, reach after theoretical definition point, enter gear clearance amendment search and final positioning step.
In the present embodiment, it is in the fuzzy stage at camera lens using different maximum value search strategies in the different stages Or clear trend it is unobvious when, using at a high speed/big step length searching;When camera lens, which is in, tends to clear state, using low speed/small Step length searching.Namely the speed of camera motion is by between current video frame image definition peak value and focusing algorithm output peak value Absolute difference, variation tendency are comprehensively determined.The present invention carries out small range and gathered again to reduce focus motor speed to greatest extent Jiao, now speed very slow, scope very little, most clearly locates so as to focus on microscope group and reach.
In the present embodiment, the image capture module of the step S2 has colour/black white image adaptation function, and it leads to Cross video frequency processing chip and the analog video data of the standard system colour obtained from camera or black-and-white image signal is converted into mark Quasi- digital of digital video data(Such as BT.656 signals), and standard digital video data are sent to image processing module, this is believed Number it is used as focusing algorithm video source signal.
In the present embodiment, the image processing module of the step S3 includes image preprocessing submodule and image procossing Module, described image pretreatment submodule receives the standard digital video data sent of image capture module and carries out image filtering With brightness, color extraction, noise is filtered using many subdomain focus functions, image information useful, with a high credibility is obtained, it is ensured that after The reliability of continuous analysis;Described image processing module uses the adaptive algorithm based on graphical analysis, the own letter according to image Breath judges whether image is clear, drastically increases the accuracy that camera lens is clearly focused on, while providing feedback signal control camera lens Motion, it is not necessary to which extra signal source and correspondingly received sensor, reduction system volume simultaneously reduce cost.Described image processing The feature that submodule is distributed according to each image brightness, color, space clustering, passes through follow-on weighting SOBEL algorithm pattern pictures Evaluation function carries out initial analysis statistics to the definition of picture;In addition, the present invention can also use scalable definition Evaluation Strategy, can carry out upgrading improvement to existing definition evaluation in design studies afterwards and parameter is reconstructed.
In the present embodiment, when described image processing module detects feature value changes beyond predetermined threshold, with voluntarily Start the ability focused on automatically, control compatible direct current or driving stepper motor camera lens, which go to most clear place, to be stopped;At described image Reason module also carry out judging whether to start the observation of steps focused on automatically, using definition values combined with brightness value it is dual Judge whether the threshold started set by automatic focus on is more than by the absolute difference for comparing current scene and the automatic focus value of previous field Value, and whether the brightness value of combination current scene and the absolute difference of the brightness value of previous field picture are set more than automatic focusing is started Fixed threshold value, come judge whether start focus on or be defined as automatically next time it is gradual caused by natural environment, and then substitute ginseng Examine value, it is to avoid erroneous judgement.
In the present embodiment, the image processing module of the step S3 employs the focusing calculation that target area can be reconstructed automatically Method, to avoid high-speed moving object to the erroneous judgement caused by the influence of definition.The area proportion of target, dynamic in focusing window Characteristic directly determines the degree of accuracy for focusing on evaluation system, and the recovery to Dynamic Signal undoubtedly adds MCU operand, and then Determine the feedback speed of focusing system.
In the present embodiment, described image processing module uses the Fast Search linked with focal length, when automatic focusing Operation is when being caused by camera lens zoom, the focal position fed back by camera lens judge camera lens be in Yuan Jiao areas or Jin Jiao areas, Image scaling, human eye are not very paid close attention in the of short duration time of definition still, and quickly focus lamp is determined with reference to current zoom order Direction and step-length that group is moved first, realize the anticipation and action focused on during camera lens zoom, final to improve what is focused on Speed.
In the present embodiment, the camera integration control of the step S4 or identification module use Change of integral time or knowledge Other method, for conditional camera, reduction focuses on the speed of microscope group within its time of integration, and reduction motion is to definition evaluation Influence, obtain more accurate definition evaluating, the number of repetition of focusing especially reduced under severe conditions, improve fast Fast focusing power.
The present invention employs adaptive strategy in the selection of focusing sampling window, especially to moving target, takes Detection, tracking, the processing method restored, preferably solve the influence that moving target differentiates to definition.Devise simultaneously clear Clear degree evaluates the hardware platform of core algorithm restructural, adds flexibility and reduces upgrade maintenance cost and technical difficulty. Focusing search control strategy then employs the SHUTT shuttle algorithm based on anticipation, using speed change/step-length local searching strategy so that It is more accurate to focus on.And the evaluation of image definition then uses follow-on SOBEL functions as the evaluation function focused on automatically, It is adapted to quick-fit focusing and finds image most articulation point.For conditional camera, devise Change of integral time and obtain Passage is taken, the accuracy of definition sampling is favorably improved.
Sharpness evaluation function is the core of autofocus system, is the foundation of auto focus control.Image definition is commented The species of valency function is a lot, can be divided into two classes according to its foundation:Time-domain analysis and frequency-domain analysis.Wherein, time-domain analysis is base Analyzed in gray value, the definition of image is different, and its gray value shown after appropriate change also becomes therewith Change.When image than it is more visible when, then the details that image is included relatively enrich, show as variation of image grayscale substantially, have relatively sharpen Edge.
The embodiment of the present invention has selected a kind of improved SOBEL algorithms as autofocus evaluation function, for focus sequence figure As analysis has carried out specific aim improvement, it is adapted to solve because image definition relevance declines between field caused by brightness overall variation Problem.The autofocus evaluation function changes the method that traditional SOBEL operators directly use gray value difference, and brightness normalizing is carried out first Change is handled, then the SOBEL operator calculus of differences of return to traditions, and so its result neither loses the embodiment of this field picture definition, Also the change of image overall brightness is minimized simultaneously, it is relatively more representative between field, it is the sequence ratio of image definition Preferable basis is relatively established.The unimodality and unbiasedness of evaluation function curve are better in focusing, the effect focused on automatically Fruit is also better.Therefore in order to improve the accuracy of algorithm, a filter unit is devised again after sharpness computation unit, use The probability focused on automatically in the influence of reduction noise, reduction repeated priming.
Picture is divided into the dynamic window of 3*3 fixed samples window and a floating by the embodiment of the present invention, such as Fig. 2 institutes Show.Sampling window selection of focusing is most important to the focusing automatically based on image procossing, especially long-focus industrial lens, due to Its visual field is relatively small, moving target proportion lifting, so when an object is moving, a certain stationary window is clear in image sequence The result shown during clear degree analysis does not have correlation;The minimum arithmetic element of Image Definition is pixel Level, and the huge operand that abundant image information is brought brings great pressure, therefore appropriate choosing to hardware cost, speed It is the inevitable approach that engineering is implemented to select sampling window;For piece image, people's target of interest is frequently not image All, and when image distance level is more the effect focused on can also be influenceed.As fully visible, the selection of focusing sampling window will Directly determine to focus on to evaluate operand, the degree of accuracy, and then finally influence whole structure.
The step of extraction of embodiment of the present invention definition values, decision-making, is as follows:
1)According to sequence image analysis, determine whether Large-scale Mobile target and mobile target signature parameter draws floating window Mouth region domain.
2)Whole field picture is normalized, the computing for asking for mean flow rate is carried out in real time in FPGA, normalized Directly calculated during processing with current data, due to the delay performance of sampling, sharpness computation is using the streamline after delay Statistical method.
3)To the end of measurement period, the preliminary definition values of 9 windows, which are calculated, to be finished, if there is no floating frame, The 5th step is then turned to, if there is floating frame, then continues follow-up 4th step.
4)Positioning floating window, and floating frame is reset into the position occurred first, the window being related to is entered again Line definition is calculated, and is subtracted or plus the influence of large-scale moving target.
5)Assign the weight limit of window 5, window 2, big 4,6,8 times weight, remaining window minimal weight, statistical analysis 9 The definition values change sequence of window, remove change deviate average tendency window, remaining window as definition judgment according to According to.
6)If focused on automatically, definition values give next computing module, if in non-automatic Focus state, the then scene state for giving image processing module by statistics tests and analyzes unit, to decide whether voluntarily to open The automatic focusing of a dynamic new round.
Scene state tests and analyzes unit, and the digital command provided by user analyzes the possible state of camera lens, such as becomes Again, head motion etc., tentatively judges to need to start the probability focused on automatically and possible direction according to these information;Work as user When instruction can not be provided, scene state detection and analysis module can be according to definition evaluation module information and monochrome information, figure Whether the information analyses such as image space overall variation need a startup new round to focus on automatically, and these are all based on the shadow to image change Ring.Certainly, for the camera lens of all weather operations, scene state detection and analysis module must also distinguish natural lighting result and It is not focus issues, need not now starts automatic focusing.
In order to quickly and accurately realize automatic focusing, the relatively good focusing search control strategy of selection one is very heavy Want.In embodiments of the present invention, using a kind of comprehensive descision, prediction, automatic decision adaptable search control algolithm, specifically Step includes:Direction anticipation and determination, speed decision-making are with determining, record extracts value of maximum articulation and it is theoretical most clear to be back to Place, gear clearance amendment search and final positioning.
Direction anticipation is with determining, the mobile side for determining camera lens according to the sharpness evaluation function numerical value of present image To.The present invention uses the Fast Search linked with focal length, namely when automatic focusing operation is caused by camera lens zoom, can The focal position fed back by camera lens judges that camera lens, in remote burnt or Jin Jiao areas, determines camera lens first with reference to current zoom order The moving direction and moving step length of motion.When zoom instruction can not be obtained, the graphical analysis based on target detection also can be should Step provides Informational support, is so achieved that the anticipation and action focused on during camera lens zoom.
Speed decision-making is focused in microscope group motion process with determining, image appearance is fuzzy, transition, optical clarity and optics Clear four regions, wherein optical clarity are the dreamboats that all automatic focusing are pursued.Automatically the overall process focused on, is obscured Region occupies more time, therefore it is beneficial to the raising of whole focusing speed to improve fuzzy region microscope group speed.Once into transition Region, definition values change is obvious, and zone time is shorter, now needs to reduce speed, it is to avoid miss optimal focal plane position. It fact proved, microscope group movement velocity is reduced since transitional region, is conducive to quickly reaching the effect of optical clarity and optical clarity Really.Typically by lens focus to optical clarity, unless scientific research, it is not necessary that pursue optical clarity, therefore, suitably set Outage threshold is counted, focusing effect is neither influenceed, can avoid focusing on and losing time repeatedly again.After the completion of the anticipation of direction, zoom Start simultaneously and focus on microinching also by raising focusing speed and the probability of success.In addition, for have integration control input or The camera of output is indicated, slow down such batch (-type) search strategy within the time of integration, also will preferably improve focusing accuracy.
Extract value of maximum articulation, extract motor in defocus --- focusing --- image definition during defocus is commented The maximum of value, low speed/small step-length search strategy is taken when extracting maximum, and the definition that can so improve extraction is maximum The accuracy of value, is accurately back to most clear place for lower step and prepares.Specific steps include:
1)When automatic focusing operation is to be operated to cause by zoom, then motor is with the step-length than relatively low speed/small The direction that the microscope group of focusing first determined to data analysis submodule is moved is moved, and the definition of acquisition image every is commented always Value.The maximum FVMAX of picture appraisal value is counted and preserved, enters and is back to theoretical most clear place's stage.If it is not, then driving Dynamic motor move to some fixed focus direction, and the focusing evaluation of estimate of acquisition image every always, is counted and is preserved three Evaluation of estimate, to step 2).
2)When detecting during motor movement, the evaluation of estimate n of image(Concrete numerical value is set according to lens parameters) When being continuously reduced, then stop motor immediately.Carrying out two if the middle situation for having increase takes one to compare, the evaluation of estimate of image m(Concrete numerical value is set according to lens parameters)Field then stops motor immediately when being continuously reduced, to step 3).When focusedimage texture Less when causing the evaluation of estimate can not to meet above-mentioned situation, then motor stops to a fixed position to focus on the interposition of stroke Put, be that next time, rapidly automatic focus on was prepared.
3)Step 2)After middle motor stops, motor moved with the step-length than relatively low speed/small to opposite direction and The utmost sharpness evaluation of estimate of hypograph is recorded, finds after the value of maximum articulation FVMAX of image, stops motor immediately, is entered To being back to theoretical most clear place's stage.
Theoretical most clear place's stage is back to, namely returns and looks into theoretical peak, motor is moved toward definition maximum direction, For stepper motor camera lens, the present invention uses variable step-size search strategy, and for direct current generator, the present invention uses SHUTT shuttle plan Slightly, namely the speed of camera motion is exported absolute difference between theoretical peak by current video two field picture peak value and focusing algorithm Comprehensively determined with variation tendency.Distance Theory is most clearly located nearer, and the speed of focus motor is smaller, until finding theoretical definition Maximum value position stops motor immediately, then automatic focusing operation is completed.In this step, a kind of abnormal conditions be further comprises:Nothing Method finds theoretical maximum namely the theory extracted when current video field picture peak value and in the extraction value of maximum articulation stage most When absolute difference between big definition causes motor not stop always greater than a defined threshold, we take peak value herein Self-adaptative adjustment protection mechanism.Concrete operations are:
(1), return look into peak value during record the evaluation of estimate of current video field picture and count current video figure Judge as peak F and therefrom that present image articulation curve is moved towards.When the clear evaluation of estimate of present image is in the descending of curve During the stage(Herein determination methods and extract the value of maximum articulation stage step 2)It is alike), then motor is stopped immediately.
(2), setting one fine motion normal amount S(Concrete numerical value is set according to lens parameters).Compare FVMAX and F size, If FVMAX>F, then make FVMAX=FVMAX-S, otherwise FVMAX=FVMAX+S.
(3), motor move carry out back looking into new peak value in the opposite direction, search, motor stop.Search is not Arrive, then turn to step(2)Until motor stops.
Gear clearance amendment is searched for has more or less gear clearance with final positioning, the transmission mechanism of all camera lenses, For short-focus lens, gear clearance can reach and ignore by strengthening assembly technology or inspection, but for long-focus Camera lens, especially current using high definition as the camera lens of main flow, gear clearance can not all be ignored anyway.Therefore, the present invention is directed to Gear clearance devises special link, that is, reaches after above-mentioned theory definition point, to reduce focus motor speed to greatest extent, Carry out small range to focus on again, now speed is very slow, scope very little, do not feel the change of image even visually, but can be Represent the most clearly image to observer in time less than 1s, the cost benefit brought because reducing matching requirements is equally Where the income of the present invention.
Presently preferred embodiments of the present invention is the foregoing is only, the core technology of the present invention is described, it is clear that this present invention's Technical scheme is not limited to examples detailed above, is not to be taken as the exclusion to other embodiment, can also there is many deformations.If this Field personnel do not depart from the spirit and scope of the present invention to other combinations, modification and the environment that this is carried out, all should be in institute of the present invention In attached scope of the claims.

Claims (8)

1. a kind of fast automatic focusing method of long-focus visible ray industrial lens, it is characterised in that comprise the following steps:
Step S1:Using focusing drive module driving focus motor, the distance of regulation camera lens and imaging sensor is optimal to reach Focal position, acquisition picture rich in detail;
Step S2:Real-time scenery image is obtained from camera lens using image capture module, needs to gather image by subsequent analysis Data;
Step S3:Interference signal in every image, characteristic information extraction are filtered using image processing module, according to predetermined point Analysis strategy, it is determined that the position of focal plane where optimal definition;
Step S4:Using camera integration control or the integration time for exposure of identification module control or identification camera, pass through focusing The direction of drive module control focus motor rotation and speed, reach the purpose that definition is precisely obtained;
In step s3, described image processing module controls drive module of focusing using the SHUTT shuttle algorithm based on anticipation, Specific steps include:Direction anticipation is with determination, speed decision-making with determining, recording extraction value of maximum articulation and be back to theoretical most clear Clear place, gear clearance amendment search and final positioning;Wherein, extract value of maximum articulation in record and be back to theoretical most clear place Step when, focus motor using the motion of speed change/step-length, by focusing be divided into it is thick focus on and two stages of fine focus, The different stages uses different maximum value search strategies, reaches after theoretical definition point, enters gear clearance amendment search With final positioning step, using different maximum value search strategies be in the different stages at camera lens in the fuzzy stage or clearly When clear trend is not obvious, using at a high speed/big step length searching;When camera lens, which is in, tends to clear state, searched using low speed/small step-length Rope.
2. the fast automatic focusing method of long-focus visible ray industrial lens according to claim 1, it is characterised in that: In step S2, described image acquisition module is by video frequency processing chip by the standard system obtained from camera is colored or black white image The analog video data of signal is converted into standard digital video data, and standard digital video data are sent into image procossing mould Block, regard this signal as focusing algorithm video source signal.
3. the fast automatic focusing method of long-focus visible ray industrial lens according to claim 1, it is characterised in that: In step S3, described image processing module includes image preprocessing submodule and image procossing submodule, described image pretreatment Submodule receives the standard digital video data sent of image capture module and carries out image filtering and brightness, color extraction, profit Noise is filtered with many subdomain focus functions, image information useful, with a high credibility is obtained, it is ensured that the reliability of subsequent analysis;Institute The feature that image procossing submodule is distributed according to each image brightness, color, space clustering is stated, passes through follow-on weighting SOBEL algorithms object selection carries out initial analysis statistics, follow-on weighting SOBEL algorithm conducts to the definition of picture Autofocus evaluation function, the autofocus evaluation function changes the method that traditional SOBEL operators directly use gray value difference, carries out first The SOBEL operator calculus of differences of brightness normalized, then return to traditions.
4. the fast automatic focusing method of the long-focus visible ray industrial lens according to claim 1 or 3, its feature exists In:In step s3, it is automatic with voluntarily starting when described image processing module detects feature value changes beyond predetermined threshold The ability of focusing, control compatible direct current or driving stepper motor camera lens, which go to most clear place, to be stopped;Described image processing module is also Carry out to judge whether to start the observation of steps focused on automatically, the dual judgement combined using definition values with brightness value, lead to Cross and compare whether current scene is more than the set threshold value of the automatic focusing of startup with the absolute difference of the automatic focus value of previous field, and tie Whether the absolute difference for closing the brightness value of current scene and the brightness value of previous field picture focuses on set threshold automatically more than startup Value, focuses on or is defined as automatically next time gradual caused by natural environment, and then alternative reference value to judge whether to start, keep away Exempt from erroneous judgement.
5. the fast automatic focusing method of long-focus visible ray industrial lens according to claim 1, it is characterised in that: In step S3, described image processing module employs the focusing algorithm that target area can be reconstructed automatically, to avoid high-speed motion mesh Mark is to the erroneous judgement caused by the influence of definition.
6. the fast automatic focusing method of long-focus visible ray industrial lens according to claim 1, it is characterised in that: In step S3, described image processing module uses the Fast Search linked with focal length, when automatic focusing operation is by camera lens When zoom causes, the focal position fed back by camera lens judges that camera lens is in Yuan Jiao areas or Jin Jiao areas, in image scaling, human eye Very do not pay close attention in the of short duration time of definition still, come quickly to determine to focus on the side that microscope group is moved first with reference to current zoom order To and step-length, realize the anticipation and action focused on during camera lens zoom, it is final to improve the speed focused on.
7. the fast automatic focusing method of long-focus visible ray industrial lens according to claim 1, it is characterised in that: In step S4, the camera integration control or identification module use Change of integral time or recognition methods, in the integration of camera Reduction focuses on the speed of microscope group in time, and the influence that reduction motion is evaluated definition obtains more accurate definition evaluation Ginseng.
8. a kind of long-focus of fast automatic focusing method using long-focus visible ray industrial lens as claimed in claim 1 The fast automatic focusing system of visible ray industrial lens, it is characterised in that including:
Focusing drive module, the distance for driving focus motor, regulation camera lens and imaging sensor, to reach optimum focusing position Put, obtain picture rich in detail;
Image capture module, for obtaining real-time scenery image from lens camera, is needed to gather view data by subsequent analysis;
Image processing module, for filtering the interference signal in every image, characteristic information extraction, according to predetermined analysis plan Slightly, it is determined that the position of focal plane where optimal definition;And
Camera integration is controlled or identification module, the integration time for exposure for controlling or recognizing camera, passes through driving mould of focusing The direction of block control focus motor rotation and speed, reach the purpose that definition is precisely obtained.
CN201410585995.2A 2014-10-28 2014-10-28 The fast automatic focusing method and system of a kind of long-focus visible ray industrial lens Active CN104284095B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410585995.2A CN104284095B (en) 2014-10-28 2014-10-28 The fast automatic focusing method and system of a kind of long-focus visible ray industrial lens

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410585995.2A CN104284095B (en) 2014-10-28 2014-10-28 The fast automatic focusing method and system of a kind of long-focus visible ray industrial lens

Publications (2)

Publication Number Publication Date
CN104284095A CN104284095A (en) 2015-01-14
CN104284095B true CN104284095B (en) 2017-07-14

Family

ID=52258536

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410585995.2A Active CN104284095B (en) 2014-10-28 2014-10-28 The fast automatic focusing method and system of a kind of long-focus visible ray industrial lens

Country Status (1)

Country Link
CN (1) CN104284095B (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105611158A (en) * 2015-12-23 2016-05-25 北京奇虎科技有限公司 Automatic focus following method and device and user equipment
CN105681670B (en) * 2016-02-29 2018-09-11 广东欧珀移动通信有限公司 Control method, control device and electronic device
FR3051920A1 (en) * 2016-05-31 2017-12-01 Parrot Drones DRONE ADAPTED TO THE VISION OF A REMOTE SCENE
CN106412435B (en) * 2016-10-12 2019-05-31 Oppo广东移动通信有限公司 Focusing method, device and mobile terminal
CN106650649B (en) * 2016-12-13 2024-02-02 北京倍肯恒业科技发展股份有限公司 Automatic white recognition image device for cells
CN109302560A (en) * 2017-07-25 2019-02-01 宁波天视图像技术有限公司 A kind of machine vision smart camera focused automatically with zoom
CN107948502B (en) * 2017-11-08 2024-04-23 广州网路通电子有限公司 Monitoring camera image focusing measurement system and measurement method thereof
CN111726512B (en) * 2019-03-18 2022-08-23 浙江宇视科技有限公司 Area focusing method, device, equipment and storage medium
CN112004019B (en) * 2019-05-27 2023-02-24 福建天晴数码有限公司 Tracking focusing method and computer readable storage medium
CN110389088B (en) * 2019-08-06 2021-09-07 哈尔滨工业大学 On-line monitoring method for particle pollutants on surface of large-diameter reflector
CN110927922A (en) * 2019-12-19 2020-03-27 中国科学院长春光学精密机械与物理研究所 Device and method for rapidly switching multiplying power of optical system
CN111835951B (en) * 2020-07-13 2022-03-25 杭州海康威视数字技术股份有限公司 Adjusting method of shooting lens and shooting lens
CN112135062B (en) * 2020-11-24 2021-02-05 宁波兰茜生物科技有限公司 Camera focusing control method and device based on FPGA
CN112601015B (en) * 2020-12-10 2022-08-05 烟台艾睿光电科技有限公司 Automatic focusing method and automatic focusing system
CN112637485B (en) * 2020-12-16 2022-09-06 普联技术有限公司 Vision-assisted lens automatic focusing method, system, equipment and storage medium
CN114500859B (en) * 2022-04-13 2022-08-02 国仪量子(合肥)技术有限公司 Automatic focusing method, photographing apparatus, and storage medium
CN116540502A (en) * 2023-05-29 2023-08-04 江苏影速集成电路装备股份有限公司 Automatic focusing method and system for LDI equipment
CN117221736B (en) * 2023-11-09 2024-01-26 成都中轨轨道设备有限公司 Automatic regulating AI camera system for low-illumination clear collection

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216591A (en) * 2008-01-16 2008-07-09 中国电子科技集团公司第四十五研究所 Image gray scale based automatic focusing method and its system
CN101706609A (en) * 2009-11-23 2010-05-12 常州达奇信息科技有限公司 Image processing based fast automatic focusing method of microscope
CN101814129A (en) * 2009-02-19 2010-08-25 中国科学院自动化研究所 Automatically focused remote iris image acquisition device, method and recognition system
CN201878254U (en) * 2010-11-03 2011-06-22 深圳中天银河科技有限公司 Automatic focusing module used in telephoto lens and endowed with video preprocessing function
CN103747174A (en) * 2013-12-20 2014-04-23 河北汉光重工有限责任公司 Multi-target free focusing method and application apparatus thereof
CN103945133A (en) * 2014-05-08 2014-07-23 山东神戎电子股份有限公司 Auto-focus device and method for visible light lens

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8064761B2 (en) * 2010-03-04 2011-11-22 Digital Imaging Systems Gmbh Method to determine auto focus of a digital camera

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216591A (en) * 2008-01-16 2008-07-09 中国电子科技集团公司第四十五研究所 Image gray scale based automatic focusing method and its system
CN101814129A (en) * 2009-02-19 2010-08-25 中国科学院自动化研究所 Automatically focused remote iris image acquisition device, method and recognition system
CN101706609A (en) * 2009-11-23 2010-05-12 常州达奇信息科技有限公司 Image processing based fast automatic focusing method of microscope
CN201878254U (en) * 2010-11-03 2011-06-22 深圳中天银河科技有限公司 Automatic focusing module used in telephoto lens and endowed with video preprocessing function
CN103747174A (en) * 2013-12-20 2014-04-23 河北汉光重工有限责任公司 Multi-target free focusing method and application apparatus thereof
CN103945133A (en) * 2014-05-08 2014-07-23 山东神戎电子股份有限公司 Auto-focus device and method for visible light lens

Also Published As

Publication number Publication date
CN104284095A (en) 2015-01-14

Similar Documents

Publication Publication Date Title
CN104284095B (en) The fast automatic focusing method and system of a kind of long-focus visible ray industrial lens
CN103929588B (en) camera zoom fast automatic focusing method and system
US8325996B2 (en) Method and device for locating a human iris in an eye image
Park et al. A real-time focusing algorithm for iris recognition camera
CN101409825B (en) Nighttime vision monitoring method based on information fusion
CN103503433B (en) Focus error estimation in images
US20120206619A1 (en) Image processing apparatus, image capturing apparatus and recording medium
CN1892401A (en) Multi-stage automatic focusing method according to time-frequency domain catched by iris picture
CN101281646A (en) Method for real-time detection of driver fatigue based on vision
KR101014325B1 (en) Face recognition system and method using the infrared rays
CN203204233U (en) Automatic detection device applicable to microscope focusing
CN102087652A (en) Method for screening images and system thereof
CN105306825A (en) Novel infrared image focusing system and use method thereof
CN102175701A (en) System and method for online flaw detection of industrial X-ray machine
CN110750152B (en) Man-machine interaction method and system based on lip actions
CN101456159A (en) Spark identification tool-setting method and abrasive machining automatic system
CN111504885B (en) Analysis method of full-automatic blood smear morphological analysis device based on machine vision
CN105592258B (en) Auto focusing method and device
CN107644418A (en) Optic disk detection method and system based on convolutional neural networks
CN103164695A (en) Fruit identification method based on multi-source image information fusion
CN107909599A (en) A kind of object detecting and tracking system
CN110324536A (en) A kind of image change automatic sensing focusing method for micro- camera
WO2016101092A1 (en) Digital microscope and focusing method thereof
CN101509998B (en) Automatic focusing method and microscope applying the method
CN105389820A (en) Infrared image definition evaluating method based on cepstrum

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent for invention or patent application
CB02 Change of applicant information

Address after: 158 No. 350015 Fujian province Fuzhou Mawei District Jiangbin East Avenue

Applicant after: FUJIAN FORECAM CO., LTD.

Address before: 158 No. 350015 Fujian province Fuzhou Mawei District Jiangbin East Avenue

Applicant before: Fujian Forecam Optics Co., Ltd.

COR Change of bibliographic data

Free format text: CORRECT: APPLICANT; FROM: FUJIAN FORECAM DIGITAL TECHNOLOGY CO., LTD. TO: FUJIAN FORECAM CO., LTD.

GR01 Patent grant
GR01 Patent grant