Background technology
Nowadays, utilize the product or the technology of image recognition completion measuring ability very general at present.Wherein, a part of image identification system, for example car plate identification; Quality requirementss such as sharpness, resolution and pattern distortion degree to image are very high, and require IMAQ speed fast, and image need compress and preserve; Its front end generally uses the high-speed figure video camera, and processing terminal generally uses high-performance computer, can find out that this type systematic has relatively high expectations to equipment performance; But actual working environment is generally more abominable, is difficult for accomplishing high discrimination, low cost and integrated; Another part image identification system, Implementation of Embedded System is generally used in for example equipment drawing picture flaw detection, and common embedded device is limited by the 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 the traditional image detection system all exists and lacks dirigibility, integration, and cost is higher, and the wasting of resources perhaps lacks real-time, the data throughout problem of smaller.
In case system task both proposed high requirement to picture quality, data throughout and system real time, also require system to have dirigibility and integration simultaneously, the traditional image detection system then can not satisfy the demands.Advantages such as it is high to have the work dominant frequency based on the ARM+DSP double-core coprocessor of DaVinci framework, and data processing speed is fast become the first-selected hardware of head it off.The DaVinci framework is mainly used in the problems such as communication, memory management and task scheduling that solve between ARM (Advanced RISC Machines) and DSP (Digital Signal Processor, digital signal processor) or the coprocessor.Under DaVinci structural system, arm processor is responsible for IMAQ, memory management etc., and DSP is responsible for the integrated of image recognition algorithm.
Be accompanied by various production-line techniques in the industrial processes, for some product, the product that the certain production line can only the production model, therefore, product type must pass through narrow examination, the production line of being allowed for access.Model testing on the production line is at present accomplished by the artificial visually examine mostly; It is unavoidable under a large amount of work that repeat, error in judgement to occur; Therefore; Utilize integrated high quality graphic detection system to replace the artificial detection of product type of carrying out fast and accurately, the control product quality is of great importance.At present, the technology that relates to the image detecting system of this type of problem mainly comprises embedded technology, acquisition technology and image processing techniques based on single core processor.Wherein, Comprise image recognition algorithm in the image processing techniques, ripe image recognition algorithm has a lot, like template matches, neural network, SVMs etc.; But outstanding algorithm computation amount is generally bigger; Be not suitable for the embedded low-speed device of Denging, so the 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 model identifier based on DaVinci framework and embedded image detection technique is proposed, integrated functions such as user interface, self-adaptation light source, IMAQ, video triggering, image recognition, binocular data fusion, log record and sound and light alarm.
Online model identifier based on DaVinci framework and embedded image detection technique of the present invention; The main equipment and slave unit, image capture device, self-adaptation light source, audible-visual annunciator and the user's operating equipment that comprise the binocular recognition structure; Main equipment and slave unit respectively are connected with an image capture device; Main equipment also is connected with self-adaptation light source harmony light crossing-signal, and slave unit also is connected with user's operating equipment; Image capture device is used to gather the image of object to be identified on the current production line, generates composite video signal, and the angle of two image capture device images acquired is different.
Main equipment and slave unit all include a base plate and an OMAP3530 core board, and the OMAP3530 core board is installed on the corresponding base plate through the B2B interface; The base plate of main equipment and slave unit all comprises video decode circuit and video data bus, and the base plate of main equipment also comprises sound and light alarm driving circuit and adaptive optical source controller, and the base plate of slave unit also comprises the interface circuit that is used to connect user's operating equipment; The functional module that is loaded on the OMAP3530 core board of main equipment and slave unit is identical, all comprises: ARM end IMAQ driver module, ARM end application program module, double-core communication server module and DSP end picture recognition module.
Main equipment is identical with the process that the composite video signal that slave unit is gathered the image capture device that is connected is separately carried out image recognition; Specifically: the composite video signal that the image capture device that the dedicated video demoder in the video decode circuit is connected through the bnc interface reception sends; After the A/D conversion, obtain digital picture; The digital picture that ARM end IMAQ driver module is obtained through the video data bus collection also sends ARM end application program module to; ARM end application program module is packaged into the standard interface that meets the DaVinci structure with the systematic parameter of digital picture and setting, gives the DSP DSP that nuclear loads end picture recognition module through the double-core communication server and carries out image recognition; Described systematic parameter comprises being provided with the optical parametric of the image recognition algorithm in product type and the DSP end picture recognition module on the current production line through user's operating equipment by the user.
The DSP end picture recognition module of slave unit is held picture recognition module with the DSP that image recognition result sends to main equipment, and the DSP end picture recognition module of main equipment combines the image recognition result of slave unit, comprehensively goes out final image recognition result; And according to final image recognition result; Whether the product type of judging current object to be identified is the product type on the current production line, if then do not deal with; If not, then report to the police through sound and light alarm driving circuit guide sound light crossing-signal.
Main equipment is also according to the light condition of working environment, the power of regulating the self-adaptation light source through the adaptive optical source controller automatically.
Advantage of the present invention and good effect are:
(1) the 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 has good portability and extendability based on the DaVinci Frame Design;
(3) adapt to the industry spot environment, can under any ambient light lines spare, collect qualitative picture, have very high character identification rate;
(4) take into account system integration property and processing power,, the present invention proposes a reasonable optimizing solution, effectively alleviated the contradiction of the two through the type selecting of hardware and the optimization of software.
Embodiment
To combine accompanying drawing and embodiment that the present invention is done further detailed description below.
The present invention is a kind of online model identification instrument based on DaVinci framework and embedded image detection technique, and is as shown in Figure 1, comprises main equipment 1 and slave unit 2.User's operating equipment in the embodiment of the invention adopts matrix keyboard to realize.As shown in Figure 1, main equipment 1 connects first image capture device 3, the outer light filling source 4 of self-adaptation and audible-visual annunciator 5, and slave unit 2 is connected with the matrix keyboard 6 and second image capture device 7.Main equipment 1 all includes a base plate and an OMAP3530 core board with slave unit 2.The structure of the OMAP3530 core board 102 of main equipment and the OMAP3530 core board 202 of slave unit is identical, and OMAP3530 core board 102,202 all is installed on the base plate 101,201 of corresponding master and slave equipment through the B2B interface.The OMAP3530 core board has the OMAP3530 flush bonding processor, is made up of ARM and DSP nuclear, and is loaded with system software.But user's operating equipment matrix keyboard, toggle switch or touch-screen etc. adopt matrix keyboard in the embodiment of the invention.
Two complete equipments that carry out binocular identification are defined as main equipment 1 and slave unit 2 respectively, are the task different definition accomplished according to the base plate of master and slave equipment.The base plate 101 of main equipment and the base plate 201 of slave unit are main hardware parts of the present invention, and two cover base plates, 101,102 collective stack are installed in the integral instrument case.The IMAQ of the base plate 101 main responsible main equipments of main equipment, the control of sound and light alarm and the self-adaptations in outer light filling source are regulated, and the base plate 201 of slave unit mainly is responsible for the IMAQ of slave unit and is accepted user's initialization system parameter.The OMAP3530 core board 102 of main equipment and OMAP3530 core board 202 each self-contained OMAP3530 dual core processor of slave unit are made up of ARM and DSP double-core, and program module of operation is main software parts of the present invention on it.
As shown in Figure 2; The product that this instrument need be discerned moves with production line, has cylindrical, rapid movement, irregular rotation and is in the medium characteristics of complex background, if the anglec of rotation is excessive; Then possibly cause the product type character to leave the visual field and can't discern; For addressing this problem the structure that identifier of the present invention adopts two complete equipments with 20 °~40 ° of angles to carry out binocular identification, and employing particular algorithm filtering complex background; The binocular recognition result is carried out data fusion, improve the discrimination of the product type under the extreme case.Among Fig. 2, the orientation of the orientation of first image capture device, 3 images acquired of main equipment 1 and second image capture device, 7 images acquired of slave unit 2 has 30 degree angles.
As shown in Figure 3; The software module that loads on the slave unit OMAP3530 core board 202 mainly comprises: the 2nd ARM end IMAQ driver module 203; The 2nd ARM end application program module 204, the second double-core communication server modules 205, the two DSP end picture recognition module 206.The module that slave unit base plate 201 mainly comprises 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, the user can be provided with systematic parameter through matrix keyboard 6, comprises the model of product to be identified on the current production line and the optical parametric of image recognition algorithm etc.Dedicated video demoder in the second video decode circuit 207 is through bnc interface (Bayonet Nut Connector; The concentric cable plug) receives the composite video signal that second image capture device 7 sends; After the A/D conversion, obtain the digital picture of specific format; Gathered by the second IMAQ driver module 203 that ARM nuclear loads through second video data bus 208 then; The 2nd ARM end application program module 204 is packaged into the standard interface that meets the DaVinci structure with the digital picture of gathering and the systematic parameter of setting; Give the DSP second algorithm routine module 206 that nuclear loads through the second double-core communication server 205 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 IMAQ driver module, 103, the one ARM end application program module, 104, the first double-core communication server modules, 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 the composite video signal that first image capture device 3 sends through bnc interface; After the A/D conversion, obtain the digital picture of specific format; Gathered by the first IMAQ driver module 103 that ARM nuclear loads through first video data bus 108 then; The one ARM end application program module 104 is packaged into the digital picture that obtains the standard interface that meets the DaVinci structure; Give the DSP DSP that nuclear loads end picture recognition module 106 through the first double-core communication server 105 and carry out image recognition,, comprehensively go out final result in conjunction with the recognition result of slave unit 2; Whether the one ARM end application program 104 produces corresponding operational order according to result, report to the police through sound and light alarm driving circuit 109 guide sound light crossing-signals 5.Sound and light alarm driving circuit 109 is made up of GPIO (General Purpose Input/Output, general input and output) mouth, triode and the relay of OMAP3530.In the instrument work under bad environment, environment light source in time, under the bigger situation of weather and seasonal variations, through adaptive optical source controller 110 is set, the power of regulating external self-adaptation light source 4 automatically according to environment light source is so that this instrument can operate as normal.
The invention solves the ONLINE RECOGNITION of product type on the industrial production line; For guaranteeing ONLINE RECOGNITION method versatility; With product type to be identified as systematic parameter; Set by the user, system can accept the product type that the user imports in the application program incipient stage through matrix keyboard 6, carries out subsequent operation after the program validation model.
The present invention is applied in the industry spot environment, and working environment is comparatively abominable, the light condition instability that IMAQ is required, and instrument needs to regulate automatically through adaptive optical source controller 110 according to ambient light conditions the powers of self-adaptation light sources 4.Implementation method is following: adopt high precision photoresistance sensitization; A/D function timing acquiring photoresistance resistance through ARM; Piece-wise linearization light intensity coefficient according to experiment gained under the different light intensity condition; The resistance of dynamic adjustments digital potentiometer, the power of control self-adaptation light source 4, thus make light satisfy the demand of IMAQ in real time.
When the present invention the product of wrong model occurs on certain production line, must report to the police.Sound and light alarm driving circuit 109 embodiments are following: the GPIO mouth connects the base stage of triode through resistance, and triode is penetrated collection ground connection, is connected in series the input end of relay between collector and the power supply, the output termination audible-visual annunciator of relay; OMAP3530 produces the GPIO control signal according to alarm command, makes one-level through triode and amplifies the driving relay closes, audible-visual annunciator is connected reported to the police; Triode currentamplificationfactor=40, the electric current during state of saturation is approximately 40mA, and the internal resistance of relay input end coil is 320 Ω, and the GPIO level is 1.8V, and power supply is 12V; Above parameter combinations, along with the variation of control signal, but the triode steady operation is on off state.
The functional module of operation is identical on the OMAP3530 core board 102 of main equipment and the OMAP3530 core board 202 of slave unit; All comprise IMAQ driver module, ARM end application program module, double-core communication server module and DSP end picture recognition module, wherein IMAQ driver module and ARM end application program module operates on the built-in Linux operating system.The IMAQ driver module is mainly accomplished digital collection of video signal, and ARM end application program module realizes that mainly image data transmission, binocular data fusion, system journal record and alarm command produce.Double-core communication server module mainly realizes Memory Allocation, the configuration of arithmetic server and the communication between the double-core of DSP end.The image recognition algorithm program run is held at DSP, mainly accomplishes the identification of image, generates and returns recognition result to ARM end application program module.Is the schematic flow sheet of the image-recognizing method of operation on DSP end picture recognition module 106 and the 2nd DSP end picture recognition module 206 of instrument of the present invention like Fig. 4, comprises that image format conversion, image binaryzation, character locating cut apart and character recognition.
The concrete course of work of each functional module of the OMAP3530 core board 202 of slave unit is following: the 2nd ARM end application program module 204 is at first waited for the model of the product to be identified that the user imports; After receiving systematic parameter; Utilize the GPIO signal that this systematic parameter is passed to main equipment 1; And through calling the internal memory pointer that the second IMAQ driver module 203 obtains DID; This pointer and systematic parameter are packaged into the interface that meets the DaVinci standard; Open the DSP engine through the second double-core communication server module 205, DSP calls picture recognition module 206 and gets into video triggering state, triggers successfully the 2nd ARM end application program module 204 continuous 3 two field pictures that take out from the digital picture buffer memory afterwards; The 3 frame of digital images that utilize 206 pairs of picture recognition module to be taken out are discerned, and recognition result is sent to main equipment 1 through the GPIO signal of being with Handshake Protocol.
The concrete operation of each functional module on the OMAP3530 core board 102 of main equipment 1 is as follows: ARM end application program module 104 is waited for the systematic parameter that slave units 2 send, and when carrying out the image processing process identical with slave unit 2, an ARM holds the variation of application program 104 timing acquiring environment light sources; And according to the light intensity of current light condition adjustment self-adaptation light source, obtain after the image recognition result, wait for the recognition result of slave unit 2; Carry out data fusion; Obtain final result, with its writing system daily record, and according to this result; Produce corresponding operational order by ARM end application program 104, whether the generation that control is reported to the police.
Two functions of DSP end picture recognition module 106,206 main completion: trigger certainly and image recognition processing.Adopt the virtual coil mode from triggering, one or several FX promptly is set in the visual field, judged whether that through the changing features of calculating in this zone oil drum to be identified gets into the visual field.The embodiment that specifically the present invention is directed to oil drum identification is following: the picture traverse of visual field is 720 pixels; Highly be 192 pixels; Be that 240 and 700 position is provided with a width and is 6, highly is 192 rectangular window at horizontal ordinate respectively; Rectangular window is set FX, when instrument is in the triggering state, each two field picture that obtains is calculated the characteristic in two FX.Embodiment of the invention object to be identified is an oil drum; The numbering of oil drum adopts blue the drafting; When therefore the blue ratio in satisfying two FX was all greater than certain threshold value in the calculating, instrument broke away from the triggering state, and follow-up 3 two field pictures are got into the character recognition state; Promptly begin pictures taken and carry out image recognition processing, after identifying finishes, return the triggering state once more.
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, carries out Flame Image Process for making things convenient for DSP, need carry out image format conversion, specifically is to utilize following formula the UYVY image transitions to be become 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 red (Red), green (Green), blue (Blue) respectively, are that rgb color space is used for three components of remarked pixel point.Y representes luminance signal, and U and V are colour difference signal, is three components representing pixel with the UYVY form.
(2) image binaryzation.Oil drum to be identified is in the complex background, the complex background that the present invention comes filtering character place through vector binarization method and closed operation based on the rgb color space angle.R (redness) passage is maximum to blue discrimination with white, utilizes the R passage that image is carried out binary conversion treatment, to each pixel in the image (x, it is following y) to carry out binary conversion treatment:
x=R*R/(R*R+G*G+B*B)(4)
y=R*R+G*G+B*B?(5)
When x greater than threshold X
0Perhaps y is less than threshold value Y
0The time, 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 a white, and utilizes the closed operation of first expansion post-etching further to eliminate tiny cavity, filtering noise.
(3) character locating is cut apart.According to binaryzation wait become literate the symbol background of living in its up-and-down boundary of signature search and border, the left and right sides, the image top left corner apex is defined as true origin, highly be defined as ordinate, width is defined as horizontal ordinate.
The character position determination method for parameter is following: ordinate calculates the ratio of black pixel point on each bar horizontal line from top to bottom successively; After this ratio is through once ascending and once descending sudden change; This horizontal line position is the character lower boundary; Continue upwards search, when the ascending again sudden change of this ratio, this horizontal line position is the character coboundary; Horizontal ordinate is searched for from right to left between up-and-down boundary, and when a black occurring to white edge saltus step, this vertical line position is the character right margin; In the rectangular window of forming by up-and-down boundary, right margin and left margin estimated value (this position always accords with width to the width of right margin greater than waiting to become literate); Calculate the ratio of white pixel on every vertical line from right to left successively; The position that first local minimum appears in this ratio is two centre positions of waiting to become literate and accord with, and the position of second local minimum is the left margin of character.After character locating is cut apart end, each character will be limited in the high rectangle frame such as wide with it.
(4) character recognition.This process is constructed the proper vector of character, and is utilized support vector machine method to identify character through extracting the thick meshed feature of character.
Object to be identified is an oil drum in the embodiment of the invention, and oil drum has 4 kinds of models: be respectively 40,50,46 and 68.To certain production line; The current model that needs is 40 oil drum on this production line; Then model 40 need be imported in the instrument as systematic parameter, adopts the oil drum model on this production line of identification instrument of the present invention identification, when to the model of the recognition result of certain oil drum model and setting 40 when identical; Then identification is correct, otherwise identification error.In reality identification, can have that identification is correct, identification error and a unidentified situation of coming out.
For improving discrimination, reduce reject rate and wrong knowledge rate, the present invention all discerns 3 two field pictures to each oil drum to be identified, and every two field picture divides parity field to handle.Therefore each oil drum to be identified has recognition result 6 times, does 6 results following comprehensive:
A) when handling for 6 times all when refusing to know, then this oil drum is refused knowledge;
B) when discerning correct number of times greater than the identification error number of times, then this oil drum identification is correct, otherwise, this oil drum identification error.
An ARM who conclusion finally is back to main equipment holds application program module 104, and produces corresponding operational order by it, determines whether to report to the police.