Summary of the invention
In order to solve the above technical problems, the present invention provides a kind of construction method of vision system, the view that this method constructs
Feel system function multiplicity, it is strong to the strong ability of the adaptation of external environment, it can be applied to identify different workpiece, to reduce use
The technical level requirement of person.
Based on this, the present invention provides a kind of construction method of vision system, includes the following steps:
Standardized parameter setting module is developed, for system parameter and tool parameters to be arranged;
Standardized data acquisition module is developed, for acquiring image data, nominal data and template data;
Standardized data management module is developed, for data storage, data edition and data conversion;
Standardized data processing module is developed, for image data optimization, template data processing and detection data analysis;
Standardized data communication module is developed, for communicating between inside modules communication, each inter-module communication and each system;
Standardized software tool pack is developed, for realizing specific function.
In the construction method of above-mentioned vision system, the step of exploitation standardized parameter setting module, includes:
It is external trigger that camera, which is arranged, to trigger mode, locks trigger source and triggering polarity, and the time for exposure is arranged and exposure increases
Benefit is median, and setting white balance adjusting is automatic mode, the parameter set is made into standalone module, module reserves light source
Adjusting is divided into 10 grades by brightness regulation interface, and the number of input 0~10 is to realize the different-effect taken pictures.
In the construction method of above-mentioned vision system, the step of exploitation standardized data acquisition module, includes:
The data acquisition interface of different cameral is placed on lower layer, search function is write on upper layer, realizes hardware traversal, while basis
Camera type calls corresponding acquisition interface, and the Image Acquisition output interface of standard is then done on upper layer;
Import 13 7 × 7 gridiron pattern uncalibrated images, by calculating tessellated intersection point, seek camera internal reference and outer ginseng,
Calibration result is made into the function of standard, there are image input interfaces and calibration result output interface;
Template creation function is established according to the breadth length ratio of template image, compactness, plumpness, circularity.
In the construction method of above-mentioned vision system, the step of exploitation standardized data management module, includes:
Image, the data store organisations such as creation feature class, template class, graphics class are stored using standard IplImage structure;
Inside modules image storage structure is unified, there are output different-format image interface between module, including HImage, CvMat,
Byte[];
Module provides Image geometry transform, selection, duplication interface, while the processing of ROI being increased in standard module, mentions
The data-interface needed for other modules.
In the construction method of above-mentioned vision system, the step of exploitation standardized data processing module, includes:
Before placing examined workpiece, acquisition testing background image, filtering background and reduction light source for detection image are not
The influence uniformly generated;
The universal performance for extracting template processing, realizes the standardization of external interface, the different type within the scope of certain volume
Workpiece can use identical algorithm to realize identification.
In the construction method of above-mentioned vision system, the step of exploitation standardized data communication module, includes:
Inside modules use same variable;
Each inter-module communication is communicated by the way of common memory, improves treatment effeciency, and all data use BYTE
Type storage;
For different automation equipments, on the basis of the ICP/IP protocol of standard, specific function is extended, not for compatibility
Same data interactive mode.
In the construction method of above-mentioned vision system, the step of exploitation standardized software tool pack, includes:
Develop color extraction tool, dimensional measurement tool, function correction tool, Fuzzy Processing tool, Defect Detection tool,
One of barcode scan engines, character recognition tools, edge strengthening tool, real time differential tool, data statistics tool are several
Kind;
Different tools can be combined arbitrarily.
The implementation of the embodiments of the present invention has the following beneficial effects:
The present invention provides a kind of construction methods of vision system, compared with the prior art, this method passes through to vision system
The design that each functional module of system is standardized enhances vision system pair so that the function of vision system is more diversified
The adaptability of external environment makes it can be applied to identify different workpiece, while the technical level for also reducing user is wanted
It asks.
Specific embodiment
The attached drawing in the embodiment of the present invention will be engaged below, 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 all other
Embodiment shall fall within the protection scope of the present invention.
The embodiment of the present invention provides a kind of construction method of vision system shown in FIG. 1, includes the following steps:
S1 develops standardized parameter setting module, for system parameter and tool parameters to be arranged.Specifically, setting
It is external trigger that camera, which triggers mode, locks trigger source and triggering polarity, and the time for exposure is arranged and exposure gain is median, if
Setting white balance adjusting is automatic mode, and the parameter set is made into standalone module, and module reserves light-source brightness and adjusts interface,
Adjusting is divided into 10 grades, the number of input 0~10 is to realize the different-effect taken pictures.
S2 develops standardized data acquisition module, for acquiring image data, nominal data and template data.Specifically
For, the data acquisition interface of different cameral is placed on lower layer, search function is write on upper layer, realizes hardware traversal, while according to phase
Machine type calls corresponding acquisition interface, and the Image Acquisition output interface of standard is then done on upper layer;Import 13 7 × 7 chessboards
Lattice uncalibrated image, by calculating tessellated intersection point, seek camera internal reference and outer ginseng, calibration result is made into the letter of standard
Number, there are image input interfaces and calibration result output interface;According to the breadth length ratio of template image, compactness, plumpness, circle
Degree establishes template creation function.
S3 develops standardized data management module, for data storage, data edition and data conversion.Specifically,
Image, the data store organisations such as creation feature class, template class, graphics class are stored using standard IplImage structure;Inside modules
Image storage structure is unified, and there are output different-format image interfaces, including HImage, CvMat, Byte [] between module;Mould
Block provides Image geometry transform, selection, duplication interface, while the processing of ROI being increased in standard module, provides other modules
The data-interface needed.
S4 develops standardized data processing module, for image data optimization, template data processing and detection data point
Analysis.Specifically, before placing examined workpiece, acquisition testing background image, filtering background and reduction light for detection image
The influence that source unevenly generates;The universal performance for extracting template processing, realizes the standardization of external interface, within the scope of certain volume
Different type workpiece, can use identical algorithm realize identification.
S5 develops standardized data communication module, for leading between inside modules communication, each inter-module communication and each system
News.Specifically, inside modules use same variable;Each inter-module communication is communicated by the way of common memory, raising processing
Efficiency, and all data are stored using BYTE type;For different automation equipments, on the ICP/IP protocol basis of standard
On, specific function is extended, for being compatible with different data interactive modes.
S6 develops standardized software tool pack, for realizing specific function.Specifically, exploitation color extraction tool,
Dimensional measurement tool, function correction tool, Fuzzy Processing tool, Defect Detection tool, barcode scan engines, character recognition work
One or more of tool, edge strengthening tool, real time differential tool, data statistics tool;Different tools can be appointed
The combination of meaning.
To sum up, the embodiment of the invention provides a kind of construction methods of vision system, compared with the prior art, this method is logical
The design for being standardized each functional module of vision system is crossed to enhance so that the function of vision system is more diversified
Vision system makes it can be applied to identify different workpiece the adaptability of external environment, while also reducing user's
Technical level requirement.
The above is a preferred embodiment of the present invention, it is noted that for those skilled in the art
For, without departing from the principle of the present invention, several improvement and deformations can also be made, these improvement and deformations are also considered as
Protection scope of the present invention.