Summary of the invention
The present invention provides a kind of mould template image generation system and method, and it is raw to automatically generate mould template image, mentions
High working efficiency;The mould template image of generation is used in mold monitoring system, and accuracy in detection can be improved, and reduces false alarm,
Detection efficiency is not influenced simultaneously.
In order to solve the above technical problems, according to an aspect of the present invention, adopting the following technical scheme that
A kind of mould template image generation system, it includes: time interval memory module, mould that the template image, which generates system,
Plate acquisition module, template memory module, template read module, Template Learning module;
Template image acquisition interval data of the time interval memory module to store each period;
The template acquisition module, will be in corresponding acquisition time to acquire image information in real time or at interval of setting time
Template image of the point acquired image as corresponding time point;
The template image that the template memory module is acquired to store the template acquisition module in various time points, or
The dynamic template video file that person/and the template image for storing various time points are formed;
The Template Learning module is between two adjacent acquisition times, present image and previous width to have been acquired
Template image be compared, if difference be greater than given threshold, add current time outside the regular acquisition time of setting
Point is used as an acquisition time, and stores present image as template image.
As one embodiment of the present invention, the mould template image generation system further include:
Fiducial time determining module, to determine fiducial time;
Acquisition time determining module, to be set in conjunction with the time interval memory module on the basis of fiducial time
Fixed acquisition interval data generate each acquisition time.
As one embodiment of the present invention, the template acquisition module is to raw in the fiducial time determining module
After fiducial time, a width template image is captured immediately;Then, each acquisition determined in the acquisition time determining module
Time point captures a width template image.
As one embodiment of the present invention, the mould template image generation system further include:
Time interval generation module is deposited to set the acquisition interval data of each period, and by acquisition interval data
It is stored in time interval storage file;
Clock trigger, to read the corresponding acquisition interval data of current time from time interval storage file.
As one embodiment of the present invention, after one time interval tmInters [n] of every generation, clock trigger root
According to fiducial time, continuous accumulation time interval value;The accurate triggered time is thus continuously generated on the basis of fiducial time;
Clock trigger compares triggered time and current time, the triggered time be more than or equal to current time when, immediately to
Template acquisition module sends trigger signal to capture new template;
Template when clock trigger triggers template acquisition, from supervision camera crawl present image as the corresponding time point
Figure.Time interval tmInters [n] value is stored in file Ft, and current template image moldImage [n] is stored in template video file Fm
In;
Numerous template images of crawl, temporally put corresponding sequence, are stored in file with video mode, generate a correspondence
Dynamic template video, every piece image corresponding time point in video;
In this way, all corresponding to one in Fm file in each of Ft file time interval tmInters [n]
MoldImage [n], the data between two files form one-to-one relationship.
As one embodiment of the present invention, the mold monitoring system further include:
Template obtains module, to obtain the continuous template image of two width from the template memory module;
Template matching module is compared will acquire the continuous template image of two width, if the continuous Prototype drawing of two width
Difference as between is greater than given threshold, then it is assumed that needs to generate new template image therebetween;
Template generation module generates new template image continuous two width template image is carried out linear interpolation;
The template generation module is generated by new template linearity interpolation method, position in new template image (x,
Y) corresponding pixel value f[mn′](x, y) is obtained from the calculated for pixel values of two width Prototype drawing corresponding position of front and back:
f[mn′](x, y)=f[m](x,y)*e+f[n](x, y) * (1-e), in which:
As t [mn ']=T [m], e=1, f[mn′](x, y)=f[m](x, y), i.e. moldImage [mn ']=moldImage
[m];Conversely, as t [mn ']=T [n], e=0, f[mn′](x, y)=f[n](x, y), i.e. moldImage [mn ']=
moldImage[n];
Wherein, T [m] is real time, f[m](x, y) is the pixel of the template image in the position (x, y) at corresponding T [m] moment
Value, t [m] are the time for needing to generate new template image in two real times;
The template generation module connects motion estimation module, and motion estimation module between two width templates to differ greatly
Part carry out estimation, find minimum difference position, form this with the position partial image data come interpolation and differ greatly
Partial partial image data.
A kind of mould template image generating method, the template image generation method include the following steps:
Time interval storing step stores the template image acquisition interval data of each period;
Template acquisition step acquires image information in real time or at interval of setting time, will be in corresponding acquisition time acquisition
Template image of the image arrived as corresponding time point;
Template storing step stores the template image that the template acquisition module is acquired in various time points, or/and
Store the dynamic template video file that the template image of various time points is formed;
Template Learning step, between two adjacent acquisition times, template that present image and previous width have been acquired
Image is compared, if difference is greater than given threshold, current point in time conduct is added outside the regular acquisition time of setting
One acquisition time, and stored present image as template image.
As one embodiment of the present invention, the mould template image generating method further includes template generation step;
The continuous two width template image obtained from template memory module is subjected to linear interpolation to generate new template image;
It is generated by new template linearity interpolation method, the corresponding pixel value in position (x, y) in new template image
f[mn′](x, y) is obtained from the calculated for pixel values of two width Prototype drawing corresponding position of front and back:
f[mn′](x, y)=f[m](x,y)*e+f[n](x, y) * (1-e), in which:
As t [mn ']=T [m], e=1, f[mn′](x, y)=f[m](x, y), i.e. moldImage [mn ']=moldImage
[m];Conversely, as t [mn ']=T [n], e=0, f[mn′](x, y)=f[n](x, y), i.e. moldImage [mn ']=
moldImage[n];
Before generating new template image, compare the difference of moldImage [m] Yu moldImage [n], when the local difference of appearance
When excessive, error is reduced using estimation;
The template generation step includes motion-estimation step, carries out movement to the part to differ greatly two width templates and estimates
Meter, finds minimum difference position, forms topography's number of the part that differs greatly come interpolation with the position partial image data
According to;
If difference is greater than the set value between two sequence adjacent forms, inserted between the two adjacent forms images using linear
Generate new template image;The template generation module is new to generate by the adjacent two width template image progress linear interpolation in front and back
Template image, linear coefficient are calculated by new template image corresponding time point and the time difference of front and back template image, front and back mould
Plate image corresponding time point is that accumulation time interval obtains on the basis of fiducial time, is practical at the time of new template image
Clock t;If generate new template after still alarm, alarm false alarm is judged as by operator after, can using present image as
New template is inserted into template sequence, while being updated using t-T as new time interval value into dynamic template video file Ft.
If difference is greater than given threshold between two sequence adjacent forms, and difference value only concentrates on partial region, then
Start motion estimation module and improves the precision for generating new template;The motion estimation module between two width templates for differing greatly
Part carry out estimation, find minimum difference position, use the position topography as the part that differs greatly part insert
It is worth reference map.
A kind of mould template image generation system, the template image generate system and include:
Time interval memory module, to store the template image acquisition interval data of each period;
Template acquisition module will be in corresponding acquisition time to acquire image information in real time or at interval of setting time
Template image of the acquired image as corresponding time point;
Template memory module, the template image acquired to store the template acquisition module in various time points, or/
And the dynamic template video file that the template image for storing various time points is formed.
A kind of mould template image generating method, the template image generation method include:
Time interval storing step stores the template image acquisition interval data of each period;
Template acquisition step acquires image information in real time or at interval of setting time, will be in corresponding acquisition time acquisition
Template image of the image arrived as corresponding time point;
Template storing step stores the template image that the template acquisition module is acquired in various time points, or/and
Store the dynamic template video file that the template image of various time points is formed.
The beneficial effects of the present invention are: mould template image generation system proposed by the present invention and method can give birth to automatically
It is raw at mould template image, improve working efficiency.The mould template image of generation is for can be improved detection in mold monitoring system
Accuracy reduces false alarm, while not influencing detection efficiency.
The invention proposes a kind of solutions based on multi-template, but detection is still only with a template ratio every time
Compared with not influencing working efficiency.Meanwhile corresponding template is recalled from the multi-template file of storage according to daily time point, by
In the highest benchmark image of accuracy that the template is under current working, and the image most like with actual condition, will not produce
Raw false alarm.Therefore, the present invention efficiently solves above-mentioned two problems.
Detection image of the present invention is fuzzy, is one kind is specifically used to whether detection image is fuzzy occurs, no matter this obscure is
Which kind of reason generates, and the fuzzy pictures as caused by the empty coke of camera lens, camera lens dust, scene cloud etc. can be detected effectively, and
It is not very sensitive to noise.
Specific embodiment
The preferred embodiment that the invention will now be described in detail with reference to the accompanying drawings.
For a further understanding of the present invention, the preferred embodiment of the invention is described below with reference to embodiment, still
It should be appreciated that these descriptions are only further explanation the features and advantages of the present invention, rather than to the claims in the present invention
Limitation.
Just for several typical embodiments, the present invention is not limited merely to the model of embodiment description for the description of the part
It encloses.Some technical characteristics in same or similar prior art means and embodiment, which are replaced mutually, also to be described in the present invention
In the range of protection.
The present invention discloses a kind of mould template image generation system, and Fig. 1 is mould template image in one embodiment of the invention
The composition schematic diagram of generation system;Referring to Fig. 1, in one embodiment of this invention, the mould template image generation system
It include: time interval memory module 1, template acquisition module 4, template memory module 2.Time interval memory module 1 is to store
The template image acquisition interval data of each period;Template acquisition module 4 is schemed to acquire in real time or at interval of setting time
As information, acquisition time acquired image will corresponded to as the template image at corresponding time point;Template memory module 2 is used
To store the template image that the template acquisition module is acquired in various time points, or/and store the moulds of various time points
The dynamic template video file that plate image is formed.
In one embodiment of this invention, the mould template image generation system further includes Template Learning module 6.It is described
Template Learning module 6 is between two adjacent acquisition times, template image that present image and previous width have been acquired
It is compared, if difference is greater than given threshold, current point in time is added outside the regular acquisition time of setting as one
Acquisition time, and stored present image as template image.
Under normal conditions, the difference of two adjacent acquisition times corresponding template image is less than given threshold;Together
When, two adjacent acquisition time ti、ti+1Between various time points txCorresponding template image mx, adjacent with corresponding two
Acquisition time corresponds to ti、ti+1Template image mi、mi+1Difference also below given threshold.But if in two adjacent acquisitions
Time point ti、ti+1Between some time point txCollected template image mx, acquisition time t adjacent theretoi、ti+1It adopts
The template image m collectedi、mi+1Difference be greater than given threshold, then add current time outside the regular acquisition time of setting
Point is used as an acquisition time tx, and using present image as template image mxStorage, so as to improve the accurate of detection
Degree, puts at any time convenient for detection system and is detected.
The effect of Template Learning module is in order in some special time points, the adjacent acquisition time set at two
Interior some time point collected template image Prototype drawing aberration corresponding with two adjacent acquisition times of the time point
It is different larger, therefore, by increasing acquisition time (and corresponding template image) outside the regular acquisition time of setting
Mode come the case where avoiding the occurrence of false alarm as far as possible.
In one embodiment of this invention, the mould template image generation system further include: fiducial time determining module,
Acquisition time determining module.Fiducial time determining module is to determine that fiducial time, (i.e. first time acquisition module image was adopted
Collect time point);Acquisition time determining module in conjunction with the time interval memory module to set on the basis of fiducial time
Fixed acquisition interval data generate each acquisition time.
In one embodiment of this invention, the template acquisition module is to generate base in the fiducial time determining module
After between punctual, a width template image is captured immediately;Then, each acquisition time determined in the acquisition time determining module
Point captures a width template image.
In one embodiment of this invention, the mould template image generation system further include: time interval generation module,
Clock trigger.Acquisition interval data of the time interval generation module to set each period, and by acquisition interval data
It is stored in time interval storage file;Clock trigger is corresponding to read current time from time interval storage file
Acquisition interval data.
In one embodiment of this invention, after one time interval tmInters [n] of every generation, clock trigger is according to base
Between punctual, continuous accumulation time interval value;The accurate triggered time is thus continuously generated on the basis of fiducial time;Clock
Trigger compares triggered time and current time, when the triggered time is more than or equal to current time, immediately to template acquisition module
Trigger signal is sent to capture new template.When clock trigger triggers template acquisition, present image conduct is grabbed from supervision camera
The Prototype drawing at the corresponding time point.Time interval tmInters [n] value is stored in file Ft, current template image moldImage [n]
It is stored in template video file Fm.Numerous template images of crawl, temporally put corresponding sequence, are stored in text with video mode
Part generates a corresponding dynamic template video, the corresponding time point of every piece image in video.In this way, in Ft file
Each of time interval tmInters [n], a moldImage [n] is all corresponded in Fm file, between two files
Data form one-to-one relationship.
In one embodiment of this invention, the mold monitoring system further include: template obtains module, template matching mould
Block, template generation module.
Template obtains module to obtain the continuous template image of two width from the template memory module;Template matching module
It is compared will acquire the continuous template image of two width, if the difference between the continuous template image of two width is greater than setting threshold
Value, then it is assumed that need to generate new template image therebetween;Template generation module to by continuous two width template image into
Row linear interpolation generates new template image.
The template generation module is generated by new template linearity interpolation method, position in new template image (x,
Y) corresponding pixel value f[mn′](x, y) is obtained from the calculated for pixel values of two width Prototype drawing corresponding position of front and back:
f[mn′](x, y)=f[m](x,y)*e+f[n](x, y) * (1-e), in which:
As t [mn ']=T [m], e=1, f[mn′](x, y)=f[m](x, y), i.e. moldImage [mn ']=moldImage
[m];Conversely, as t [mn ']=T [n], e=0, f[mn′](x, y)=f[n](x, y), i.e. moldImage [mn ']=
moldImage[n]。
Wherein, T [m] is real time, f[m](x, y) is the pixel of the template image in the position (x, y) at corresponding T [m] moment
Value, t [m] are the time for needing to generate new template image in two real times.
The template generation module connects motion estimation module, and motion estimation module between two width templates to differ greatly
Part carry out estimation, find minimum difference position, form this with the position partial image data come interpolation and differ greatly
Partial partial image data.
If difference is greater than the set value between two sequence adjacent forms, inserted between the two adjacent forms images using linear
Generate new template image;The template generation module is new to generate by the adjacent two width template image progress linear interpolation in front and back
Template image, linear coefficient are calculated by new template image corresponding time point and the time difference of front and back template image, front and back mould
Plate image corresponding time point is that accumulation time interval obtains on the basis of fiducial time, is practical at the time of new template image
Clock t;If generate new template after still alarm, alarm false alarm is judged as by operator after, can using present image as
New template is inserted into template sequence, while being updated using t-T as new time interval value into dynamic template video file Ft.
In one embodiment of this invention, if difference is greater than given threshold, and difference between two sequence adjacent forms
Value only concentrates on partial region, then starts motion estimation module and improve the precision for generating new template;The motion estimation module is used
In carrying out estimation to the part to differ greatly two width templates, minimum difference position is found, is made with the position topography
For the local interpolation reference map for the part that differs greatly.
The present invention discloses a kind of mould template image generating method, and the template image generation method includes:
Time interval storing step stores the template image acquisition interval data of each period;
Template acquisition step acquires image information in real time or at interval of setting time, will be in corresponding acquisition time acquisition
Template image of the image arrived as corresponding time point;
Template storing step stores the template image that the template acquisition module is acquired in various time points, or/and
Store the dynamic template video file that the template image of various time points is formed.
In one embodiment of this invention, the mould template image generating method further comprises: Template Learning step,
Between two adjacent acquisition datum marks, present image is compared with the template image that previous width has acquired, if difference is big
In given threshold, then current point in time is added as an acquisition time outside the rule acquisition datum mark of setting, and will work as
Preceding image is stored as template image.
In one embodiment of this invention, the mould template image generating method further includes template generation step;It will be from
The continuous two width template image obtained in template memory module carries out linear interpolation to generate new template image.
It is generated by new template linearity interpolation method, the corresponding pixel value in position (x, y) in new template image
f[mn′](x, y) is obtained from the calculated for pixel values of two width Prototype drawing corresponding position of front and back:
f[mn′](x, y)=f[m](x,y)*e+f[n](x, y) * (1-e), in which:
As t [mn ']=T [m], e=1, f[mn′](x, y)=f[m](x, y), i.e. moldImage [mn ']=moldImage
[m];Conversely, as t [mn ']=T [n], e=0, f[mn′](x, y)=f[n](x, y), i.e. moldImage [mn ']=
moldImage[n]。
Before generating new template image, compare the difference of moldImage [m] Yu moldImage [n], when the local difference of appearance
When excessive, error is reduced using estimation.
The template generation step includes motion-estimation step, carries out movement to the part to differ greatly two width templates and estimates
Meter, finds minimum difference position, forms topography's number of the part that differs greatly come interpolation with the position partial image data
According to.
If difference is greater than the set value between two sequence adjacent forms, inserted between the two adjacent forms images using linear
Generate new template image;The template generation module is new to generate by the adjacent two width template image progress linear interpolation in front and back
Template image, linear coefficient are calculated by new template image corresponding time point and the time difference of front and back template image, front and back mould
Plate image corresponding time point is that accumulation time interval obtains on the basis of fiducial time, is practical at the time of new template image
Clock t;If generate new template after still alarm, alarm false alarm is judged as by operator after, can using present image as
New template is inserted into template sequence, while being updated using t-T as new time interval value into dynamic template video file Ft.
If difference is greater than given threshold between two sequence adjacent forms, and difference value only concentrates on partial region, then
Start motion estimation module and improves the precision for generating new template;The motion estimation module between two width templates for differing greatly
Part carry out estimation, find minimum difference position, use the position topography as the part that differs greatly part insert
It is worth reference map.
Present invention discloses a kind of mold monitoring system, Figure 10 is timeline multi-template detection system in one embodiment of the invention
The composition schematic diagram of system;Referring to Fig. 10, in one embodiment of this invention, the mold monitoring system includes: time interval
Memory module 1, template memory module 2, template acquisition module 3, template read module 4, template comparison in difference module 5.
Acquisition interval data of the time interval memory module 1 to store each period.Template memory module 2 is to deposit
The template image of various time points is stored up, or/and stores the dynamic template video text that the template image of various time points is formed
Part.Template acquisition module 3 is to the acquisition interval data acquisition board image that is stored according to the time interval memory module.Mould
Plate read module 4 from the template memory module to read corresponding template image, when each template image is one corresponding
Between point.Template comparison in difference module 5 is to compare the template image obtained in real time and correspond to the time in the template memory module
The template image of point, obtains comparison result.
In one embodiment of this invention, the template comparison in difference module to compare the template image obtained in real time with
The difference of the template image at time point is corresponded in the template memory module, if difference is greater than given threshold, then it is assumed that have different
Often.
In one embodiment of this invention, the mold monitoring system further includes template generation module, to by continuous two
Width template image carries out linear interpolation to generate new template image.
Figure 11 is new template image generating method schematic diagram in one embodiment of the invention;Figure 11 is please referred to, of the invention
In one embodiment, the template generation module is generated by new template linearity interpolation method, the position in new template image
(x, y) corresponding pixel value f[mn′](x, y) is obtained from the calculated for pixel values of two width Prototype drawing corresponding position of front and back:
f[mn′](x, y)=f[m](x,y)*e+f[n](x, y) * (1-e), in which:
As t [mn ']=T [m], e=1, f[mn′](x, y)=f[m](x, y), i.e. moldImage [mn ']=moldImage
[m];Conversely, as t [mn ']=T [n], e=0, f[mn′](x, y)=f[n](x, y), i.e. moldImage [mn ']=
moldImage[n]。
T [m] is real time, f[m](x, y) is pixel value of the template image at corresponding T [m] moment in the position (x, y), t
[m] is the time for needing to generate new template image in two real times.
Before generating new template image, compare the difference of moldImage [m] Yu moldImage [n], when the local difference of appearance
When excessive, error is reduced using estimation.
In one embodiment of this invention, the template generation module connects motion estimation module, and motion estimation module is used
To carry out estimation to the part to differ greatly two width templates, minimum difference position is found, with the position topography number
According to the partial image data for carrying out interpolation and being formed the part that differs greatly.
In one embodiment of this invention, if difference is greater than the set value between two sequence adjacent forms, the two phases
New template image is generated using linear insert between adjacent template image;The template generation module is by the adjacent two width template image in front and back
Linear interpolation is carried out to generate new template image, linear coefficient passes through new template image corresponding time point and front and back Prototype drawing
The time difference of picture calculates, and front and back template image corresponding time point is that accumulation time interval obtains on the basis of fiducial time,
It is practical clock t at the time of new template image;If still alarmed after generating new template, alarm is judged as wrong report by operator
It after police, can be inserted into present image as new template in template sequence, while be arrived using t-T as new time interval value update
In dynamic template video file Ft.
If difference is greater than given threshold between two sequence adjacent forms, and difference value only concentrates on partial region, then
Start motion estimation module and improves the precision for generating new template;The motion estimation module between two width templates for differing greatly
Part carry out estimation, find minimum difference position, use the position topography as the part that differs greatly part insert
It is worth reference map.
In one embodiment of this invention, the template read module is at least sequentially read out two width template images every time,
The difference for two template images that the template comparison in difference module is read out in order to the template read module,
If difference is lower than given threshold, read out two template images are used to detect;If difference is greater than given threshold,
Active template generation module.
In one embodiment of this invention, the template read module can also only read a width template image every time.It reads
Two width template image out is to prevent occurring mistake in learning process.If in learning process and monitoring detection process is independent, that is, learn
It is not detected during practising, it is not known that whether the template image of study meets the requirements, and needs to read two width Prototype drawings during monitoring
Picture automatically generates new template when finding that adjacent forms difference is excessive, lower false alarm.If in learning process simultaneously into
Row detection, light variation it is excessive and when alarming, a width Prototype drawing is added in manual intervention.This ensures that the change between template image
Change is all not too large, and there is no need to read two width Prototype drawings for monitoring process.
In one embodiment of this invention, the mold monitoring system further include: time interval generation module, clock triggering
Device.When time interval generation module is to set the acquisition interval data of each period, and acquisition interval data are stored in
Between be spaced storage file in.Clock trigger from time interval storage file to read the corresponding acquisition interval of current time
Data.
Fig. 2 is the composition schematic diagram of timeline multi-template detection system in one embodiment of the invention;Referring to Fig. 2, at this
In one embodiment of invention, timeline multi-template detection system includes: time interval generation module S100, clock trigger
S200, template acquisition module S300, template sequence memory module S400, template read module S500, template comparison in difference S600,
Template generation module S700, motion estimation module S800.
Time interval generation module S100 automatically generates acquisition interval according to current time and the adjusting parameter of setting
tmInters[n].Time interval generting machanism has: by current time, according to fixed interval, by linear change rule increase or
It reduces, changes by nonlinear function rule change.The time interval tmInters [n] (n=0,1,2 ...) of generation is suitable according to the time
After sequence is queued up, private file Ft is arrived in storage, and file format is: fiducial time is written in file header, when being then written in order
Between be spaced.Referring to Fig. 9, Fig. 9 is the storage strategy schematic diagram of one of one embodiment of the invention Ft data file.According to base
The plinth time, add up all time intervals, and at each time interval corresponding specific time point, which is exactly to acquire mould
The specific moment of plate.Referring to Fig. 8, Fig. 8 is one of one embodiment of the invention template grabgraf time interval scheme schematic diagram.
Clock trigger S200 corresponding interval data of reading section current time from time interval storage file
tmInters[n].By time interval on the basis of fiducial time after the corresponding time T of continuous Accumulating generation, with it is currently practical when
Clock t compares, if T > t, that is, the time generated is greater than the currently practical time, illustrates to have arrived or be already expired the template acquisition moment, immediately
Trigger signal is sent to template acquisition module.In clock trigger triggering template acquisition, template acquisition module S300 extraction is worked as
Preceding image is Prototype drawing.
S400 is to store template image for template sequence memory module;Template image is stored in file with video mode.Storage
Before, current template figure is compared with previous Prototype drawing.When finding that current template figure and previous width image change are larger, due to
Time interval has been set, can not adjustment time interval and grabgraf again.So being adopted for this image changed greatly
With forcing the mode at key frame to be stored in video image, the clarity of image is improved, is please referred to shown in Fig. 5.
Template reads module S500 to read template one by one in order from dynamic template video file, at least reads every time
Two width Prototype drawing out.Difference of the template comparison in difference S600 module to compare two adjacent forms images, if difference is little,
Then it is directly used in detection.
Template generation module S700 is to generate new template.It is necessary if difference is excessive between two sequence adjacent forms
When the two adjacent forms figures between using linear insert generate new Prototype drawing.Two width template image of front and back carries out linear interpolation next life
At new template, linear coefficient can be calculated by cumulative time T and practical clock t difference, when new template corresponding time point is practical
Between t.It, can be using present image as new after alarm is judged as false alarm by operator if still alarmed after generating new template
Template is inserted into template sequence, while being updated using t-T as new time interval value into file Ft.
If difference is excessive between two sequence adjacent forms, if difference value only concentrates on partial region, start
Motion estimation module S800 improves the precision for generating new template.Estimation is carried out between the part to differ greatly two width templates,
Minimum difference position is found, the position topography is used to please refer to Fig. 6 institute as the local interpolation reference map for the part that differs greatly
Show.Fig. 7 is the interpolation image effect diagram that estimation changes shadow in one embodiment of the invention.
The present invention discloses a kind of monitoring guard method of mold, the mold monitoring guard method the following steps are included:
Time interval memory module stores the acquisition interval data of each period;Template memory module stores each time
Point template image, or/and store various time points template image formed dynamic template video file;
The acquisition interval data acquisition board image that template acquisition module is stored according to the time interval memory module;
Template read module reads corresponding template image, each template image corresponding one from the template memory module
A time point;
Template comparison in difference module compares in the template image and the template memory module obtained in real time and corresponds to time point
Template image, obtain comparison result.
As one embodiment of the present invention, the mold monitoring guard method includes: monitoring testing process;
In practical surveillance detection-phase, clock trigger needs read readout time interval one by one from Ft, while from Fm
Middle reading template image.
In detection process, fiducial time is read from pre-stored file Ft first, then reads next time one by one
It is spaced tmInters [n];On the basis of fiducial time, the corresponding time point T of each time interval is calculated.
Template reads module according to corresponding time point, and current template image is read from dynamic template video file
moldImage[n]。
Then, Trigger of time is started to work.
Trigger of time is then sequentially read out time interval, in fiducial time after reading fiducial time in memory
On the basis of it is constantly cumulative, generate the accurate triggered time.
Corresponding template image moldImage [n] is read from template video file Fm simultaneously.
At each practical moment, the tmInters [n] and moldImage [n] at next time point are read, because each
Template image only correspond to a time point, to read two time points between the case where, if it is determined that adjacent two width template image
Difference is excessive, or false alarm occurs, when needing to generate new template image, generates new template by way of the template interpolation of front and back
Image.The front and back two images for only reading the currently practical time just can be carried out and generate new template as needed.
Therefore, Trigger of time first time is other than fiducial time to be read and corresponding template image, it is also necessary under reading
One time interval and template image.
Later before generating each new template and generating, after being sequentially read out a template in dynamic template video file,
Read corresponding template of next time point in advance simultaneously.
After reading two or more templates, compare the difference of two width template images before and after the real time.
New template is generated using multiple template image when necessary.When adjacent forms difference value is larger, active template is generated
Module utilizes the more accurate new template of two width template generation of front and back.
Sometimes because the time interval between template is excessive, new template can also be generated at any time to improve precision.
When between two width difference template images only local with larger difference, then needs to activate motion estimation module, look for
To the optimal analogous location of topography.
Motion estimation module can improve the precision for generating new template.The part to differ greatly two width templates is moved
Estimation, finds minimum difference position, uses the position topography as the local interpolation reference map for the part that differs greatly.
As one embodiment of the present invention, the mold monitoring guard method includes: Template Learning process;
In the Template Learning stage, timeline sequence is firstly generated.
After Template Learning starts, it is first determined fiducial time tmInters [0], on the basis of fiducial time, timeline
Sequence can calculate time point T by cumulative mode.
The calculating of timeline needs time interval tmInters [n] (1,2,3 ...).Time interval generation module can basis
Different create-rules generates different time interval values.
Referring to Fig. 3, according to the requirement of current point in time, being generated according to the definition of rule on the basis of fiducial time
Current time interval is stored in file Ft after being queued up in order.
After generating fiducial time, a width template image is captured immediately, then, each time interval corresponding time point
Capture a width template image.
After one time interval tmInters [n] of every generation, clock trigger is according to fiducial time, between continuous accumulation interval
Every value.The accurate triggered time is thus continuously generated on the basis of fiducial time.
Clock trigger compares triggered time and current time, the triggered time be more than or equal to current time when, immediately to
Template acquisition module sends trigger signal to capture new template.
Template when clock trigger triggers template acquisition, from supervision camera crawl present image as the corresponding time point
Image.Time interval tmInters [n] value is stored in file Ft, and current template image moldImage [n] is stored in template video file
In Fm.
Numerous template images of crawl, temporally put corresponding sequence, are stored in file with video mode, generate a correspondence
Dynamic template video, every piece image corresponding time point in video;
In this way, all corresponding to one in Fm file in each of Ft file time interval tmInters [n]
MoldImage [n], the data between two files form one-to-one relationship, please refer to shown in Fig. 4.
In the Template Learning stage, can also be detected simultaneously.First width template is the image of the candid photograph of corresponding fiducial time,
Subsequent each time point is standard drawing, and before capture next time, present image compares with previous width template image, alarms
When, judged by operator, if it is confirmed that being false alarm, is immediately generated new time interval tmInters [n], that is, setting
The outer addition current point in time of fixed rule is stored as an acquisition time, and using present image as template image, please be joined
Read Fig. 5.
In one embodiment of this invention, certain factory's injection molding machine is on the window side to the south of workshop, every morning 9~11
Point, afternoon 2~4 point have sunlight to be affected, and have in section time direct sunlight to injection molding machine, according to field condition, determine following
Dynamic template triggered time interleaving pattern:
1) morning 6~8 point, night turn daytime, and light gradually becomes by force, and triggering in every 120 seconds is primary, i.e. and tmInters [0]=
120;
2) morning 8~9, transition stage, triggering in every 60 seconds is primary, i.e. tmInters [1]=60;
3) morning 9~11 point, shine upon the stage in the morning, and for continually changing elimination shade, every five seconds triggering is primary,
That is tmInters [3]=5;
4) 11~14 points, daytime strong light stage, light changes less greatly, and triggering in every 300 seconds is primary, i.e. tmInters [4]
=300;
5) 14~16 points, afternoon sunlight illumination stage, for continually changing elimination shade, every five seconds triggering is primary, i.e.,
TmInters [5]=5;
6) 16~18 points, sunlight gradually dies down the stage, and triggering in every 60 seconds is primary, i.e. tmInters [6]=60;
7) 18~20 points, at blackening night on daytime, triggering in every 120 seconds is primary, i.e. tmInters [7]=120;
8) do not changed for night using lighting for 20 points to second day 6 points of dawn of evening, single template can be used, out
The hair time can set very long, tmInters [8]=1200.
The phases-time figure of above-mentioned trigger method is as shown in Figure 8.
Optimisation strategy 1)
TmInters [n] only has numerical value in 8 in the program, and therefore, Ft file, which does not need to grab template image every time, all to be remembered
TmInters [n] value is recorded, it can be by the way of data structure:
StuInter[n]{
inticount;
inttmInter;
}
Note that above-mentioned data structure index is tmInters index, each tmIntes of structural body corresponding one using secondary
Number that is, every the template grabgraf of triggering in 120 seconds, triggers for 60 times such as morning 6~8 point tmInters [0]=120 totally for 2 hours,
So the icount=60 in StuInter [0], it may be assumed that
StuInter [0] .icount=60;
StuInter [0] .tmInter=120;
Similarly, the morning 9~11 point tmInters [3]=5, trigger 1440 times altogether, so:
StuInter [3] .icount=1440;
StuInter [3] .tmInter=5;
In this way, the data recorded into Ft file are considerably reduced, still, either Template Learning and time detect rank
Section, every partiting template still correspond to a specific triggering moment, therefore, the actual quantity of time interval and the quantity of template
All it is not reduced.Above data storage method is applicable in all schemes of the present invention.
Optimisation strategy 2)
The above-mentioned program each stage trigger interval time can use one for change of gradient in order to be connected each phase change data
A dynamic change transition, such as morning 6~8 point tmInters [0]=120,8~9tmInters in morning [1]=60, can be used with
Lower transition tactics: 1200 seconds totally 20 minutes tmInters were reduced to 60 seconds 7:40~8:00 from 120 seconds, and practical triggering times are
1200/ ((120+60)/2)=15 times, each attenuating value (120-60)/15=4 seconds, so since 7:40 in morning, 7:42's
TmInters=116 seconds, next time triggering moment 7:43:56, tmInters=112 seconds, until the tmInters=of 8:00
60 seconds.Other each phase changes can be all changed according to the above method, realize slow transition in this way, the trigger interval time is more
Add nature.The transition method of the above trigger interval is applicable in all schemes of the present invention.
Optimisation strategy 3)
Template image 60+60+1440+36+1440+120+60+30=3246 width image is grabbed altogether above, if pressing fps=
25 play, and also with regard to 129.84 seconds, i.e., store two minutes more video files altogether, are compressed using the H264 of high compression ratio,
Disk space very little, less than 500M.The occasion relatively high to required precision, is compressed, 1G is more with MJPEG.Illustrate multi-template
Scheme on storage space for be also it is feasible.The storage method of the above multi-template image is applicable in all schemes of the present invention.
In one embodiment of this invention, certain gate factory is exposed to the west, and gate is very big, injection molding machine from door proximity,
After 2 points of every afternoon, sunlight, due to passing in and out gate and outdoors frequent activity in courtyard, leads to room from ground return into workshop
Interior light variation frequently, is affected.In addition, having stockyard loader to work always to 10 points at night in courtyard outdoors terminates, 6 points
Neon illumination is opened later, after light intensity light source also has certain influence, especially darkness to mold monitoring system.According to live feelings
Condition determines following dynamic template triggered time interleaving pattern:
1) morning 6~8 point, night turn daytime, and light gradually becomes by force, and triggering in every 120 seconds is primary, i.e. and tmInters [0]=
120
2) morning 8~9, transition stage, triggering in every 60 seconds is primary, i.e. tmInters [1]=60
3) 9~13 points, since workshop gate is exposed to the west, the sun is unobvious on workshop influence, and triggering in every 300 seconds is primary, i.e.,
TmInters [2]=300
4) 13~14 points, influence of the sun to workshop is gradually obvious, and triggering in every 30 seconds is primary, i.e. tmInters [3]=30
5) 14~17 points, afternoon sunlight illumination stage, for continually changing elimination shade, every five seconds triggering is primary, i.e.,
TmInters [4]=5
6) 17~18 points, sunlight gradually dies down the stage, but is influenced by the sun is with a western exposure, and triggering in every 20 seconds is primary, i.e.,
TmInters [5]=20
7) 18~22 points, at blackening night on daytime, triggering in every 60 seconds is primary, i.e. tmInters [6]=60
8) do not changed for night using lighting for 22 points to second day 6 points of dawn of evening, single template can be used, out
The hair time can set very long, tmInters [7]=1200.
In conclusion mould template image generation system proposed by the present invention and method, can automatically generate mould template figure
As raw, raising working efficiency;The mould template image of generation is reduced for accuracy in detection to can be improved in mold monitoring system
False alarm, while not influencing detection efficiency.
The invention proposes a kind of solutions based on multi-template, but detection is still only with a template ratio every time
Compared with not influencing working efficiency.Meanwhile corresponding template is recalled from the multi-template file of storage according to daily time point, by
In the highest benchmark image of accuracy that the template is under current working, and the image most like with actual condition, will not produce
Raw false alarm.Therefore, the present invention efficiently solves above-mentioned two problems.
Detection image of the present invention is fuzzy, is one kind is specifically used to whether detection image is fuzzy occurs, no matter this obscure is
Which kind of reason generates, and the fuzzy pictures as caused by the empty coke of camera lens, camera lens dust, scene cloud etc. can be detected effectively, and
It is not very sensitive to noise.
Each technical characteristic of embodiment described above can be combined arbitrarily, for simplicity of description, not to above-mentioned reality
It applies all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited
In contradiction, all should be considered as described in this specification.
Description and application of the invention herein are illustrative, is not wishing to limit the scope of the invention to above-described embodiment
In.The deformation and change of embodiments disclosed herein are possible, the realities for those skilled in the art
The replacement and equivalent various parts for applying example are well known.It should be appreciated by the person skilled in the art that not departing from the present invention
Spirit or essential characteristics in the case where, the present invention can in other forms, structure, arrangement, ratio, and with other components,
Material and component are realized.Without departing from the scope and spirit of the present invention, can to embodiments disclosed herein into
The other deformations of row and change.