Summary of the invention
It is an object of the invention to provide a kind of grabgraf method and grabgraf device, solve prior art grabgraf efficiency low
Under technical problem.
To achieve these goals, on the one hand, provide a kind of grabgraf method, including:
Step one, image unit is with frame for unit input image data;
Step 2, grabgraf device is grabgraf from described view data, it is thus achieved that grabgraf data, and by described grabgraf number
According to being sent to FIFO;
Step 3, detects described FIFO, it is judged that described FIFO is the fullest, is, performs step 4, no
Then perform step 5;
Step 4, compares whether grabgraf number of repetition is less than predetermined threshold, is to return step 2, otherwise
Return the information that grabgraf is failed, terminate flow process;
Step 5, described grabgraf data are sent to image storage by FIFO.
Preferably, in above-mentioned method, before described step one, also include: arranged by user interface
Described predetermined threshold.
Preferably, in above-mentioned method, described grabgraf device uses the grabgraf pattern of whole frame, and distribution is from starting point
The memory space that can store a two field picture that location starts, starts in the way of address is incremented by from described initial address
Store described grabgraf data, capture a two field picture every time;When grabgraf failure captures again, again from described
First address starts to store described grabgraf data;
Or, described grabgraf device uses the grabgraf pattern of fragment, and what distribution started from the first address can store the
The memory space of one segment image and the memory space that can store the second segment image started from the second address,
Start from described first address to store described first segment image in the way of address is incremented by, then from described the
Double-address starts to store described second segment image in the way of address is incremented by, thus a two field picture is divided into two
Individual fragment, captures at twice;When grabgraf failure captures again, again start from described first address with ground
Location be incremented by mode store described first segment image, then start from described second address with address be incremented by
Mode stores described second segment image.
Preferably, in above-mentioned method, in described step 2, described grabgraf device is from described view data
Current frame image is carried out grabgraf;
In described step 4, if described grabgraf number of repetition is less than described predetermined threshold, returning institute
Before stating step 2, using next frame image as described current frame image.
To achieve these goals, the embodiment of the present invention additionally provides a kind of grabgraf device, including: image is defeated
Enter device, grabgraf device, FIFO, detection module, comparison module and image storage;
Described image unit is used for: with frame for unit input image data;
Described grabgraf device is used for: grabgraf from described view data, it is thus achieved that grabgraf data, and by described grabgraf
Data are sent to described FIFO;
Described detection module is used for: detect described FIFO, it is judged that described FIFO is the fullest, is, performs
Described grabgraf data are otherwise sent to described image storage by the function of described comparison module;
Described comparison module, is used for: compare whether grabgraf number of repetition is less than predetermined threshold, is to notify
Described grabgraf thinks highly of new grabgraf, otherwise returns the information that grabgraf is failed, terminates grabgraf flow process;
Described image storage, is used for: store the described grabgraf data from described FIFO.
Preferably, in above-mentioned grabgraf device, also include: user interface, be used for arranging described predetermined threshold
Value.
Preferably, in above-mentioned grabgraf device, described grabgraf device use whole frame grabgraf pattern, distribute from
The memory space that can store a two field picture that beginning address starts, from described initial address start with address be incremented by
Mode stores described grabgraf data, captures a two field picture every time;Grabgraf failure again capture time, again from
Described first address starts to store described grabgraf data;
Or, described grabgraf device uses the grabgraf pattern of fragment, and what distribution started from the first address can store the
The memory space of one segment image and the memory space that can store the second segment image started from the second address,
Start from described first address to store described first segment image in the way of address is incremented by, then from described the
Double-address starts to store described second segment image in the way of address is incremented by, thus a two field picture is divided into two
Individual fragment, captures at twice;When grabgraf failure captures again, again start from described first address with ground
Location be incremented by mode store described first segment image, then start from described second address with address be incremented by
Mode stores described second segment image.
Preferably, in above-mentioned grabgraf device, described user interface is additionally operable to: arrange grabbing of described grabgraf device
Chart-pattern and the size of crawl image.
At least there is techniques below effect in the present invention:
1) the grabgraf method that the embodiment of the present invention provides, after grabgraf failure, according to the number of repetition set
The most again grabgraf, makes the efficiency of grabgraf improve, can solve owing to system instantaneous bandwidth causes grabgraf to lose not
After losing, only grab and the most just exit, it is necessary to the manual problem that the most just can obtain an image.
2) again grabgraf time, it is not necessary to be reconfigured at the related register from new grabgraf, directly with configuring last time
Register information carry out grabgraf, such efficiency is the highest.
3) again grabgraf time, if number of repetition just exits grabgraf program more than pre-determined number, return mistake
Information to user interface, represents that grabgraf is repeated several times is all failed, and user can abandon grabbing in this case
Figure;Number of repetition can be set by user oneself, uses flexibly.
4) the grabgraf pattern arranged according to user interface is frame or slice pattern, and the method is the suitableeest
Close, use the most flexible.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with accompanying drawing pair
Specific embodiment is described in detail.
The flow chart of steps of the grabgraf method that Fig. 2 provides for the embodiment of the present invention, as in figure 2 it is shown, grabgraf
Method includes:
Step 201, image unit is with frame for unit input image data;
Step 202, grabgraf device is grabgraf from described view data, it is thus achieved that grabgraf data, and by described grabgraf
Data are sent to FIFO;
Step 203, detects described FIFO, it is judged that described FIFO is the fullest, is then to perform step 204,
Otherwise perform step 205;
Step 204, compares whether grabgraf number of repetition is less than predetermined threshold, is then to return step 202,
Otherwise return the information that grabgraf is failed, terminate flow process;
Step 205, described grabgraf data are sent to image storage by FIFO.
Wherein, before described step 201, also include: by user interface, described predetermined threshold is set.
Described grabgraf device uses the grabgraf pattern of whole frame, distribution can store a two field picture from what initial address started
Memory space, from described initial address start by address be incremented by the way of store described grabgraf data, every time
Capture a two field picture;When grabgraf failure captures again, again start from described first address to grab described in storage
Diagram data;
Or, described grabgraf device uses the grabgraf pattern of fragment, and multiple fragment can be divided to capture, and such as 2
Individual, 3 or 4 fragments.
When dividing 2 fragments, what the distribution of described grabgraf device started from the first address can store the first fragment figure
The memory space of picture and the memory space that can store the second segment image started from the second address, from described
One address starts to store described first segment image in the way of address is incremented by, and then opens from described second address
Begin to store described second segment image in the way of address is incremented by, thus a two field picture be divided into two fragments,
Capture at twice;Grabgraf failure again capture time, again start from described first address with address be incremented by
Mode stores described first segment image, then starts from described second address to store in the way of address is incremented by
Described second segment image.
In described step 202, current frame image is grabbed from described view data by described grabgraf device
Figure;In described step 204, if described grabgraf number of repetition is less than described predetermined threshold, returning
Before described step 2, using next frame image as described current frame image.
The detail flowchart of the grabgraf embodiment of the method that Fig. 3 provides for the embodiment of the present invention, as it is shown on figure 3,
Grabgraf method includes:
Step 301, arranges the size of image unit image to be inputted at user interface, the pattern of grabgraf,
Number of repetition and the order of grabgraf;
Step 302, the consecutive image data that image unit input is to be captured;
Step 303, grabgraf size and grabgraf pattern that grabgraf device is arranged according to user interface carry out grabgraf
Step 304, the view data of grabgraf FIFO caching grabgraf device transmission
Step 305, whether detection grabgraf FIFO there is FIFO full, is then to perform step 307, otherwise
Perform step 306;
Step 306, image storage preserves the image that grabgraf device is caught, goes to step 311;
Step 307, it is judged that the grabgraf repetition time whether number of times of actual grabgraf is arranged less than " user interface "
Number, is then to perform step 308, otherwise performs step 310;
Step 308, according to grabgraf pattern, carries out grabgraf again;
Step 309, needs to be thought highly of new grabgraf by grabgraf, returns step 304;
Step 310, returns the failed information of grabgraf to user interface;
Step 311, terminates.
Visible, that the embodiment of the present invention provides grabgraf method, after grabgraf failure, grabgraf the most again, make
The efficiency of grabgraf improves, and can solve, owing to system instantaneous bandwidth causes grabgraf failure not, only to grab and the most just move back
Go out, it is necessary to the manual problem that the most just can obtain an image.
The structure chart of the grabgraf device that Fig. 4 provides for the embodiment of the present invention, as shown in Figure 4, grabgraf device bag
Include: image unit 402, grabgraf device 403, FIFO404, detection module 405, comparison module 406 and
Image storage 407;
Described image unit 402 is used for: with frame for unit input image data;
Described grabgraf device 403 is used for: grabgraf from described view data, it is thus achieved that grabgraf data, and by described
Grabgraf data are sent to described FIFO 404;
Described detection module 405 is used for: detect described FIFO 404, it is judged that described FIFO 404 is the most
Full, it is to perform the function of described comparison module 406, otherwise described grabgraf data are sent to described image
Memorizer 407;
Described comparison module 406, is used for: compare whether grabgraf number of repetition is less than predetermined threshold, is then
Notify described grabgraf device 403 grabgraf again, otherwise return the information that grabgraf is failed, terminate grabgraf flow process;
Described image storage 407, is used for: store the described grabgraf data from described FIFO.
Also include: user interface 401, be used for arranging described predetermined threshold, be additionally operable to arrange described grabgraf
The grabgraf pattern of device and the size of crawl image.Described grabgraf device 403 uses the grabgraf pattern of whole frame, every time
Capture a two field picture;Or, described grabgraf device 403 uses the grabgraf pattern of fragment, is divided into by a two field picture
Multiple fragments, capture several times.
In the grabgraf device that the embodiment of the present invention provides, after there is FIFO full, i.e. when occurring grabgraf to lose
After losing, grabgraf error in data will occur, this time grabgraf failure;Then judge what " user interface " was arranged
Grabgraf number of repetition, if grabgraf is less than this number of times, the most automatic grabgraf, improves grabgraf efficiency;
If greater than this number of times;Just exit grabgraf program, return error message to user interface;Again during grabgraf,
Need not be reconfigured at the related register from new grabgraf, directly grab with the register information of configuration last time
Figure, such efficiency is the highest;If whole frame pattern (frame mode), during grabgraf, once grab a two field picture,
Again from the beginning of next frame again grabgraf during grabgraf;If fragment schema (slice mode), many during grabgraf
Individual slice circulates grabgraf, again during grabgraf from the beginning of next frame, to all slice again grabgraf.Use this
Method, improves the efficiency of system grabgraf.
Hereinafter each module is further explained in detail;
User interface 401, is used for:
1) size of image unit image to be inputted is set;
2) pattern of grabgraf device grabgraf is set, is frame or slice.Wherein,
A) Frame: represent the memory space (memory) of distribution one frame sign, once grab a frame
Image;After grabgraf failure, grabgraf process is as follows again: configuration address A during (memorizer) grabgraf for the first time,
Grabgraf data will the most incrementally start to preserve data from address A;If when grabgraf failure again
Need grabgraf, now continue to start to preserve image from address A, the same with the mode preserved for the first time, this
Sample just can be from newly obtained data;
B) slice: represent that being divided into multiple slice carries out grabgraf, 2 slcie sizes of general distribution
Memory, carries out grabgraf by mode alternately;After grabgraf failure, grabgraf process is as follows again: assume have 2
Individual address, address A, address B, it is assumed that start to start grabgraf from address A, after grabgraf is failed, under
Secondary also continuing to address A grabgraf, data the most incrementally preserve.
3) the image size of grabgraf is set;
4) file name of grabgraf according to practical situation, can be inputted or automatically generate file name;
5) image grabbing command is sent;
6) need to repeat the number of times of grabgraf after grabgraf failure, after exceeding this number of repetition, just exit and grab
Figure program.
Image unit 402 is used for:
1) view data to be captured inputted it is used for;
2) this view data inputs in units of frame;
3) this view data can be the dynamic data that sensor (sensor) inputs, it is also possible to be storage
The view data that device preserves;
4) data form can be YUV (Y: luminance signal, U: colour difference signal R-Y, V: color
Difference signal B-Y), RGB (R: red, G: green, B;Blue) etc. any form;
Grabgraf device 403 is used for:
1) grabgraf size and the grabgraf pattern arranged according to user interface carries out grabgraf;
2) data that grabgraf is obtained are sequentially sent to grabgraf FIFO, are deposited by grabgraf FIFO write image
Reservoir;
3) data are linear inputs.
Grabgraf FIFO 404 is used for:
1) it is used for caching the view data of grabgraf device transmission;
2) view data of caching is inputed to image storage preserve;
3) inconsistent, when long-time continuous due to the speed of image input FIFO and FIFO output image
During the speed that the speed of input FIFO exports more than FIFO, will result in FIFO full;
Detection module 405 is used for: detects whether FIFO full, can grab after there is FIFO full
Diagram data mistake, this time grabgraf failure;
Comparison module 406, is used for: judge the grabgraf weight whether grabgraf number of times is arranged less than " user interface "
Again count, if grabgraf number of times is less than the grabgraf number of repetition of this setting, grabgraf the most again;If it is big
In this number of times;Just exit grabgraf program, return error message to user interface;
Again during grabgraf, it is not necessary to be reconfigured at the related register from new grabgraf, directly posting with configuration last time
Storage information carries out grabgraf, and such efficiency is the highest;
If frame is mode, once grab a two field picture during grabgraf, again during grabgraf from the beginning of next frame
Again grabgraf;
If slice is mode, during grabgraf, multiple slice circulate grabgraf, again during grabgraf from the beginning of next frame,
To all slice again grabgraf;
Image storage 407, is used for:
1) it is used for preserving the image that grabgraf device is caught;
2) this image storage can be DDR (Double Data Rate Double Data Rate synchronous dynamic with
Machine memorizer), any storage device such as SDRAM (synchronous DRAM);
From the foregoing, it will be observed that the embodiment of the present invention has the advantage that
1) the grabgraf method that the embodiment of the present invention provides, after grabgraf failure, according to the number of repetition set
The most again grabgraf, makes the efficiency of grabgraf improve, can solve owing to system instantaneous bandwidth causes grabgraf to lose not
After losing, only grab and the most just exit, it is necessary to the manual problem that the most just can obtain an image.
2) again grabgraf time, it is not necessary to be reconfigured at the related register from new grabgraf, directly with configuring last time
Register information carry out grabgraf, such efficiency is the highest.
3) again grabgraf time, if number of repetition just exits grabgraf program more than pre-determined number, return mistake
Information to user interface, represents that grabgraf is repeated several times is all failed, and user can abandon grabbing in this case
Figure;Number of repetition can be set by user oneself, uses flexibly.
4) the grabgraf pattern arranged according to user interface is frame or slice pattern, and the method is the suitableeest
Close, use the most flexible.
The above is only the preferred embodiment of the present invention, it is noted that common for the art
For technical staff, under the premise without departing from the principles of the invention, it is also possible to make some improvements and modifications,
These improvements and modifications also should be regarded as protection scope of the present invention.