laitimes

Machine Vision - (II, Camera)

introduction

The previous article focused on summarizing the relevant knowledge of light sources, as well as machine vision - (1, light sources)

This article summarizes the concept and selection of machine vision cameras in industry.

1. Camera selection

(1) Classification of industrial digital cameras:

  • Industrial cameras can be divided into CCD cameras and CMOS cameras according to the type of chip;
  • According to the output color, it can be divided into monochrome (black and white) cameras and color cameras;
  • According to the structural characteristics of the sensor, it can be divided into line scan camera (black and white camera, 3Line color camera, 3CCD color camera (beamsplitting prism), area scan camera (black and white camera, Bayer color camera, 3CCD color camera (beamsplitting prism);
  • According to the output signal mode, it can be divided into analog camera (PAL (black and white for CCIR)), NTSC (black and white for EIA)), digital camera (IEEE1394, USB2.0, Camera Link, GigE);
  • According to the scanning method, it can be divided into interlaced camera and progressive scan camera;
  • According to the resolution size, it can be divided into ordinary resolution camera and high-resolution camera;
  • According to the output signal speed, it can be divided into ordinary speed camera and high-speed camera;
  • According to the response frequency range, it can be divided into visible (ordinary) camera, infrared camera, ultraviolet camera, etc.

(2) The main parameters of the camera

The main parameters of the camera include: (1) resolution; (2) Speed (frame rate/line rate); (3) Exposure method and shutter speed; (4) signal-to-noise ratio; (5) Dynamic range; (6) cell depth; (7) spectral response; (8) Optical interface.

(1) Resolution

Resolution is the most basic parameter of the camera, determined by the resolution of the sensor used by the camera, and is the number of cells arranged on the target surface of the chip.

Usually the resolution of an area scan camera is expressed by two numbers, horizontal and vertical resolution, such as: 1920(H) x 1080(V), the first number indicates the number of cells per row, that is, a total of 1920 cells, and the following number indicates the number of cell rows, that is, 1080 rows. Now the resolution of the camera usually represents how many K, such as 1K (1024), 2K (2048), 3K (4096), etc.

When acquiring images, the resolution of the camera has a great influence on the image quality. When imaging the same large field of view (field of view), the higher the resolution, the more obvious the display of detail.

(2) Speed (Frame Rate / Line Rate)

The camera's frame rate/line rate indicates how often the camera acquires images. Usually area scan cameras are expressed in frame rate, unit fps (Frame Per second), such as 30fps, which means that the camera can capture up to 30 frames of images in 1 second; Line scan cameras usually use line frequency in KHz, such as 12KHz means that the camera can acquire up to 12,000 lines of image data in 1 second.

The rate at which the camera acquires and transmits images is generally the number of frames per second captured for area scan cameras (Frames/Sec.) and the number of lines per second (Lines/Sec.) for line scan cameras.

Speed is an important parameter for cameras, and in practical applications it is often necessary to image moving objects. The speed of the camera needs to meet certain requirements in order to image objects clearly and accurately. The frame rate and line rate of the camera are first affected by the frame rate and line rate of the sensor, and the maximum speed of the design of the chip is mainly determined by the highest clock that the chip can withstand.

(3) Exposure method and shutter speed

  • Line scan cameras are progressive exposure methods, you can choose fixed line frequency and external trigger synchronization acquisition mode, the exposure time can be consistent with the line period, or you can set a fixed time.
  • Area scan cameras have several common methods such as frame exposure, field exposure, and scrolling line exposure.
  • Digital cameras generally provide the function of external trigger image acquisition.

The shutter speed is generally up to 10 microseconds, and high-speed cameras can be faster.

(4) Signal-to-noise ratio

Camera noise refers to signals that are not desired to be collected during imaging and are outside the actual imaging target.

Therefore, the signal-to-noise ratio of the camera is defined as the ratio of signal to noise in the image (the ratio of the average gray value of the effective signal to the root mean square of the noise), which represents the quality of the image, and the higher the signal-to-noise ratio of the image, the better the image quality. (Cameras with a high signal-to-noise ratio have better performance)

(5) Dynamic range

The dynamic range of the camera indicates the range of the camera detecting the optical signal, and the dynamic range can be defined by two methods, one is the optical dynamic range, which refers to the ratio of the maximum light intensity at saturation to the light intensity equivalent to the noise output, which is determined by the characteristics of the chip. The other is the electronic dynamic range, which refers to the ratio between the saturation voltage and the noise voltage.

For fixed cameras, the dynamic range is a fixed value and does not change with external conditions. At linear response, the camera's dynamic range is defined as the ratio of saturated exposure to noise-equivalent exposure:

Machine Vision - (II, Camera)

Dynamic range can be expressed in multiples, dB, or bits. With a large dynamic range, the camera is more adaptable to different light intensities.

(6) Cell/pixel depth

The digital signal output by a digital camera, the pixel grayscale value, has a special number of bits, called cell depth. That is, the number of bits per pixel of data is generally 8Bit, and for digital cameras, there are generally 10Bit, 12Bit, 14Bit, etc.

For monochrome cameras, the orientation of this value is usually 8-16bit. Cell depth defines the number of gray levels of gray that are brightened by the dark channel. For example, for an 8-bit camera, 0 represents full darkness and 255 represents full brightness. A number between 0 and 255 represents a certain brightness metric. 10-bit data has 1024 gray scales, while 12-bit has 4096 gray scales. For each application, we have to carefully consider whether very fine grayscale levels are required. Increasing from 8bit to 10bit or 12bit can indeed enhance the accuracy of measurement, but it also reduces the speed of the system and increases the difficulty of system integration (more cables, larger size), so we must also choose carefully.

(7) Spectral response

Spectral response refers to the camera's ability to respond to different wavelengths of light, usually the spectral response of the chip it uses. It is usually represented by a spectral curve, with different wavelengths on the horizontal axis and quantum efficiency on the vertical axis.

According to the different response spectrum, the camera is also divided into visible light camera (400nm-1000nm, peak between 500nm-600nm), infrared camera (response wavelength above 700nm), ultraviolet camera (can respond to 200nm-400nm short wave), we need to choose different spectral response cameras according to the different wavelengths of the luminescence of the measured object.

(8) Optical interface/interface type

Optical interface refers to the interface between the camera and the lens, and the commonly used excuses for lenses are C mount, CS mount, F mount. The table below provides information on lens mounting and back focal length. The M42 lens adapter is derived from the high-end camera standard. On the other hand, the Z axis of the camera is optimized for the supplied adapter, and it is generally not easy to remove the lens adapter.

Machine Vision - (II, Camera)

2, the main interface type of industrial digital camera

Mainly: Usb 2.0, IEEE 1394, CameraLink, GiggE.

Machine Vision - (II, Camera)

Most of the industrial cameras on the market today are cameras based on CCD or CMOS sensors.

  • CCD cameras, CCDs are called charge-coupled devices, CCDs are actually just a way to store electrons coming out of image semiconductors in an organized way. Advantages: high image quality, high sensitivity, high contrast; Disadvantages: Blooming, no direct access to each pixel, no on-chip processing function.
  • CMOS cameras, CMOS is called "complementary metal-oxide semiconductor", CMOS is really just a technology that puts transistors on silicon blocks, and has no more meaning. CMOS integrates photosensitive components, amplifiers, A/D converters, memory, digital signal processors, and computer interface control circuitry on a single silicon chip. Advantages: small size, simple structure, multiple on-chip processing functions, low power consumption, no blooming phenomenon, direct access to a single pixel, high dynamic range (120dB), frame rate can be higher; Disadvantages: poor consistency, poor light sensitivity, large noise.

CCD sensor cameras are suitable for high-speed dynamics; CMOS sensor cameras are suitable for low-speed dynamic or stationary speeds.

Compared with CCD sensors, the random reading characteristics of CMOS sensors make it easy to implement the rectangular region of interest (AOI) reading method of images. This feature allows CMOS to achieve higher frame rates for smaller AOIs. Another advantage of CMOS sensors is their fast readout speed. The disadvantage of CMOS sensors is that they have a low fill factor, and micromirrors are often used to increase their fill factor.

Summary: The difference between CCD and COMS

• The advantage of CCD is good image quality;

• CMOS is cheaper than CCD and power consumption is lower than CCD;

• CCD for dynamic measurement;

• CMOS for low-speed or static measurements. But now the CMOS of global exposure can also be used for dynamic measurements;

• CCD is mainstream now, but CMOS is catching up, and CMOS is the future.

3, How to choose an industrial camera

  1. The first thing to understand is your own inspection task, whether to take static or dynamic photos, what is the frequency of taking pictures, whether to do defect detection or dimensional measurement or positioning, what is the size of the product (shooting field of view), how much accuracy needs to be achieved, the performance of the software used, how the site environment is, whether there are other special requirements, etc.
  2. If it is a dynamic photo, what is the speed of movement, choose the minimum exposure time according to the speed of movement and whether a camera with progressive scan is required; The frame rate (maximum shooting frequency) of the camera is related to pixels, usually the higher the resolution, the lower the frame rate, and the frame rate of different brands of industrial cameras is slightly different.
  3. Depending on the inspection task, the size of the product, the resolution to be achieved and the performance of the software used, the resolution of the required industrial camera can be calculated; The most important consideration for the field environment is temperature, humidity, interference and lighting conditions to select different industrial cameras.
  4. Consider the accuracy of the object to be observed or measured, and select the industrial camera resolution according to the accuracy. Camera pixel accuracy = unidirectional field of view range size / camera unidirectional resolution. Camera unidirectional resolution = unidirectional field of view range size / theoretical accuracy.

Instance:

Suppose to detect the surface scratches of an object, the size of the object required to be photographed is 10*8mm, and the required detection accuracy is 0.01mm.

First of all, assuming that the field of view to be shot is 12*10mm, then the minimum resolution of the camera should be selected in: (12/0.01) * (10/0.01) = 1200*1000, about 1.2 million pixel camera, that is, a pixel corresponds to a defect detection then the minimum resolution must not be less than 1.2 million pixels, but the common 1.3 million pixel camera on the market, so generally speaking, choose a 1.3 million pixel camera.

But the actual problem is that if a pixel corresponds to a defect, then such a system will be extremely unstable, because any interference pixel may be mistaken for a defect, so in order to improve the accuracy and stability of the system, it is best to take the area of the defect in more than 3 to 4 pixels, so that the selected camera is more than 1.3 million by 3, that is, the minimum cannot be less than 3 million pixels. Usually a 3 million pixel camera is best (I've seen the most people holding subpixels and saying that they want to do a few tenths of a subpixel, then they don't need such a high-resolution camera).

The exposure time of the camera

  The minimum exposure time of the camera, which can determine the speed of movement of the target. Or conversely, the speed of movement of the target puts forward requirements for the minimum exposure time of the camera. Assuming that our target motion speed is 1mm/s and our measurement accuracy is 0.01mm/pixel, then we must consider, The drag caused by the movement of the object must be less than our accuracy of 0.01mm, the target movement 0.01mm, it takes 10ms, which requires that the exposure time of our camera must be less than 10ms, if it is greater than this exposure time, then only the blur caused by the movement of the object will be greater than 0.01, then our accuracy can not reach 0.01.

  In general, the blur caused by object motion should be an order of magnitude smaller than the measurement accuracy we require, which can reduce its impact on the system, and the fastest exposure time of our industrial cameras can reach tens to hundreds of microseconds. Such a short exposure time requires a large amount of light energy, so it is necessary to choose the appropriate light source and light source controller.

Reprinted in: https://www.cnblogs.com/xyf327/p/14863385.html