National Instruments Image Acquisition Software User Manual

Image acquisition software
Table of Contents

Advertisement

Quick Links

IMAQ
NI-IMAQ

User Manual

Image Acquisition Software
NI-IMAQ User Manual
June 1998 Edition
Part Number 371443A-01

Advertisement

Table of Contents
loading

Summary of Contents for National Instruments Image Acquisition Software

  • Page 1: User Manual

    IMAQ ™ ™ NI-IMAQ User Manual Image Acquisition Software NI-IMAQ User Manual June 1998 Edition Part Number 371443A-01...
  • Page 2 Singapore 2265886, Spain 91 640 0085, Sweden 08 730 49 70, Switzerland 056 200 51 51, Taiwan 02 377 1200, United Kingdom 01635 523545 National Instruments Corporate Headquarters 6504 Bridge Point Parkway Austin, Texas 78730-5039 USA Tel: 512 794 0100 © Copyright 1996, 1998 National Instruments Corporation. All rights reserved.
  • Page 3: Important Information

    90 days from date of shipment, as evidenced by receipts or other documentation. National Instruments will, at its option, repair or replace software media that do not execute programming instructions if National Instruments receives notice of such defects during the warranty period.
  • Page 4: Table Of Contents

    Contents About This Manual How to Use the NI-IMAQ Manual Set ...ix Organization of This Manual ...ix Conventions Used in This Manual...x National Instruments Documentation ...xi Related Documentation...xi Customer Communication ...xi Chapter 1 Introduction to NI-IMAQ About the NI-IMAQ Software ...1-1 Application Development Environments ...1-2...
  • Page 5 Performing a Grab Using Low-Level Functions... 3-15 Performing a Sequence Acquisition Using Low-Level Functions... 3-15 Performing a Ring Acquisition Using Low-Level Functions ... 3-16 StillColor Snap Programming... 3-16 Appendix A StillColor Appendix B Customer Communication Glossary Index NI-IMAQ User Manual © National Instruments Corporation...
  • Page 6 Composite StillColor Snap Programming Flowchart...3-17 Figure A-1. Classical Decoding ...A-4 Figure A-2. StillColor Decoding...A-4 Figure A-3. White Light and the Visible Spectrum ...A-7 Tables Table 1-1. Import Libraries...1-3 Table 3-1. Interface Naming Convention ...3-2 © National Instruments Corporation Contents NI-IMAQ User Manual...
  • Page 7: About This Manual

    About This Manual NI-IMAQ software is a powerful application programming interface (API) between your image acquisition application and the National Instruments image acquisition (IMAQ) devices. This manual explains how to use your NI-IMAQ software. How to Use the NI-IMAQ Manual Set...
  • Page 8: Conventions Used In This Manual

    NI-IMAQ User Manual Appendix B, Customer Communication, contains forms you can use to request help from National Instruments or to comment on our products and manuals. Glossary contains an alphabetical list and description of terms used in this manual, including abbreviations, acronyms, metric prefixes, mnemonics, and symbols.
  • Page 9: National Instruments Documentation

    • Customer Communication National Instruments wants to receive your comments on our products and manuals. We are interested in the applications you develop with our products, and we want to help if you have problems with them. To make it easy for you to contact us, this manual contains comment and configuration forms for you to complete.
  • Page 10: Introduction To Ni-Imaq

    NI-IMAQ uses direct memory access (DMA) to transfer all data. NI-IMAQ is a library of routines that work with National Instruments IMAQ devices. NI-IMAQ contains methods for overcoming difficulties ranging from simple device initialization to advanced high-speed real-time image acquisition.
  • Page 11: Application Development Environments

    LabVIEW version 4.x and higher LabWindows/CVI version 4.x and higher BridgeVIEW version 1.x and higher Borland C/C++ version 4.0 and higher Microsoft Visual C/C++ version 2.0 and higher Microsoft Visual Basic version 4.0 and higher readme.txt © National Instruments Corporation...
  • Page 12: Creating An Application

    When programming, use the following guidelines: • • • • © National Instruments Corporation You must define the constant _NIWIN prior to including any NI-IMAQ header files. You can define this constant in your source files by using the #define directive can add the definition to your project file’s preprocessor definitions if...
  • Page 13: Sample Programs

    NI-IMAQ sample programs. These programs are installed in the installation folder if you elected to install the sample files. NI-IMAQ User Manual file located in your target installation readme.txt subdirectory under the target sample © National Instruments Corporation...
  • Page 14: Software Overview

    The generic and high-level functions appear within each function class in the logical order you might need to use them. The low-level functions appear within each function class in alphabetical order. © National Instruments Corporation Generic functions High-level functions –...
  • Page 15: Generic Functions

    Performs a single frame and field acquisition. Performs an area-specific frame or field acquisition. Configures and optionally starts a continuous acquisition. Performs a transfer from a continuous acquisition session. Call this function only after calling imgGrabSetup © National Instruments Corporation...
  • Page 16: Ring And Sequence Functions

    Signal I/O functions control the trigger lines on IMAQ devices. imgSessionTriggerConfigure imgSessionLineTrigSource imgSessionTriggerClear imgSessionTriggerDrive imgSessionTriggerRead imgSessionWaitSignal © National Instruments Corporation Chapter 2 Performs a transfer from a continuous acquisition. Call this function only after calling imgGrabSetup Prepares a session for acquiring continuously and looping into a buffer list.
  • Page 17: Miscellaneous Functions

    Stops the generation of a pulse. Gets the current session status. Sets acquisition origin and dimension. Gets acquisition origin and dimension. Gets the minimum buffer size needed for frame buffer allocation. © National Instruments Corporation first to configure...
  • Page 18: Low-Level Functions

    © National Instruments Corporation Chapter 2 Locks all session-associated image buffers in memory in preparation for an acquisition. Unlocks all session-associated buffers. Stops an asynchronous acquisition or synchronous continuous acquisition immediately.
  • Page 19: Attribute Functions

    Creates a user frame buffer based on the geometric definitions of the associated session. Creates a buffer list that is passed to imgSessionConfigure Disposes of a user frame buffer. Purges all image buffers associated with this buffer list. © National Instruments Corporation...
  • Page 20: Interface Functions

    Use utility functions to display an image in a window, save an image to a file, or to get detailed error information. imgPlot imgSessionSaveBufferEx imgShowError © National Instruments Corporation Chapter 2 Gets an element of a specific type from a buffer list. Clears a session’s image data to the specified pixel value.
  • Page 21: Programming With Ni-Imaq

    The high-level function set also allows simple triggered acquisitions and the generation of external signals on the trigger lines. © National Instruments Corporation Snap acquires a single frame or field to a buffer. Grab performs an acquisition that loops continually on one buffer; you obtain a copy of the acquisition buffer by grabbing a copy to a separate buffer that can be used for analysis.
  • Page 22: Low-Level Functions

    Extract buffers out of a live acquisition for analysis Set up and control triggered acquisitions Interface Functions Session Functions Table 3-1. Interface Naming Convention Interface Name sections in this chapter Board Installed Board 0 Board 1 Board n © National Instruments Corporation...
  • Page 23: Session Functions

    SESSION_ID sessionID; if (imgInterfaceOpen(“img0”, &interfaceID) == IMG_ERR_GOOD) if (imgSessionOpen(interfaceID, &sessionID) == IMG_ERR_GOOD) … user code … imgClose(sessionID, FALSE); imgClose(interfaceID, FALSE); © National Instruments Corporation Chapter 3 function. imgInterfaceOpen . When the program is finished img0 imgSessionOpen Programming with NI-IMAQ...
  • Page 24: Managing Buffers

    ) are initiated with NULL ) or using the low-level malloc when applicable , which can <my camera>.txt directory. For more information © National Instruments Corporation...
  • Page 25: Ni-Imaq Status Signals

    Buffer Complete will go TRUE when the data in an image buffer has been transferred to memory (either onboard or system memory, depending on the acquisition). © National Instruments Corporation imgSetCameraAttributeString functions to set and get the value of...
  • Page 26: Introductory Programming Examples

    By Board By Board Buffer 1 Buffer 0 Data In Data In Memory Memory Figure 3-1. NI-IMAQ Status Signals ni-imaq\samples All Image Data In Memory Buffer 2 Data In Memory All Image Data In Memory directory. © National Instruments Corporation...
  • Page 27: High-Level Snap Functions

    ROI values are initialized from the acquisition window (ACQWINDOW) dimensions that are configured in the IMAQ Configuration Utility. The ACQWINDOW dimensions will vary depending on the type of camera you are using. © National Instruments Corporation imgSnap imgSnapArea imgInterfaceOpen and configures the interface according to the file setup by the IMAQ Configuration Utility.
  • Page 28: High-Level Grab Functions

    . You can use these functions to perform an acquisition that initializes a session for a grab acquisition. imgGrabSetup , each successive grab will copy the last acquired imgGrabSetup with the interface handle and sets imgGrabSetup imgGrab © National Instruments Corporation...
  • Page 29: Figure 3-3. Grab Programming Flowchart

    The program then frees the user buffer and all of the resources associated with this interface by calling © National Instruments Corporation imgInterfaceOpen and configures the interface according to the file setup by the IMAQ Configuration Utility.
  • Page 30: High-Level Sequence Functions

    With this information, you can determine which buffer you want to process. User-specific image processing. imgClose closes the interface and session. Figure 3-4. Sequence Programming Flowchart 3-10 © National Instruments Corporation , you can imgCreateBuffer (Loop)
  • Page 31: High-Level Ring Functions

    For certain applications, you can temporarily extract a buffer from the ring to prevent it from being overwritten during the ring’s next pass. Use the imgSessionExamineBuffer functions to do this. Figure 3-5 illustrates a typical ring programming order. © National Instruments Corporation example demonstrates how to perform a sequence HLSeq.c imgSequenceSetup initiates a ring.
  • Page 32: Figure 3-5. Ring Programming Flowchart

    . The example sets up a ring containing six buffers imgRingSetup 3-12 opens opens a session that sets up a ring acquisition to a or passing a NULL) starts gives the current status of (Loop) stops imgSessionStatus © National Instruments Corporation...
  • Page 33: High-Level Signal I/O Functions

    1 before acquiring a single image. It also configures the driver to assert RTSI trigger line 3 when the acquisition is finished. The trigsnap.c © National Instruments Corporation imgSessionTriggerConfigure to remove the trigger settings from the . This function takes a trigger line...
  • Page 34: Advanced Programming Examples

    Figure 3-6. Signal I/O Function Programming Flowchart example demonstrates how to perform a snap acquisition LLSnap.c 3-14 opens and configures the opens a session that onfigures the configures the session © National Instruments Corporation...
  • Page 35: Performing A Grab Using Low-Level Functions

    NULL as the size parameter to the buffer and configures the buffer list for each buffer element in the ring. The program locks the memory and starts the image acquisition asynchronously. © National Instruments Corporation example demonstrates how to perform a grab acquisition LLGrab.c imgSessionExamineBuffer example demonstrates how to perform a sequence LLSeq.c...
  • Page 36: Performing A Ring Acquisition Using Low-Level Functions

    . The buffer is created and the buffer list is configured as the IMG_ATTR_LAST_VALID_BUFFER attribute until to extract the desired buffer from the live imgSessionExamineBuffer imgSessionReleaseBuffer 3-16 , the buffer requested to return the buffer to the continuous © National Instruments Corporation...
  • Page 37: Figure 3-7. Composite Stillcolor Snap Programming Flowchart

    StillColor image and returns the image data in the buffer. After the example processes the image, it calls the resources associated with the interface. © National Instruments Corporation imgInterfaceOpen and configures the interface according to the file setup by the...
  • Page 38: Appendix A Stillcolor

    StillColor This appendix describes the different methods you can use to acquire a color image using the IMAQ PCI/PXI-1408 and National Instruments StillColor technology, explains basic color theories, and describes the different output options supported by StillColor. Introduction You can use two basic video camera types for color acquisition—RGB cameras and composite color video cameras.
  • Page 39 This sharing makes it impossible to separate the two signals perfectly and, therefore, perfect reconstruction of the original color image is not possible. NI-IMAQ User Manual Introduction to Color © National Instruments Corporation...
  • Page 40 • • • © National Instruments Corporation Reduced luminance bandwidth, resulting in a blurry image. Cross-color modulation where rapidly changing colors affect the luminance of the image, as shown on the edges of the parrot’s head in Figure A-1.
  • Page 41: Figure A-1. Classical Decoding

    NTSC composite video signal. Figure A-1 uses classic decoding algorithms including bandpass/bandstop and comb filtering. Figure A-2 was acquired using the PCI/PXI-1408 and the StillColor algorithm. NI-IMAQ User Manual Figure A-1. Classical Decoding Figure A-2. StillColor Decoding © National Instruments Corporation...
  • Page 42 You can connect the composite video signal to any of the four input channels on the PCI/PXI-1408. Since StillColor is used for still scenes, you can perform only a snap (a single-image acquisition). © National Instruments Corporation NI-IMAQ User Manual...
  • Page 43 (the longest wavelength) to the blue edge of ultraviolet light (the shortest wavelength). This continuous spectrum is called the visible spectrum, as shown in Figure A-3. NI-IMAQ User Manual section later in this appendix for more information © National Instruments Corporation...
  • Page 44: Figure A-3. White Light And The Visible Spectrum

    • • • • © National Instruments Corporation Figure A-3. White Light and the Visible Spectrum Hue, which is the perceived dominant color. Hue depends directly on the wavelength of a color. Saturation, which is dependent on the amount of white light present in a color.
  • Page 45 16-bit signed and 16-bit unsigned integers. On average, the 16-bit representation of a plane is equal to 128 times the 8-bit representation of the plane from the same image. The 16-bit representation is generally only NI-IMAQ User Manual GREEN BLUE © National Instruments Corporation...
  • Page 46 You can also pack the three 8-bit Hue, Saturation, and Luminance planes (HSL) or the three Hue, Saturation, and Intensity planes (HSI) in one array of 32-bit integers, which is equivalent to the 32-bit RGB representation. © National Instruments Corporation Luminance = 0.299 Red + 0.587 Green + 0.114...
  • Page 47 Electronic Services Bulletin Board Support National Instruments has BBS and FTP sites dedicated for 24-hour support with a collection of files and documents to answer most common customer questions. From these sites, you can also download the latest instrument drivers, updates, and example programs. For recorded instructions on how to use the bulletin board and FTP services and for BBS automated information, call 512 795 6990.
  • Page 48 Telephone and Fax Support National Instruments has branch offices all over the world. Use the list below to find the technical support number for your country. If there is no National Instruments office in your country, contact the source from which you purchased your software to obtain support.
  • Page 49 National Instruments for technical support helps our applications engineers answer your questions more efficiently. If you are using any National Instruments hardware or software products related to this problem, include the configuration forms from their user manuals. Include additional pages if necessary.
  • Page 50: Other Products

    Complete a new copy of this form each time you revise your software or hardware configuration, and use this form as a reference for your current configuration. Completing this form accurately before contacting National Instruments for technical support helps our applications engineers answer your questions more efficiently.
  • Page 51 Documentation Comment Form National Instruments encourages you to comment on the documentation supplied with our products. This information helps us provide quality products to meet your needs. Title: NI-IMAQ User Manual Edition Date: June 1998 Part Number: 371443A-01 Please comment on the completeness, clarity, and organization of the manual.
  • Page 52 ± plus or minus positive of, or plus amperes alternating current acquisition window the image size specific to a video standard or camera resolution © National Instruments Corporation Value –12 –9 – 6 –3 NI-IMAQ User Manual...
  • Page 53 NI-IMAQ User Manual © National Instruments Corporation...
  • Page 54 (DACs) for analog output central processing unit CSYNC composite sync signal; a combination of the horizontal and vertical sync pulses CSYNCIN composite sync in signal CSYNCOUT composite sync out signal © National Instruments Corporation Glossary NI-IMAQ User Manual...
  • Page 55 DMA is the fastest method of transferring data to/from computer memory DRAM dynamic RAM drivers software that controls a specific hardware device such as an IMAQ or DAQ device NI-IMAQ User Manual © National Instruments Corporation...
  • Page 56 © National Instruments Corporation Glossary NI-IMAQ User Manual...
  • Page 57 R, G, and B primaries. See also RGB. hertz—the number of scans read or updates written per second NI-IMAQ User Manual y = COS (x) status = (board, channel, range) AO_config © National Instruments Corporation...
  • Page 58 Note that for CIR/PAL video the black level is equal to the blanking level or 0 IRE, while for RS-170/NTSC video the black level is at 7.5 IRE. interrupt request © National Instruments Corporation Glossary NI-IMAQ User Manual...
  • Page 59 1 million or 10 NI-IMAQ User Manual , used with B in quantifying data or , when used with B to quantify data or computer memory , used with units of bytes/s , when used with bytes/s © National Instruments Corporation...
  • Page 60 NI-IMAQ driver software for National Instruments IMAQ hardware noninterlaced a video frame where all the lines are scanned sequentially, instead of divided into two frames as in an interlaced video frame NTSC National Television Standards Committee—the committee that developed...
  • Page 61 LSB of the accuracy of an ADC; it includes all nonlinearity and quantization errors but does not include offset and gain errors of the circuitry feeding the ADC NI-IMAQ User Manual G-10 © National Instruments Corporation...
  • Page 62 RS-170 the U.S. standard used for black-and-white television RTSI bus Real-Time System Integration Bus—the National Instruments timing bus that connects IMAQ and DAQ boards directly, by means of connectors on top of the boards, for precise synchronization of functions seconds saturation the richness of a color.
  • Page 63 (2) a LabVIEW software module (VI), which consists of a front panel user interface and a block diagram program video line a video line consists of a HSYNC, back porch, active pixel region, and a front porch NI-IMAQ User Manual G-12 © National Instruments Corporation...
  • Page 64 NTSC or PAL video signals. The luminance information is called Y, while the chrominance information is represented by two components, U and V representing the coordinates in a color plane. © National Instruments Corporation G-13 Glossary NI-IMAQ User Manual...
  • Page 65 A-7 white light and visible spectrum (figure), A-2 composite color cameras, A-1 customer communication, xi, B-1 to B-2 © National Instruments Corporation documentation conventions used in manual, x how to use NI-IMAQ manual set, ix National Instruments documentation, xi...
  • Page 66 (table), 3-2 list of functions, 2-7 programming considerations, 3-2 to 3-3 low-level functions, 2-5 to 2-7 acquisition functions, 2-5 advanced programming examples, 3-14 to 3-17 grab functions, 3-15 ring functions, 3-16 © National Instruments Corporation...
  • Page 67 3-15 to 3-16 low-level snap functions, 3-14 to 3-15 StillColor snap programming, 3-16 to 3-17 © National Instruments Corporation buffer management, 3-4 camera attributes, 3-4 to 3-5 high-level functions, 3-1 interface functions, 3-2 to 3-3 introductory examples, 3-6 to 3-14...
  • Page 68 A-2 to A-3 NI-IMAQ User Manual technical support, B-1 to B-2 telephone and fax support numbers, B-2 utility functions, 2-7 video cameras for color acquisition, A-1 visible spectrum, A-6 to A-7 white light, A-7 © National Instruments Corporation...

This manual is also suitable for:

Ni-imaq

Table of Contents