Background technology
Nowadays, utilize image recognition to complete product or the technology of measuring ability very general.Wherein, part image identification system, for example car plate identification, very high to quality requirementss such as the sharpness of image, resolution and pattern distortion degree, and require image acquisition speed fast, image need compress and preserve, its front end is generally used high-speed digital photography machine, and processing terminal is generally used high-performance computer, can find out that this type systematic has relatively high expectations to equipment performance, but actual working environment is generally more severe, be difficult for accomplishing high discrimination, low cost and integrated; Another part image identification system, for example equipment drawing picture flaw detection, generally uses Implementation of Embedded System, and common embedded device is limited by work dominant frequency, and data processing speed is lower, though can realize integrated and miniaturization, the real-time of system is difficult to guarantee.Therefore traditional image detecting system all exists and lacks dirigibility, integration, and cost is higher, the wasting of resources, or lack real-time, the problem that data throughout is less.
Once system task both proposed high requirement to picture quality, data throughout and system real time, also require system to there is dirigibility and integration simultaneously, traditional image detecting system can not satisfy the demands.The advantages such as it is high that the ARM+DSP double-core coprocessor based on DaVinci framework has work dominant frequency, and data processing speed is fast, become the first-selected hardware of head it off.DaVinci framework is mainly used in solving the problems such as communication, memory management and task scheduling between ARM (Advanced RISC Machines) and DSP (Digital Signal Processor, digital signal processor) or coprocessor.Under DaVinci structural system, arm processor is responsible for image acquisition, memory management etc., and DSP is responsible for the integrated of image recognition algorithm.
In industrial processes, be accompanied by various production-line techniques, for some product, the product that specific production line can only production specific model, therefore, product type must pass through narrow examination, the production line of being allowed for access.Model testing on production line is at present completed by artificial visually examine mostly, under a large amount of work that repeat, occur that error in judgement is unavoidable, therefore, utilize integrated high quality graphic detection system to replace manually carrying out fast and accurately the detection of product type, to controlling product quality, be of great importance.At present, the technology relating to for the image detecting system of problems mainly comprises embedded technology, acquisition technology and the image processing techniques based on single core processor.Wherein, image processing techniques comprises image recognition algorithm, ripe image recognition algorithm has a lot, as template matches, neural network, support vector machine etc., but outstanding algorithm calculated amount is generally larger, be not suitable for the embedded low-speed device of Denging, so embedded image detection system is general all according to the different independent development algorithms of system task, to adapt to the needs of task.
Summary of the invention
The present invention is for solving product on production line model ONLINE RECOGNITION problem, a kind of online type identifier instrument based on DaVinci framework and embedded image detection technique is proposed, the integrated functions such as user interface, self-adaptation light source, image acquisition, video triggering, image recognition, binocular data fusion, log recording and sound and light alarm.
Online type identifier instrument based on DaVinci framework and embedded image detection technique of the present invention, comprise the main equipment of binocular recognition structure and from equipment, image capture device, self-adaptation light source, audible-visual annunciator and user's operating equipment, main equipment and be respectively connected with an image capture device from equipment, main equipment is also connected with self-adaptation light source harmony light crossing-signal, from equipment, is also connected with user's operating equipment; Image capture device, for gathering the image of object to be identified on current production line, generates composite video signal, and two image capture devices gather the angle difference of image.
Main equipment and all include a base plate and an OMAP3530 core board from equipment, OMAP3530 core board is arranged on corresponding base plate by B2B interface; Main equipment and all comprise video decode circuit and video data bus from the base plate of equipment, the base plate of main equipment also comprises sound and light alarm driving circuit and adaptive optical source controller, from the base plate of equipment, also comprises for connecting the interface circuit of user's operating equipment; Main equipment is identical with the functional module loading OMAP3530 core board from equipment, all comprises: ARM end image acquisition driver module, ARM end application program module, Dual-Core Communication server module and DSP end picture recognition module.
Main equipment is identical with the process that the composite video signal image capture device that is connected separately being gathered from equipment is carried out image recognition, specifically: the dedicated video demoder in video decode circuit receives by bnc interface the composite video signal that connected image capture device sends, after A/D conversion, obtain digital picture, the digital picture that ARM end image acquisition driver module obtains by video data bus collection also sends ARM end application program module to, ARM end application program module is packaged into the systematic parameter of digital picture and setting the standard interface that meets DaVinci structure, by Dual-Core Communication server, give the DSP end picture recognition module of DSP core loading and carry out image recognition, described systematic parameter, comprises and the optical parametric of the image recognition algorithm in product type on current production line and DSP end picture recognition module by user's operating equipment, is arranged by user.
From the DSP end picture recognition module of equipment, image recognition result is sent to the DSP end picture recognition module of main equipment, the DSP end picture recognition module of main equipment is in conjunction with the image recognition result from equipment, comprehensively go out final image recognition result, and according to final image recognition result, whether the product type that judges current object to be identified is the product type on current production line, does not if so, deal with, if not, by sound and light alarm driving circuit, control audible-visual annunciator and report to the police.
Main equipment, also according to the light condition of working environment, regulates the power of self-adaptation light source automatically by adaptive optical source controller.
Advantage of the present invention and good effect are:
(1) hardware height is integrated, and resource makes full use of, and identifier of the present invention has good dirigibility;
(2) identifier of the present invention, based on DaVinci Frame Design, has good portability and extendability;
(3) adapt to industrial environment, can under any ambient light lines part, collect qualitative picture, there is very high character identification rate;
(4) take into account the system integration and processing power, by the type selecting of hardware and the optimization of software, the present invention proposes a rational optimal solution, effectively alleviated the contradiction of the two.
Embodiment
Below in conjunction with drawings and Examples, the present invention is described in further detail.
The present invention is a kind of online type identifier instrument based on DaVinci framework and embedded image detection technique, as shown in Figure 1, comprises main equipment 1 and from equipment 2.User's operating equipment in the embodiment of the present invention adopts matrix keyboard to realize.As shown in Figure 1, main equipment 1 connects the first image capture device 3, the outer light filling source 4 of self-adaptation and audible-visual annunciator 5, from equipment 2, is connected with matrix keyboard 6 and the second image capture device 7.Main equipment 1 and all include a base plate and an OMAP3530 core board from equipment 2.The OMAP3530 core board 102 of main equipment is identical with the structure of the OMAP3530 core board 202 from equipment, and OMAP3530 core board 102,202 is all arranged on the base plate 101,201 of corresponding master and slave equipment by B2B interface.OMAP3530 core board has OMAP3530 flush bonding processor, consists of, and be loaded with system software ARM and DSP core.But user's operating equipment matrix keyboard, toggle switch or touch-screen etc., adopt matrix keyboard in the embodiment of the present invention.
Two complete equipments that carry out binocular identification are defined as respectively main equipment 1 and from equipment 2, are the task different definition that complete according to the base plate of master and slave equipment.The base plate 101 of main equipment and be main hardware parts of the present invention from the base plate 201 of equipment, common stacking being arranged in integral instrument case of two cover base plates 101,102.The main self-adaptation of being responsible for the image acquisition of main equipment, the control of sound and light alarm and outer light filling sources of base plate 101 of main equipment regulates, and from the base plate 201 of equipment is main, is responsible for from the image acquisition of equipment and accepts user's initialization system parameter.The OMAP3530 core board 102 of main equipment and from OMAP3530 core board 202 each self-contained OMAP3530 dual core processors of equipment, is comprised of ARM and DSP double-core, and on it, the program module of operation is main software parts of the present invention.
As shown in Figure 2, the product that this instrument need be identified moves with production line, there is cylindrical, rapid movement, irregular rotation and in the medium feature of complex background, if the anglec of rotation is excessive, may cause product type character to leave visual field and None-identified, for addressing this problem, identifier employing of the present invention has 20 °~two complete equipments of 40 ° of angles and carries out the structure of binocular identification, and adopt particular algorithm filtering complex background, binocular recognition result is carried out to data fusion, improve the discrimination of the product type under extreme case.In Fig. 2, the first image capture device 3 of main equipment 1 gathers the orientation of images and has 30 degree angles with the orientation that the second image capture device 7 from equipment 2 gathers images.
As shown in Figure 3, the software module loading from equipment OMAP3530 core board 202 mainly comprises: the 2nd ARM end image acquisition driver module 203, the 2nd ARM end application program module 204, the second Dual-Core Communication server module 205, the two DSP end picture recognition module 206.The module mainly comprising from equipment bay 201 comprises: the second video decode circuit 207, the second video data bus 208 and matrix keyboard interface circuit 209.Matrix keyboard interface circuit 209 external matrix keyboards 6, user can arrange systematic parameter by matrix keyboard 6, comprises the model of product to be identified and the optical parametric of image recognition algorithm etc. on current production line.Dedicated video demoder in the second video decode circuit 207 is by bnc interface (Bayonet Nut Connector, concentric cable plug) receive the composite video signal that the second image capture device 7 sends, after A/D conversion, obtain the digital picture of specific format, then the second image acquisition driver module 203 being loaded by ARM core by the second video data bus 208 gathers, the 2nd ARM end application program module 204 is packaged into the systematic parameter of the digital picture of collection and setting the standard interface that meets DaVinci structure, by the second Dual-Core Communication server 205, give the second algorithm routine module 206 of DSP core loading and carry out image recognition, and recognition result is sent to main equipment 1.
The software module that main equipment OMAP3530 core board 102 loads mainly comprises: the first image acquisition driver module 103, the one ARM end application program module 104, the first Dual-Core Communication server module 105, the one DSP end picture recognition module 106 of ARM end.The module that main equipment base plate 101 mainly comprises has: the first video decode circuit 107, the first video data bus 108, sound and light alarm driving circuit 109 and adaptive optical source controller 110.Dedicated video demoder in the first video decode circuit 107 receives by bnc interface the composite video signal that the first image capture device 3 sends, after A/D conversion, obtain the digital picture of specific format, then the first image acquisition driver module 103 being loaded by ARM core by the first video data bus 108 gathers, the one ARM end application program module 104 is packaged into the digital picture obtaining the standard interface that meets DaVinci structure, by the first Dual-Core Communication server 105, give a DSP end picture recognition module 106 of DSP core loading and carry out image recognition, in conjunction with the recognition result from equipment 2, comprehensively go out final result, the one ARM end application program 104 produces corresponding operational order according to result, whether by sound and light alarm driving circuit 109, control audible-visual annunciator 5 reports to the police.Sound and light alarm driving circuit 109 is comprised of GPIO (General Purpose Input/Output, universal input output) mouth, triode and the relay of OMAP3530.In instrument work under bad environment, environment light source in time, in weather and the larger situation of seasonal variations, by adaptive optical source controller 110 is set, regulate the power of external self-adaptation light source 4 according to environment light source, so that this instrument can normally be worked automatically.
The invention solves the ONLINE RECOGNITION of product type in industrial production line, for guaranteeing ONLINE RECOGNITION method versatility, using product type to be identified as systematic parameter, be set by the user, system can be accepted the product type of user's input in the application program incipient stage by matrix keyboard 6, carry out subsequent operation after program validation model.
The present invention is applied in industrial environment, and working environment is comparatively severe, and the required light condition of image acquisition is unstable, and instrument need regulate the power of self-adaptation light source 4 by adaptive optical source controller 110 automatically according to ambient light conditions.Implementation method is as follows: adopt high precision photoresistance sensitization, by the A/D function timing acquiring photoresistance resistance of ARM, according to the piece-wise linearization light intensity coefficient of testing gained under different light intensity condition, the resistance of dynamic adjustments digital potentiometer, control the power of self-adaptation light source 4, thereby make light meet in real time the demand of image acquisition.
When the present invention occurs the product of wrong model on certain production line, must report to the police.Sound and light alarm driving circuit 109 embodiments are as follows: GPIO mouth connects the base stage of triode through resistance, and triode is penetrated collection ground connection, are connected in series the input end of relay, the output termination audible-visual annunciator of relay between collector and power supply; OMAP3530 produces GPIO control signal according to alarm command, makes one-level amplify driving relay closes through triode, audible-visual annunciator is connected and reported to the police; Triode currentamplificationfactorβ=40, electric current during state of saturation is approximately 40mA, and relay input end Coil resistance is 320 Ω, and GPIO level is 1.8V, and power supply is 12V; Above parameter combinations, along with the variation of control signal, triode can steady operation on off state.
The OMAP3530 core board 102 of main equipment is identical with the functional module of 202 operations of the OMAP3530 core board from equipment, all comprise image acquisition driver module, ARM end application program module, Dual-Core Communication server module and DSP end picture recognition module, wherein image acquisition driver module and ARM end application program module operate on built-in Linux operating system.Image acquisition driver module mainly completes the collection to digital video signal, and ARM end application program module mainly realizes image data transmission, binocular data fusion, system journal record and alarm command and produces.Dual-Core Communication server module, mainly realizes Memory Allocation, the configuration of arithmetic server and the communication between double-core of DSP end.Image recognition algorithm program operates in DSP end, mainly completes the identification of image, generates and returns to recognition result to ARM end application program module.As the schematic flow sheet of the image-recognizing method of operation in Fig. 4 DSP end picture recognition module 106 that is instrument of the present invention and the 2nd DSP end picture recognition module 206, comprise that image format conversion, image binaryzation, character locating cut apart and character recognition.
As follows from each functional module specific works process of the OMAP3530 core board 202 of equipment: first the 2nd ARM end application program module 204 waits for the model of the product to be identified that user inputs, after receiving systematic parameter, utilize GPIO signal that this systematic parameter is passed to main equipment 1, and by calling the internal memory pointer of the second image acquisition driver module 203 acquisition Digital Image Data, this pointer and systematic parameter are packaged into the interface that meets DaVinci standard, by the second Dual-Core Communication server module 205, open DSP engine, DSP calls picture recognition module 206 and enters video triggering state, after triggering successfully, the 2nd ARM end application program module 204 is taken out continuously 3 two field pictures from digital picture buffer memory, utilize the 3 frame of digital images that 206 pairs of picture recognition module are taken out to identify, and recognition result is sent to main equipment 1 by the GPIO signal with Handshake Protocol.
The concrete operation of each functional module on the OMAP3530 core board 102 of main equipment 1 is as follows: an ARM end application program module 104 is waited for the systematic parameter sending from equipment 2, carrying out with in the identical image processing process of equipment 2, the variation of the one ARM end application program 104 timing acquiring environment light sources, and according to the light intensity of current light condition adjustment self-adaptation light source, after obtaining image recognition result, wait is from the recognition result of equipment 2, carry out data fusion, obtain final result, by its writing system daily record, and according to this result, by an ARM end application program 104, produce corresponding operational order, whether the generation that control is reported to the police.
DSP end picture recognition module 106,206 mainly completes two functions: certainly trigger and image recognition processing.From triggering, adopt virtual coil mode, one or several fixed area is set in visual field, by the changing features of calculating in this region, judged whether that oil drum to be identified enters visual field.The embodiment that specifically the present invention is directed to oil drum identification is as follows: the picture traverse of visual field is 720 pixels, be highly 192 pixels, the position that is 240 and 700 at horizontal ordinate respectively arranges a width and is 6, is highly 192 rectangular window, rectangular window is set fixed area, instrument, when triggering state, calculates the feature in two fixed area to each two field picture obtaining.Embodiment of the present invention object to be identified is oil drum, the numbering of oil drum adopts blue drafting, when the blue ratio in therefore calculating in meeting two fixed area is all greater than certain threshold value, instrument departs from triggering state, follow-up 3 two field pictures are entered to character recognition state, start pictures taken and carry out image recognition processing, after identifying finishes, again return to triggering state.
The process that DSP end picture recognition module 106,206 is carried out image recognition processing is:
(1) image format conversion.What DSP end picture recognition module 106 received is the image of UYVY form, for convenience of DSP, carries out image processing, need to carry out image format conversion, specifically utilizes following formula UYVY image to be converted to the image of RGB888 form:
R=(1164*(Y-16)-1596*(V-128))/1000 (1)
G=(1164*(Y-16)-813*(V-128)-391*(U-128))/1000 (2)
B=(1164*(Y-16)+2018*(U-128))/1000 (3)
R, G, B represent respectively red (Red), green (Green), blue (Blue), are three components that rgb color space is used for representing pixel.Y represents luminance signal, and U and V are colour difference signal, is with UYVY form, to represent three components of pixel.
(2) image binaryzation.Oil drum to be identified is in complex background, and the present invention carrys out the complex background at filtering character place by the vector binarization method based on rgb color space angle and closed operation.R (redness) passage, to blue and white discrimination maximum, utilizes R passage to carry out binary conversion treatment to image, each pixel (x, y) in image is carried out to binary conversion treatment as follows:
x=R*R/(R*R+G*G+B*B) (4)
y=R*R+G*G+B*B (5)
When x is greater than threshold X
0or y is less than threshold value Y
0time, this pixel two-value is turned to white, otherwise its two-value is turned to black.
After binary conversion treatment, former blue portion should be black, and remainder is white, and utilizes the closed operation of the post-etching that first expands further to eliminate tiny cavity, filtering noise.
(3) character locating is cut apart.Its up-and-down boundary of signature search and the border, left and right for the treatment of character learning symbol background of living according to binaryzation, be defined as true origin by image top left corner apex, is highly defined as ordinate, and width is defined as horizontal ordinate.
Character position determination method for parameter is as follows: ordinate calculates the ratio of black pixel point on each horizontal line from top to bottom successively, when this ratio is through once ascending and once after descending sudden change, this horizontal line position is character lower boundary, continue upwards search, when this ratio is again during ascending sudden change, this horizontal line position is character coboundary; Between up-and-down boundary, horizontal ordinate is searched for from right to left, and when occurring that a black is to white edge saltus step, this vertical line position is character right margin; In the rectangular window being formed by up-and-down boundary, right margin and left margin estimated value (this position is always greater than character duration to be known to the width of right margin), calculate successively from right to left the ratio of white pixel on every vertical line, this ratio occurs that the position of first local minimum is two centre positions for the treatment of character learning symbol, the left margin that the position of second local minimum is character.When character locating is cut apart after end, each character will be limited in it in wide contour rectangle frame.
(4) character recognition.This process, by extracting the thick meshed feature of character, is constructed the proper vector of character, and is utilized support vector machine method to identify character.
In the embodiment of the present invention, object to be identified is oil drum, and oil drum has 4 kinds of models: be respectively 40,50,46 and 68.For certain production line, on this production line, the current model that needs is 40 oil drum, model 40 need to be inputted in instrument as systematic parameter, adopt identification instrument of the present invention to identify the oil drum model on this production line, when identical to the model 40 of the recognition result of certain oil drum model and setting, identification is correct, otherwise identification error.In reality identification, can have that identification is correct, identification error and a unidentified situation out.
For improving discrimination, reduce reject rate and wrong knowledge rate, the present invention all identifies 3 two field pictures to each oil drum to be identified, and every two field picture divides parity field to process.Therefore each oil drum to be identified has recognition result 6 times, and 6 results are done following comprehensive:
A) when processing for 6 times all when refusing to know, this oil drum is refused knowledge;
B), when the correct number of times of identification is greater than identification error number of times, this oil drum identification is correct, otherwise, this oil drum identification error.
Conclusion is finally back to an ARM end application program module 104 of main equipment, and produces corresponding operational order by it, determine whether to report to the police.