CN102611836B - High-speed image collecting method based on Labview - Google Patents

High-speed image collecting method based on Labview Download PDF

Info

Publication number
CN102611836B
CN102611836B CN201210024840.2A CN201210024840A CN102611836B CN 102611836 B CN102611836 B CN 102611836B CN 201210024840 A CN201210024840 A CN 201210024840A CN 102611836 B CN102611836 B CN 102611836B
Authority
CN
China
Prior art keywords
image
function
dalsa
speed
labview
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.)
Expired - Fee Related
Application number
CN201210024840.2A
Other languages
Chinese (zh)
Other versions
CN102611836A (en
Inventor
邬敏杰
穆平安
戴曙光
金晅宏
张彩艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Shanghai for Science and Technology
Original Assignee
University of Shanghai for Science and Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by University of Shanghai for Science and Technology filed Critical University of Shanghai for Science and Technology
Priority to CN201210024840.2A priority Critical patent/CN102611836B/en
Publication of CN102611836A publication Critical patent/CN102611836A/en
Application granted granted Critical
Publication of CN102611836B publication Critical patent/CN102611836B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

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

A kind of high-speed image sampling method based on Labview
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 industrial detection field, electric detective technology has progressively replaced Traditional Man detection method, and wherein image processing techniques development is particularly swift and violent.The high speed of computer, reliability and repeatability are combined and carry out vision-based detection with image processing techniques, there is the features such as automation, noncontact, high accuracy and high speed, can greatly improve detection efficiency.Along with improving constantly that industrial detection requires, the hardware device of image processing techniques also upgrades in constantly upgrading.Image pick-up card adopts PCI-E high speed bus interface, compared to pci bus interface, can significantly promote the speed of image transmitting and collection.Resolution and the frame speed of industry camera also develop and are greatly improved thereupon, and performance index are also more stable, reliable.
LabVIEW is a graphical programming software being provided by American National instrument (National Instruments), its combined with virtual technical device can fast Development test program, possess good industrial detection equipment interface and contain the powerful functional modules such as vision, motion control, embedded development, bus communication, being widely used in industrial measurement and control field.
The high-speed camera head that DALSA company produces FA-21-1M120-00-R model reaches the resolution of 1024*1024, the high-speed image sampling frame speed of 120 frames per second, in vision-based detection, there is good performance, and C++, dotNet function kit are provided, are beneficial to according to testing requirement and carry out secondary development.But there is no the special driven by program interface for LabVIEW, can not directly be applied by LabVIEW, so need the User Exploitation driver of compatibility with it.
Summary of the invention
The present invention be directed to the problem that present high-speed image sampling drives application technology 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 DLL dynamic link library and called by LabVIEW, complete the IMAQ of high-speed camera head FA-21-1M120-00-R and control in real time.
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, high-speed camera head is connected with image pick-up card by special-purpose IMAQ cable, IMAQ is installed on industrial computer, and industrial computer collection comprises following concrete steps:
1) create structure array allimaq[BUFSIZE], comprising * pBuffer pointer, be used for depositing image address, i_full Boolean type variable is used for judging whether access graph picture, wherein macrodefinition BUFSIZE is for depositing the amount of memory of image, initialization integer variable ai, aj=0, the image access sequence number that wherein ai is call back function, aj is that image deposits internal memory sequence number in;
2) configuration Information Monitoring: comprise connection image pick-up card, the high-speed camera head that selection is connected with image pick-up card, calls outside each acquisition parameter of ccf file configuration high-speed camera head;
3) create image buffer storage space, judge whether to start to gather image;
4) start to gather image, judge allimaq[aj] whether the state of .i_full be true, if so, illustrates that a new two field picture has gathered complete, can transmit operation; Simultaneously allimaq[aj] view data in .pBuff exports, and makes allimaq[aj] .i_full is false, and aj++; Otherwise, illustrate that new image does not also collect;
5), when stopping taking, discharge configuration image capture card, high-speed camera head and the memory headroom of the image array that creates;
6), while taking a two field picture, program can proceed in call back function automatically, carries out the storage operation of image, comprises the steps: at every turn
A: the image collecting is put into image buffer storage;
B: the image of storing in image buffer storage, is passed to allimaq[ai] in .pBuff;
C: remove and release image buffer storage;
D:ai++;
7) after step 6) finishes, translate and generate DLL dynamic link library, comprise initialization function (DALSA_Init), start to take function (DALSA_Start), gather image function (DALSA_Snap), stop taking function (DALSA_Stop), the Call Library Function Node of use LabVIEW calls the function of above-mentioned DLL dynamic link library, complete the IMAQ of high-speed camera head and control, concrete steps comprise as follows:
I) call DALSA_Init function, initialization high-speed camera head, image pick-up card, create one dimension image array, and array length is 1048576, creates image buffer storage;
II) call DALSA_Start function, start to enter shooting state;
III) call DALSA_Snap and gather image function, the one dimension image array of output is converted to two dimensional image array, two dimensional image array size after changing is 1024*1024, and the IMAQ ArrayToImage.vi of the Vision module by LabVIEW shows two dimensional image array with image format;
IV) call DALSA_Stop function, stop taking, 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, by this high-speed image sampling of LabVIEW driver, complete high-speed camera head to the collection of image and the setting to each parameter of high-speed camera head, there is high speed, real-time, stable.
Accompanying drawing explanation
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 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 DLL Dynamic Link Library Function.
Embodiment
High-speed camera head, the image pick-up card that DALSA company provides and the C++ function kit Sapera++ LT providing are provided in the present invention, and compiling generates DLL dynamic link library, and by upper strata, LabVIEW calls, and realizes 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, described high-speed camera head model is FA-21-1M120-00-R, connects described image pick-up card.Described image pick-up card model is x64-Xcelera-CL LX1, and compatible with described high-speed camera head, by special-purpose IMAQ cable, connects.Described industrial computer is provided with described image pick-up card, completes program control.
The software flow pattern of DLL dynamic link library as shown in Figure 2, concrete operating procedure is as follows:
1) create structure array allimaq[BUFSIZE], comprising * pBuffer pointer, be used for depositing image address, i_full Boolean type variable is used for judging whether access graph picture, wherein macrodefinition BUFSIZE is for depositing the amount of memory of image, initialization integer variable ai, aj=0, the image access sequence number that wherein ai is call back function, aj is that image deposits internal memory sequence number in;
2) configuration Information Monitoring: comprise connection image pick-up card, the high-speed camera head that selection is connected with image pick-up card, calls outside each acquisition parameter of ccf file configuration high-speed camera head;
3) create image buffer storage space, judge whether to start to gather image;
4) start to gather image, judge allimaq[aj] whether the state of .i_full be true, if so, illustrates that a new two field picture has gathered complete, can transmit operation; Simultaneously allimaq[aj] view data in .pBuff exports, and makes allimaq[aj] .i_full is false, and aj++; Otherwise, illustrate that new image does not also collect;
5), when stopping taking, discharge configuration image capture card, high-speed camera head and the memory headroom of the image array that creates.
Wherein mainly comprise: initialization function (DALSA_Init), start to take function (DALSA_Start), gather image function (DALSA_Snap), stop taking function (DALSA_Stop).Core code is as follows:
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 transmitting passage
……}
Void Dalsa_Start (void) // start to take function
{
Xfer->Grab (); // collection image
}
Void Dalsa_Snap (BYTE* disimage) // collection image function
{……
for?(i=0;i<1024;i++)
for(j=0;j<1024;j++)
{
Disimage[i*1024+j]=allimaq[aj] .pBuffer[i*1024+j] // collection image
}
……}
Void Dalsa_Stop (void) // stop taking 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 as follows:
1) image collecting is put into image buffer storage;
2) image of storing in image buffer storage, is passed to allimaq[ai] in .pBuff;
3) remove and discharge image buffer storage;
4)ai++。
Main core code is as follows:
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 buffer memory is derived
Buffers->ReleaseAddress ((void*) imaqbuf); // release buffer memory
allimaq[ai].i_full=true;
ai++;
if(ai==BUFSIZE)?{ai=0;}
……}
LabVIEW calls the software code of DLL Dynamic Link Library Function as shown in Figure 4, and concrete operating procedure is as follows:
1) call DALSA_Init function, initialization high-speed camera head, image pick-up card, create one dimension image array, and array length is 1048576, and creates image buffer storage;
2) call DALSA_Start function, start to enter shooting state;
3) call DALSA_Snap and gather image function, the one dimension image array of output is converted to two dimensional image array, two dimensional image array size after changing is 1024*1024, and the IMAQ ArrayToImage.vi of the Vision module by LabVIEW shows two dimensional image array with image format;
4) call DALSA_Stop function, stop taking, cleaning discharges shared all memory headrooms.

Claims (1)

1. the high-speed image sampling method based on Labview, is characterized in that, high-speed camera head is connected with image pick-up card by special-purpose IMAQ cable, and IMAQ is installed on industrial computer, and industrial computer collection comprises following concrete steps:
1) create structure array allimaq[BUFSIZE], comprising * pBuffer pointer, be used for depositing image address, i_full Boolean type variable is used for judging whether access graph picture, wherein macrodefinition BUFSIZE is for depositing the amount of memory of image, initialization integer variable ai, aj=0, the image access sequence number that wherein ai is call back function, aj is that image deposits internal memory sequence number in;
2) configuration Information Monitoring: comprise connection image pick-up card, the high-speed camera head that selection is connected with image pick-up card, calls outside each acquisition parameter of ccf file configuration high-speed camera head;
3) create image buffer storage space, judge whether to start to gather image;
4) start to gather image, judge allimaq[aj] whether the state of .i_full be true, if, illustrate that a new two field picture has gathered complete, can transmit operation, simultaneously allimaq[aj] view data in .pBuffer exports, and makes allimaq[aj] .i_full is false, and aj++; Otherwise, illustrate that new image does not also collect;
5), when stopping taking, discharge configuration image capture card, high-speed camera head and the memory headroom of the image array that creates;
6), while taking a two field picture, program can proceed in call back function automatically, carries out the storage operation of image, comprises the steps: at every turn
A: the image collecting is put into image buffer storage;
B: the image of storing in image buffer storage, is passed to allimaq[ai] in .pBuffer;
C: remove and release image buffer storage;
D:ai++;
7) after step 6) finishes, compiling generates DLL dynamic link library, comprise initialization function (DALSA_Init), start to take function (DALSA_Start), gather image function (DALSA_Snap), stop taking function (DALSA_Stop), the Call Library Function Node of use LabVIEW calls the function of above-mentioned DLL dynamic link library, complete the IMAQ of high-speed camera head and control, concrete steps comprise as follows:
I) call DALSA_Init function, initialization high-speed camera head, image pick-up card, create one dimension image array, and array length is 1048576, creates image buffer storage;
II) call DALSA_Start function, start to enter shooting state;
III) call DALSA_Snap and gather image function, the one dimension image array of output is converted to two dimensional image array, two dimensional image array size after changing is 1024*1024, and the IMAQ ArrayToImage.vi of the Vision module by LabVIEW shows two dimensional image array with image format;
IV) call DALSA_Stop function, stop taking, cleaning discharges shared memory headroom.
CN201210024840.2A 2012-02-06 2012-02-06 High-speed image collecting method based on Labview Expired - Fee Related CN102611836B (en)

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 CN102611836A (en) 2012-07-25
CN102611836B true 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)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN105657271B (en) * 2016-01-29 2018-07-06 南京理工大学 A kind of EMCCD camera datas acquisition driving method based on LabVIEW
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
CN111078420B (en) * 2019-10-14 2023-06-27 惠州市德赛西威汽车电子股份有限公司 Method for calling structure body function in dynamic link library based on LabVIEW

Citations (1)

* Cited by examiner, † Cited by third party
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

Patent Citations (1)

* Cited by examiner, † Cited by third party
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 (4)

* Cited by examiner, † Cited by third party
Title
在LabVIEW中实现基于DLL的图象采集系统开发;祁传琦 等;《成都航空职业技术学院学报》;20050630;第21卷(第2期);41-42 *
基于调用DLL的LabVIEW数据采集的实现;张亿雄 等;《微计算机信息》;20081231;第24卷(第12-1期);78-79,250 *
张亿雄 等.基于调用DLL的LabVIEW数据采集的实现.《微计算机信息》.2008,第24卷(第12-1期),78,79,250.
祁传琦 等.在LabVIEW中实现基于DLL的图象采集系统开发.《成都航空职业技术学院学报》.2005,第21卷(第2期),41,42.

Also Published As

Publication number Publication date
CN102611836A (en) 2012-07-25

Similar Documents

Publication Publication Date Title
CN102611836B (en) High-speed image collecting method based on Labview
EP3213217B1 (en) Historical control flow visualization in production diagnostics
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
US20220252665A1 (en) On-chip Debugging Device and Method
CN106951587A (en) FPGA debugging systems and method
US8996928B2 (en) Devices for indicating a physical layer error
CN101354675B (en) Method for detecting embedded software dynamic memory
EP2052324A2 (en) Methods and products for determining and visualizin ic behaviour
CN107066390A (en) A kind of Dram leakage detection method and system
CN115496034B (en) Multi-mode GPU joint simulation system
CN100409200C (en) Method for implementing real-time monitoring performance information of embedded operating system
CN115688676B (en) TLM-based GPU joint simulation system
CN115686655A (en) Joint simulation system for GPU IP verification
CN108681510A (en) Data processing method and device
CN100385787C (en) DSP Chip-based excitation controller communication system and its method for realizing USB protocol
CN115719047A (en) Joint simulation system based on waveform GPU
CN101751327A (en) Method for tracing embedded processor debugging
CN104361143A (en) Portable data acquisition card and method thereof
CN102879732B (en) Method and system for testing board card
CN104408213A (en) Portable data acquisition card
US9396145B1 (en) In-chip bus tracer
KR101735590B1 (en) Transaction extracting apparatus and method thereof
CN101998135A (en) System for collecting and playing mobile television signal and control method
CN108228314B (en) Virtual prototype error detection method based on equipment protocol

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140416

Termination date: 20170206