CN102611836A - High-speed image collecting method based on Labview - Google Patents
High-speed image collecting method based on Labview Download PDFInfo
- Publication number
- CN102611836A CN102611836A CN2012100248402A CN201210024840A CN102611836A CN 102611836 A CN102611836 A CN 102611836A CN 2012100248402 A CN2012100248402 A CN 2012100248402A CN 201210024840 A CN201210024840 A CN 201210024840A CN 102611836 A CN102611836 A CN 102611836A
- Authority
- CN
- China
- Prior art keywords
- image
- function
- dalsa
- speed camera
- speed
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Image Processing (AREA)
- Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)
Abstract
The invention relates to a high-speed image collecting method based on Labview, wherein a high-speed camera, an image collecting card and an industrial personal computer are comprised, the high-speed camera and the image collecting card are connected through a specialized image collecting cable, the image collecting card is arranged on the industrial personal computer, an DLL (dynamic link library ) is written for LabVIEW to call by adopting a Sapera++LT function developing package provided by an DALSA, so that the image collecting and real-time control of the high-speed image FA-21-1M120-00-R are achieved. The image collecting by the high-speed camera and the arrangement to parameters of the high-speed camera are achieved through a LabVIEW high-speed image collecting drive program, and the high-speed image collecting method has the advantages of high speed, real time and stability.
Description
Technical field
The present invention relates to a kind of acquisition technology, particularly a kind of high-speed image sampling method based on Labview.
Background technology
In the industrial detection field, electric detective technology has progressively replaced traditional manual detection method, and wherein the image processing techniques development is particularly swift and violent.High speed property, reliability and repeatable the combining with image processing techniques of computer are carried out vision-based detection, have characteristics such as automation, noncontact, high accuracy and high speed, can greatly improve detection efficiency.Improve constantly along with what industrial detection required, the hardware device of image processing techniques also upgrades in upgrading constantly.Image pick-up card adopts the PCI-E high speed bus interface, compared to pci bus interface, and the speed that can significantly promote the image transmission and gather.Resolution and the frame speed of industry camera also thereupon development be greatly improved, performance index are also stable more, reliable.
LabVIEW is a graphical programming software that is provided by American National instrument (National Instruments); Its combined with virtual technical device can fast development and testing program; Possess favorable industrial checkout equipment interface and contain powerful function modules such as vision, motion control, embedded development, bus communication, be widely used in the industrial measurement and control field.
The high-speed camera head that DALSA company produces the FA-21-1M120-00-R model reaches the resolution of 1024*1024; The high-speed image sampling frame speed of per second 120 frames; In vision-based detection, has good performance; And C++, dotNet function kit are provided, are beneficial to according to detecting and require to carry out secondary development.But do not have to be directed against specially the driven by program interface of LabVIEW, can not directly be used, so need the user to develop compatible with it driver by LabVIEW.
Summary of the invention
The present invention be directed to the problem that present high-speed image sampling driven application technology does not catch up with; A kind of high-speed image sampling method based on Labview has been proposed; The Sapera++ LT function kit that adopts DALSA company to provide; Write the DLL dynamic link library and call, accomplish the IMAQ of high-speed camera head FA-21-1M120-00-R and control in real time by LabVIEW.
Technical scheme of the present invention is: a kind of high-speed image sampling method based on Labview; It is characterized in that; Comprise high-speed camera head, image pick-up card and industrial computer; The high-speed camera head is through special-purpose IMAQ cable and IMAQ card connection, and IMAQ is installed on the industrial computer, and the industrial computer collection comprises following concrete steps:
1) creates structure array allimaq [BUFSIZE]; Be used to deposit image address comprising * pBuffer pointer, i_full Boolean type variable is used to judge whether the access graph picture, and wherein macrodefinition BUFSIZE is for depositing the amount of memory of image; Initialization integer variable ai; Aj=0, wherein ai is the image access sequence number of call back function, aj is that image deposits the internal memory sequence number in;
2) configuration Information Monitoring: comprise the connection image pick-up card, the high-speed camera head of selection and IMAQ card connection calls outside each acquisition parameter of ccf file configuration high-speed camera head;
3) create the image buffer storage space, judge whether to begin images acquired;
4) the beginning images acquired judges whether the state of allimaq [aj] .i_full is true, if, new two field picture finishing collecting is described, can transmit operation; The output of the view data among allimaq [aj] .pBuff, making allimaq [aj] .i_full is false, and aj++ simultaneously; Otherwise, explain that new image does not also collect;
5) when stopping to take, discharge configuration image capture card, high-speed camera head and the memory headroom of the image array created;
When 6) taking a two field picture, program can change in the call back function automatically, carries out the storage operation of image, comprises the steps: at every turn
A: the image that collects is put into image buffer storage;
B: institute's image stored in the image buffer storage is passed among allimaq [ai] .pBuff;
C: remove and the release image buffer storage;
D:ai++;
7) after step 6) finishes; Translate and generate the DLL dynamic link library; Comprise initialization function (DALSA_Init), begin to take function (DALSA_Start), images acquired function (DALSA_Snap), stop to take function (DALSA_Stop); The Call Library Function Node of use LabVIEW calls the function of above-mentioned DLL dynamic link library, accomplishes IMAQ and control to the high-speed camera head, and concrete steps comprise as follows:
I) call the DALSA_Init function, initialization high-speed camera head, image pick-up card are created one dimension image array, and array length is 1048576, creates image buffer storage;
II) calls the DALSA_Start function, begin to get into shooting state;
III) calls DALSA_Snap images acquired function; Convert the one dimension image array of output into the two dimensional image array; Two dimensional image array size after the conversion is 1024*1024, and the IMAQ ArrayToImage.vi of the Vision module through LabVIEW shows the two dimensional image array with image format;
IV) call the DALSA_Stop function, stop to take, cleaning discharges shared memory headroom.
Beneficial effect of the present invention is: the high-speed image sampling method that the present invention is based on Labview; Accomplished the high-speed camera head to the collection of image and to the setting of each parameter of high-speed camera head through this high-speed image sampling of LabVIEW driver, had at a high speed, real-time, stable advantage.
Description of drawings
Fig. 1 is the hardware block diagram that the present invention is based on the high-speed image sampling method high speed IMAQ driver of Labview;
Fig. 2 is the software flow pattern that the present invention is based on DLL dynamic link library in the high-speed image sampling method of Labview;
Fig. 3 the present invention is based in the high-speed image sampling method of Labview the software flow pattern of call back function in the DLL dynamic link library;
Fig. 4 the present invention is based on the software flow pattern that LabVIEW in the high-speed image sampling method of Labview calls the DLL Dynamic Link Library Function.
Embodiment
The present invention utilizes high-speed camera head, image pick-up card that DALSA company provides and the C++ function kit Sapera++ LT that provides, and compiling generates the DLL dynamic link library, and LabVIEW calls through the upper strata, realizes the collection and the control of high-speed camera head.
Hardware block diagram as shown in Figure 1, it comprises high-speed camera head, image pick-up card and industrial computer, said high-speed camera head model is FA-21-1M120-00-R, connects said image pick-up card.Described image pick-up card model is x64-Xcelera-CL LX1, and compatible with described high-speed camera head, through the IMAQ cable connection of special use.Described industrial computer is equipped with described image pick-up card, accomplishes program control.
The software flow pattern of DLL dynamic link library as shown in Figure 2, concrete operating procedure is following:
1) creates structure array allimaq [BUFSIZE]; Be used to deposit image address comprising * pBuffer pointer, i_full Boolean type variable is used to judge whether the access graph picture, and wherein macrodefinition BUFSIZE is for depositing the amount of memory of image; Initialization integer variable ai; Aj=0, wherein ai is the image access sequence number of call back function, aj is that image deposits the internal memory sequence number in;
2) configuration Information Monitoring: comprise the connection image pick-up card, the high-speed camera head of selection and IMAQ card connection calls outside each acquisition parameter of ccf file configuration high-speed camera head;
3) create the image buffer storage space, judge whether to begin images acquired;
4) the beginning images acquired judges whether the state of allimaq [aj] .i_full is true, if, new two field picture finishing collecting is described, can transmit operation; The output of the view data among allimaq [aj] .pBuff, making allimaq [aj] .i_full is false, and aj++ simultaneously; Otherwise, explain that new image does not also collect;
5) when stopping to take, discharge configuration image capture card, high-speed camera head and the memory headroom of the image array created.
Wherein mainly comprise: initialization function (DALSA_Init), begin to take function (DALSA_Start), images acquired function (DALSA_Snap), stop to take function (DALSA_Stop).Core code is following:
Void Dalsa_Init (char* path_name) // initialization function
{……
For (i=0; I < FRAMESIZE; I++) />/ initialization structure array
{
allimaq[i].pBuffer=?new?BYTE[1024*1024];
allimaq[i].i_full=false;
}
……
Acq->Create (); // distribution image capture device underlying resource
Buffers->Create (); // establishment IMAQ spatial cache
Xfer->Create (); // establishment image transmission channel
……}
Void Dalsa_Start (void) // begin to take function
{
Xfer->Grab (); // images acquired
}
Void Dalsa_Snap (BYTE* disimage) // images acquired function
{……
for?(i=0;i<1024;i++)
for(j=0;j<1024;j++)
{
Disimage [i*1024+j]=allimaq [aj] .pBuffer [i*1024+j] // images acquired
}
……}
Void Dalsa_Stop (void) // stop to take function
{……
Xfer->Destroy (); // release transmission channel
Buffers->Destroy (); // release graphics is as spatial cache
Acq->Destroy (); // release image capture device memory headroom
Delete [] arrbuf; // remove release graphics as array
For (i=0; I < BUFSIZE; I++) />/ removing releasing structure body array
{
delete[]?allimaq[i].pBuffer;
}
……}
The software flow pattern of call back function as shown in Figure 3, concrete operating procedure is following:
1) image that collects is put into image buffer storage;
2) institute's image stored in the image buffer storage is passed among allimaq [ai] .pBuff;
3) remove the release image buffer storage;
4)ai++。
Main core code is following:
Static void myCallback (SapXferCallbackInfo * pInfo) // call back function
{……
Buffers->GetAddress (ai, 0,1024*1024, (void**) &imaqbuf); // image is put into buffer memory
Memcpy (allimaq [ai] .pBuff, imaqbuf, 1024*1024); // image in the buffer memory is derived
Buffers->ReleaseAddress ((void*) imaqbuf); // release buffer memory
allimaq[ai].i_full=true;
ai++;
if(ai==BUFSIZE)?{ai=0;}
……}
LabVIEW as shown in Figure 4 calls the software code of DLL Dynamic Link Library Function, and concrete operating procedure is following:
1) call the DALSA_Init function, initialization high-speed camera head, image pick-up card are created one dimension image array, and array length is 1048576, and creates image buffer storage;
2) call the DALSA_Start function, begin to get into shooting state;
3) call DALSA_Snap images acquired function; Convert the one dimension image array of output into the two dimensional image array; Two dimensional image array size after the conversion is 1024*1024, and the IMAQ ArrayToImage.vi of the Vision module through LabVIEW shows the two dimensional image array with image format;
4) call the DALSA_Stop function, stop to take, cleaning discharges all shared memory headrooms.
Claims (1)
1. high-speed image sampling method based on Labview; It is characterized in that; Comprise high-speed camera head, image pick-up card and industrial computer; The high-speed camera head is through special-purpose IMAQ cable and IMAQ card connection, and IMAQ is installed on the industrial computer, and the industrial computer collection comprises following concrete steps:
1) creates structure array allimaq [BUFSIZE]; Be used to deposit image address comprising * pBuffer pointer, i_full Boolean type variable is used to judge whether the access graph picture, and wherein macrodefinition BUFSIZE is for depositing the amount of memory of image; Initialization integer variable ai; Aj=0, wherein ai is the image access sequence number of call back function, aj is that image deposits the internal memory sequence number in;
2) configuration Information Monitoring: comprise the connection image pick-up card, the high-speed camera head of selection and IMAQ card connection calls outside each acquisition parameter of ccf file configuration high-speed camera head;
3) create the image buffer storage space, judge whether to begin images acquired;
4) the beginning images acquired judges whether the state of allimaq [aj] .i_full is true, if, new two field picture finishing collecting is described, can transmit operation; The output of the view data among allimaq [aj] .pBuff, making allimaq [aj] .i_full is false, and aj++ simultaneously; Otherwise, explain that new image does not also collect;
5) when stopping to take, discharge configuration image capture card, high-speed camera head and the memory headroom of the image array created;
When 6) taking a two field picture, program can change in the call back function automatically, carries out the storage operation of image, comprises the steps: at every turn
A: the image that collects is put into image buffer storage;
B: institute's image stored in the image buffer storage is passed among allimaq [ai] .pBuff;
C: remove and the release image buffer storage;
D:ai++;
7) after step 6) finishes; Translate and generate the DLL dynamic link library; Comprise initialization function (DALSA_Init), begin to take function (DALSA_Start), images acquired function (DALSA_Snap), stop to take function (DALSA_Stop); The Call Library Function Node of use LabVIEW calls the function of above-mentioned DLL dynamic link library, accomplishes IMAQ and control to the high-speed camera head, and concrete steps comprise as follows:
I) call the DALSA_Init function, initialization high-speed camera head, image pick-up card are created one dimension image array, and array length is 1048576, creates image buffer storage;
II) calls the DALSA_Start function, begin to get into shooting state;
III) calls DALSA_Snap images acquired function; Convert the one dimension image array of output into the two dimensional image array; Two dimensional image array size after the conversion is 1024*1024, and the IMAQ ArrayToImage.vi of the Vision module through LabVIEW shows the two dimensional image array with image format;
IV) call the DALSA_Stop function, stop to take, cleaning discharges shared memory headroom.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210024840.2A CN102611836B (en) | 2012-02-06 | 2012-02-06 | High-speed image collecting method based on Labview |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201210024840.2A CN102611836B (en) | 2012-02-06 | 2012-02-06 | High-speed image collecting method based on Labview |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102611836A true CN102611836A (en) | 2012-07-25 |
CN102611836B CN102611836B (en) | 2014-04-16 |
Family
ID=46528978
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201210024840.2A Expired - Fee Related CN102611836B (en) | 2012-02-06 | 2012-02-06 | High-speed image collecting method based on Labview |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102611836B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104065884A (en) * | 2014-06-25 | 2014-09-24 | 珠海全志科技股份有限公司 | Picture taking method and device thereof |
CN105100733A (en) * | 2015-08-27 | 2015-11-25 | 广东威创视讯科技股份有限公司 | Video playing method and system of mosaic display device |
CN105657271A (en) * | 2016-01-29 | 2016-06-08 | 南京理工大学 | LabVIEW-based EMCCD camera data acquisition driving method |
CN108694194A (en) * | 2017-04-10 | 2018-10-23 | 北京京东尚科信息技术有限公司 | A kind of method and apparatus of construction data object |
CN109271207A (en) * | 2018-09-21 | 2019-01-25 | 武汉烽理光电技术有限公司 | The method of the high-speed collection card driving of USB3.0 is called based on MATLAB |
CN111078420A (en) * | 2019-10-14 | 2020-04-28 | 惠州市德赛西威汽车电子股份有限公司 | LabVIEW-based method for calling structure function in dynamic link library |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101011243A (en) * | 2007-01-30 | 2007-08-08 | 华南师范大学 | Foreign body detecting method using thermoacoustic imaging and device thereof |
-
2012
- 2012-02-06 CN CN201210024840.2A patent/CN102611836B/en not_active Expired - Fee Related
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101011243A (en) * | 2007-01-30 | 2007-08-08 | 华南师范大学 | Foreign body detecting method using thermoacoustic imaging and device thereof |
Non-Patent Citations (2)
Title |
---|
张亿雄 等: "基于调用DLL的LabVIEW数据采集的实现", 《微计算机信息》, vol. 24, no. 121, 31 December 2008 (2008-12-31) * |
祁传琦 等: "在LabVIEW中实现基于DLL的图象采集系统开发", 《成都航空职业技术学院学报》, vol. 21, no. 2, 30 June 2005 (2005-06-30), pages 41 - 42 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104065884A (en) * | 2014-06-25 | 2014-09-24 | 珠海全志科技股份有限公司 | Picture taking method and device thereof |
CN104065884B (en) * | 2014-06-25 | 2017-09-15 | 珠海全志科技股份有限公司 | Photographic method and its device |
CN105100733A (en) * | 2015-08-27 | 2015-11-25 | 广东威创视讯科技股份有限公司 | Video playing method and system of mosaic display device |
CN105657271A (en) * | 2016-01-29 | 2016-06-08 | 南京理工大学 | LabVIEW-based EMCCD camera data acquisition driving method |
CN108694194A (en) * | 2017-04-10 | 2018-10-23 | 北京京东尚科信息技术有限公司 | A kind of method and apparatus of construction data object |
CN109271207A (en) * | 2018-09-21 | 2019-01-25 | 武汉烽理光电技术有限公司 | The method of the high-speed collection card driving of USB3.0 is called based on MATLAB |
CN111078420A (en) * | 2019-10-14 | 2020-04-28 | 惠州市德赛西威汽车电子股份有限公司 | LabVIEW-based method for calling structure function in dynamic link library |
Also Published As
Publication number | Publication date |
---|---|
CN102611836B (en) | 2014-04-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102611836B (en) | High-speed image collecting method based on Labview | |
US9639447B2 (en) | Trace data export to remote memory using remotely generated reads | |
US9684583B2 (en) | Trace data export to remote memory using memory mapped write transactions | |
CN107066390A (en) | A kind of Dram leakage detection method and system | |
CN102903074A (en) | Image processing apparatus based on field-programmable gate array (FPGA) | |
WO2008018035A2 (en) | Methods and products for determining and visualizin ic behaviour | |
CN104361143B (en) | A kind of portable data acquisition card and its method | |
CN111830039B (en) | Intelligent product quality detection method and device | |
CN108681510A (en) | Data processing method and device | |
CN100385787C (en) | DSP Chip-based excitation controller communication system and its method for realizing USB protocol | |
CN101697225A (en) | Image fusion system and method based on ARM and DSP heterogeneous dual-core processor | |
US9396145B1 (en) | In-chip bus tracer | |
CN104408213A (en) | Portable data acquisition card | |
CN114356846A (en) | Image data sending method and device, electronic equipment and storage medium | |
CN104317747A (en) | Data caching and sending device and method of network receiver | |
CN110188023A (en) | Resource health inspection method and resource health check device | |
KR101735590B1 (en) | Transaction extracting apparatus and method thereof | |
CN101998135A (en) | System for collecting and playing mobile television signal and control method | |
CN209231437U (en) | A kind of sliding detection device of urban track traffic heat | |
CN115618800A (en) | GPU joint simulation system based on DPI | |
CN101566896B (en) | Method for realizing synchronous work of infrared scanning and camera and system thereof | |
CN1900731B (en) | Logic module detecting system and method | |
CN201497677U (en) | Data acquisition card for impact test of instrumented pendulum | |
CN102541772B (en) | Signal acquisition device of memory bus | |
CN207601594U (en) | A kind of intelligent multi-channel integrated data Acquisition Instrument |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20140416 Termination date: 20170206 |
|
CF01 | Termination of patent right due to non-payment of annual fee |