Industrial Vision: Image acquisition CCD camera Digitalisation Data acquisition cards Vision software Cameras and sensors; lenses 2001-08-21 1 Image acquisition: CCD camera 2001-08-21 2 Image acquisition: CCD camera CCD camera CCD: Licht wordt in lading omgezet. CCD chip bevat aan elkaar geschakelde capaciteiten. Ladingen worden doorgeklokt naar buiten. ADC kan niet op de CCD chip, dus steeds een analoge uitgang. CMOS: elk beeldelement bevat 1 fotodiode en 3 transistoren: een voor lading-spanningsconversie, twee voor adressering. 2001-08-21 3 2001-08-21 4 Image acquisition: CCD sensor Photon Gates Silicon Charges Potential Well 2001-08-21 5 Image acquisition: digitalisation 0...255 A Volts D Greyvalue 8 Bit Volts 0,7 0,348 brighter 127 255 Greyvalue 2001-08-21 6 Digitalisation Pixel = Picture Element camera image Pixel mask 8 bit grayscale digital image 2001-08-21 7 Digitalisation Grayscale image & numeric representation 255 255 255 255 253 88 74 73 72 72 75 175 255 255 255 255 255 255 255 250 82 75 74 73 74 73 190 255 255 255 255 255 255 255 231 80 73 72 72 72 76 197 255 255 255 255 255 255 255 232 83 73 73 73 76 75 172 255 255 255 255 255 255 255 226 79 75 74 74 76 75 184 255 255 255 255 255 255 255 220 84 75 73 76 79 74 159 255 255 255 255 255 255 255 224 83 76 74 77 75 75 156 255 255 255 255 255 255 255 207 90 75 76 78 77 81 172 255 255 255 255 255 255 255 252 107 75 75 80 79 79 162 255 255 255 255 255 255 255 249 136 77 76 89 81 99 217 255 255 255 255 255 255 255 255 183 78 75 80 81 120 248 255 255 255 255 255 255 255 255 249 86 76 74 84 201 255 255 255 255 255 255 255 255 255 255 115 77 77 98 251 255 255 255 255 255 255 255 255 255 255 193 80 78 143 255 255 255 255 255 255 255 255 255 255 255 217 85 78 173 255 255 255 255 255 255 255 255 255 255 255 248 97 79 220 255 255 255 255 255 255 255 255 255 255 255 255 119 80 224 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 Video sources The video source can be: • • • • • • • Video camera Camcorder Video recorder (VCR) Television broadcasts X-ray equipment Scanning Electron Microscope (SEM) CT scanner 2001-08-21 8 Signal types for Image acquisition boards 2001-08-21 9 Composite video = signal containing both video data (luminance + colour) and the timing (synchronisation) information. It is the standard which interconnects almost all video equipment (TVs, laserdisc, videorecorders, camcorders) at home. It can be transported over RCA connector or SCART (=Peritel=Euro) connector. Examples of composite video standards: • RS-170: • used in North America and Japan • Monochrome signal • Spatial resolution: 640 pixels x 480 lines • Frequency: 60 fields/second (equivalent to 30 frames/second) • NTSC/RS-330 • used in North America and Japan • Equivalent to RS-170 but colour information is superimposed on the monochrome signal. • NTSC = National Television System Committee Signal types for Image acquisition boards More composite video standards: • CCIR • • • • • • used in Northern Europe Monochrome signal Spatial resolution: 768 pixels x 576 lines Frequency: 50 fields/second (equivalent to 25 frames/second) CCIR = Comité Consultatif International Radio PAL • used in Northern Europe • Equivalent to CCIR but colour information is superimposed on the monochrome signal. • PAL = Phase Alteration Line • SECAM • used in France, Russia and the Sovjet Republic States • Equivalent to CCIR but colour information is superimposed on the monochrome signal. • SECAM = Séquencial Couleur Avec Memoire 2001-08-21 10 Signal types for Image acquisition boards 2001-08-21 11 S-Video (also called Y/C video): luminance (Y) and chrominance (C) are separate signals. The Y signal contains timing (synchronisation) information. S-video can be transported over 4 pin mini DIN connector, or over SCART connector. Some image sources produce “nonstandard” video signals: • Video and timing information can vary in format as well as in single or multiple signals. They do not adhere to particular spatial resolutions, signal timing schemes, signal characteristics … Consult the documentation provided with your video source. Progressive scan (25-30 frames/sec) cameras produce non interlaced signals. All previous camera signals are analogue. DIGITAL CAMERAS: No frame grabber required! • Cameras with FireWire (IEEE 1394) interface. Supported by Apple, Windows XP • Cameras with USB interface 2001-08-21 12 Fuga Allegro Image acquisition boards • • • • 2001-08-21 13 The video capture device is often called frame grabber card. Frame grabber puts a pixel mask over the image: the card converts the analogue image (or images) supplied by a video source into a digital array (or arrays) of data points. It is a plug in card (PCI) with AD convertor. The ADC must have video speed: 20 MHz or higher (30 or 25 video frames per second, 300 kB [640 x 480 x 8 bit] per frame. Other features: • input multiplexer (to select one of the 4 inputs) • Colour notch filter = chrominance filter (to acquire monochrome signals from colour sources) • Programmable gain stage (to match the signal into the ADC input range) • Timing and acquisition control (to synchronise grabbing with sync pulses of incoming signal: PLL or Digital Clock Synchronisation) • Camera control stage (to send to the camera or to receive from the camera setup and control signals, e.g. horizontal and vertical sync signals, pixel clock and reset signals) • Most cards provide digital I/O for input or output operations, to communicate with external digital devices (e.g. industrial process). This saves a separate I/O board. Block diagram of analog frame grabber 2001-08-21 14 © Data Translation Image acquisition boards (continued) • 2001-08-21 15 Plug-in cards (image grabber, frame grabber card) for analogue cameras • • • • • • • Are plugged in at a VME or PCI bus Are delivered with Windows 98 or NT drivers Accept cameras according to the EIA (30 frames/sec) or CCIR (25) standards Good cards have their own processor (DMA data transfer to PC) and large RAM Others (cheaper ones) use the PC processor They accept the signals: S video, composite video TV or VCR signals (NTSC/PAL/Secam) Some cards have camera control output Image acquisition - Cameras • Sensor types: • Line • Array • Interface standards: • • • • • • CCIR / RS-170 (B&W, 50-60 fields/sec.) PAL / SECAM / NTSC (Colour) Progressive scan (25-30 frames/sec.) FireWire (IEEE 1394) USB Sensor technology: • CCD (Charge Coupled Device) • CMOS (Complementary Metal Oxide Semiconductor). A CMOS camera produces a 1000*1000 pixel image 2001-08-21 16 Spatial resolution 2001-08-21 17 • The number of rows (N) from a video source generally corresponds one-to-one with lines in the video image. The number of columns, however, depends on the nature of the electronics that is used to digitize the image. Different frame grabbers for the same video camera might produce M = 384, 512, or 768 columns (pixels) per line. • a CCIR / PAL image source can result in max 768 x 576 pixel image • a RS-170 / NTSC source can result in max 640 x 480 pixel image • Depending on video source or camera used, the spatial resolution can range from 256 x 256 up to 4096 x 4096. • Most applications use only the spatial resolution required. For fast image transfer and manipulation, often 512 x 512 is used. For more accurate image processing, 1024 x 1024 is common. • The pixel aspect ratio (pixel width : pixel height) can be different from 1:1, typical 4:3. Some frame grabbers don’t convert video data into square pixels but into rectangle ones. This creates the effect of a circle appearing ovular, and squares appearing as rectangles. 2001-08-21 18 Spatial resolution • Example 768 x 512 (aspect ratio 3 : 2) 768 pixels 512 rows 520 rows max CCIR 2 3 Brightness resolution • Brightness resolution = bit depth resolution: number of gray levels (monochrome) or number of colours • RS-170 / NTSC image: 8 bits = 256 gray levels • A standard RS-170 image is 307 kB large: 640 x 480 x 8bit. Interlaced / non interlaced formats 2001-08-21 19 • A video signal consists of a series of lines. Horizontal sync pulses separe the lines from each other. • All composite video sources (RS-170/NTSC, CCIR/PAL) and some nonstandard video sources transmit the lines in interlaced format: first the odd (first field), afterwards the even lines (second field). • Vertical sync pulses separate the fields from each other. • Some nonstandard video sources transmit the lines in non-interlaced format = progressive scan. Only one field, containing all the lines, is transmitted. • Progressive scan is recommended for fast moving images. • If one is planning to use images that have been scanned from an interlaced video source, it is important to know if the two half-images have been appropriately "shuffled" by the digitization hardware or if that should be implemented in software. Further, the analysis of moving objects requires special care with interlaced video to avoid "zigzag" edges. 2001-08-21 20 Image sensors - Interlacing Interlaced image (TV) Field 1 Field 2 Industrial Vision software • Labview • … 2001-08-21 21 2001-08-21 22 Image enhancement • Neighbourhood operations • • Sharpening / blurring Edge detection Image -1 -1 -1 -1 9 -1 -1 -1 -1 1 1 1 1 1 1 1 1 1 1 0 -1 1 0 -1 1 0 -1 1 1 1 0 0 0 -1 -1 -1 Result Image enhancement • Contract enhancement • • • Thresholding Histogram equalisation See course Digital Image Processing, R. Catthoor 2001-08-21 23 Image acquisition: moving objects • 2001-08-21 24 Resolution calculation • Cd resolution = cross detection • Md resolution = moving detection • Example cd resolution: • • • • • Image width = 1900 mm Required resolution = 0.25 mm Number of pixels: 1900/0.25 = about 8000 This requires minimum 2 line scan CCD cameras Example md resolution: • • • Required resolution = 0.25 mm (same as cd) Object velocity = 1600 mm/sec This requires 1600/0.25 = 6400 lines per second, or a camera with 6.4 kHz line scan frequency. Image acquisition: cameras and sensors 2001-08-21 25 Camera • Contains CCD or CMOS chip. It produces an analogue signal • CCD chip contains opt. sensors with bucket memory and shift register • The shift register is controlled by a pixel clock • Synchronous reset camera: the pixel clock runs independently • Asynchronous reset camera: the shift register is set externally: a picture is captures immediately after an external trigger. • A Matrix camera captures interlaced or progressive scan (=noninterlaced) images • Interlaced camera: sensor can be slower; reduced flickering • Standards: an image has a 2x3 ratio • A Linescan camera captures one single line only • Sensors producing an interlaced image are not good for moving images (comb effect) • Now there are digital cameras: The CCD is coupled to a built in ADC • Digital camera’s allow digital remote camera settings; no frame grabber card is required. Image acquisition: cameras and sensors 2001-08-21 26 CCD or CMOS • CCD chip bestaat uit lichtsensoren in de vorm van een emmertjes geheugen, en een shift register. Dit laatste wordt gecontroleerd door een pixel clock • Het licht wordt in lading omgezet. CCD chip bevat aan elkaar geschakelde capaciteiten. Ladingen worden door deze capaciteiten naar buiten geklokt. Is er 1 pixel stuk, dan is er geen informatie over de volledige lijn die erop volgt. • Een ADC kan niet op de CCD chip, dus steeds een analoge uitgang. • • • • CMOS: elk beeldelement bevat 1 fotodiode en 3 transistoren: één voor lading-spanningsconversie, twee voor adressering. Bij CCD is de ganse cel beschikbaar voor belichting, dus 10x meer gevoelig dan CMOS. De donkerstroom is 10x hoger bij CMOS. Elke lichtgevoelige cel is individueel uitleesbaar. Is er 1 pixel stuk, dan bijft de rest van de lijn intact. Dynamisch bereik is hoger. Bij CCD is er bij overbelichting een “overlopen” van ladingen. CMOS is sneller uit te lezen. 2001-08-21 27 Image sensors - CCD versus CMOS Property Dynamic range Pixel read out Manufacturing costs Integration complexity On-chip-processing Power usage Distortions Technology Image technology CCD Up to 45 dB Frame/field wise High High Very difficult High Blooming/smearing Well known Well known CCD CMOS Up to 140 dB Random/Area wise Low Low Relatively easy Low Fixed pattern noise Well known Experimental CMOS 2001-08-21 28 Optics • Choices: • • • • • • • • Magnification Depth of field Distance to object Distance to image sensor Light intensity Optical resolution Telecentric Artefacts: • Added size • Added weight • Image distortion Image acquisition: cameras and sensors 2001-08-21 29 Lens • • Choose a lens with right focus distance A “telecentric objective” sees only the surface plane of a prismatic object Price • • B/W Camera: 500 EUR Frame Grabber card with software: 300 EUR