2017년 11월 16일 목요일

Digital Camera Basics

원본: Link

Overview
Digital cameras have become increasingly popular for use in machine vision systems thanks to their accuracy, high frame rates, large image sizes, and the ability to change attributes of the camera programmatically. This document describes the basic concepts of digital cameras and how they interact with IMAQ hardware and NI-IMAQ software.
디지털 카메라는 정확성, 높은 프레임 속도, 큰 이미지 크기 및 카메라 속성을 프로그래밍 으로 변경 가능 하기 때문에 머신 비전 시스템에 널리 사용됩니다. 이 문서는 디지털 카메라의 기본 개념과 IMAQ 하드웨어 및 NI-IMAQ 소프트웨어와 상호 작용하는 방법을 설명합니다.

Table of Contents

  1. Anatomy
  2. Taps
  3. Camera Communication
  4. Signal Types


1. Anatomy
The three most important types of digital signals that come out of a digital camera are the data lines, the pixel clock, and the enable lines.
디지털 카메라에서 나오는 가장 중요한 세 가지 유형의 디지털 신호는 데이터 라인, 픽셀 클럭 및 인 에이블 라인입니다.

  • The Data Lines are parallel wires that carry digital signals that correspond to pixel values. Digital cameras typically represent one pixel with 8 bits, 10 bits, 12 bits or even 14 bits. Therefore, it takes 8, 10, 12, or 14 digital lines to represent one pixel. The number of lines per pixel is referred to as the pixel depth. All image data is transferred to an image acquisition device on these lines at the same time, and is constantly toggling up and down.
  • 데이터 라인은 픽셀 값에 해당하는 디지털 신호를 전달하는 병렬 와이어입니다. 디지털 카메라는 일반적으로 8 비트, 10 비트, 12 비트 또는 심지어 14 비트의 (1개)픽셀을 나타냅니다. 따라서 하나의 픽셀을 표현하는 데 8, 10, 12 또는 14 개의 디지털 라인이 필요합니다. 픽셀 당 라인 수를 픽셀 깊이(pixel depth)라고합니다. 모든 이미지 데이터는 동시에 이 라인의 이미지 수집 장치로 전송되며 끊임없이 위아래로 전환됩니다.
  • The Pixel Clock is a high frequency pulse train that determines when the data lines have valid data. On the active edge of the pixel clock (which can be either the rising edge or the falling edge, depending on the camera), the digital lines should all have a constant value that is input into the image acquisition device, which latches in the data. The data changes to the next pixel value before the next active edge of the pixel clock, so that the next pixel value will get latched into the image acquisition device. The pixel clock frequency determines the rate pixels are acquired.
  • 픽셀 클록 (Pixel Clock)은 데이터 라인에 유효한 데이터가있을 때를 결정하는 고주파 펄스 트레인입니다. 픽셀 클럭의 활성 에지 (카메라에 따라 상승 에지 또는 하강 에지 중 하나 일 수 있음)에서 디지털 라인은 모두 이미지 수집 장치에 입력되는 일정한 값을 가져야하며, 이는 데이터를 래치합니다 . 다음 픽셀 값이 이미지 획득 장치에 래치되도록 데이터는 픽셀 클럭의 다음 활성 에지 전에 다음 픽셀 값으로 변경됩니다. 픽셀 클럭 주파수는 픽셀이 획득되는 속도를 결정합니다.
  • The Enable Lines are used to determine where the pixels are located in the image. The H-Enable (also referred to as the HSYNC or Line Enable signal) is active while an entire row of pixels is coming in. At the end of that row of pixels, the H-Enable goes inactive until the beginning of the next row of pixels begins. Another signal, the V-Enable (also referred to as the VSYNC or Frame Enable signal), is active during the entire frame. After one frame is done, the signal goes inactive until the beginning of the next frame. Enable signals can be either active high or active low. Some cameras' Enable Lines are edge-sensitive instead of level-sensitive, meaning that they use the rising edge of timing signals rather than the level. and National Instruments image acquisition devices are designed to work with level-sensitive enable lines and edge-sensitive pixel clocks.
  • 라인 사용은 이미지의 픽셀 위치를 결정하는 데 사용됩니다. H-enable (HSYNC 또는 라인 인 에이블 신호라고도 함)은 픽셀의 전체 행이 들어오는 동안 활성화됩니다. 픽셀 행의 끝에서 H- enable는 다음 행의 시작 때까지 비활성 상태가됩니다 픽셀이 시작됩니다. 또 다른 신호 인 V-Enable (VSYNC 또는 프레임 인 에이블 신호라고도 함)은 전체 프레임 동안 활성화됩니다. 한 프레임이 끝나면 신호는 다음 프레임이 시작될 때까지 비활성 상태가됩니다. 인 에이블 신호는 액티브 하이 또는 액티브 로우 일 수 있습니다. 일부 카메라의 인 에이블 라인은 레벨에 민감하지 않고 경계에 민감합니다. 즉, 레벨보다는 타이밍 신호의 상승 에지를 사용합니다. 내쇼날 인스트루먼트의 이미지 수집 디바이스는 레벨에 민감한 인 에이블 라인 및 에지 감지 픽셀 클럭과 함께 작동하도록 설계되었습니다.

Most digital cameras use a CCD (Charge Coupled Device) sensor to acquire images. The CCD is composed of thousands of small sensors that absorb photons while the shutter is open and build up an electrical charge. When the camera takes a picture, it discharges the CCD elements and converts the voltages into digital data in the camera. The CCD elements form a square or line with each element corresponding to a pixel.
There are two major classes of cameras -- Line Scan and Area Scan. Line Scan cameras use a single row of CCD elements. Also, since there are only lines, Line Scan cameras only require the H-Enable signal. Area Scan cameras feature frames with a defined width and height and use both the H-Enable and V-Enable signals to construct their frames. Below is an image of these two types of cameras with the enable signals and pixel clock. The following figure represents the enable signals and pixel clock signals for Line Scan and Area Scan cameras. Note that the data lines in the figure may change between each active edge of the pixel clock. The data on the lines during the active edge of the pixel clock, when the H-Enable and V-Enable signals are active, will be latched into the image acquisition device.
대부분의 디지털 카메라는 CCD (Charge Coupled Device) 센서를 사용하여 이미지를 수집합니다. CCD는 셔터가 열려있는 동안 광자를 흡수하는 작은 센서로 구성되어 있으며 전기를 충전합니다. 카메라가 사진을 찍으면 CCD 요소를 방전하고 카메라의 전압을 디지털 데이터로 변환합니다. CCD 요소는 각 요소가 픽셀에 해당하는 사각형 또는 선을 형성합니다.
라인 스캔과 영역 스캔의 두 가지 주요 클래스가 있습니다. 라인 스캔 카메라는 CCD 요소의 단일 행을 사용합니다. 또한 회선 만 있기 때문에 라인 스캔 카메라는 H-Enable 신호 만 필요합니다. Area Scan 카메라는 정의 된 너비와 높이의 프레임을 특징으로하며 H-Enable 및 V-Enable 신호를 사용하여 프레임을 구성합니다. 아래는 이네 이블 신호와 픽셀 클록이있는이 두 종류의 카메라의 이미지입니다. 다음 그림은 라인 스캔 및 영역 스캔 카메라의 인 에이블 신호 및 픽셀 클록 신호를 나타냅니다. 그림의 데이터 라인은 픽셀 클록의 각 활성 에지 사이에서 변경 될 수 있습니다. H-Enable 및 V-Enable 신호가 활성화 될 때 픽셀 클럭의 활성 에지 동안 라인의 데이터가 이미지 수집 장치에 래치됩니다.
Figure 2. Area Scan camera that is 12 x 4 (12 pixels per line and 4 lines per frame)

2. Taps
Increasing the speed of a digital camera's pixel clock or acquiring more than one pixel at a time can greatly increase the camera's acquisition speed. A camera that latches only one pixel on the active edge of the pixel clock is known as a single tap camera. A tap, or channel, is defined as a group of data lines that bring in one pixel each. Some cameras have multiple pixels on separate data lines that are all available on the same active edge of the pixel clock. These cameras are called multi-tap cameras, and digital cameras are available with as many as 4 taps. This technique requires more data lines, but allows for faster transfers.
디지털 카메라의 픽셀 클럭 속도를 높이거나 한 번에 두 개 이상의 픽셀을 획득하면 카메라의 획득 속도가 크게 높아질 수 있습니다. 픽셀 클럭의 활성 에지에서 하나의 픽셀 만 래치하는 카메라를 단일 탭 카메라라고합니다. 탭 또는 채널은 각각 하나의 픽셀을 가져 오는 데이터 라인 그룹으로 정의됩니다. 일부 카메라에는 픽셀 클럭의 동일한 활성 에지에서 사용할 수있는 별도의 데이터 라인에 여러 개의 픽셀이 있습니다. 이 카메라를 멀티탭 카메라라고하며 디지털 카메라는 최대 4 번까지 사용할 수 있습니다. 이 기술은 더 많은 데이터 회선을 필요로하지만 더 빠른 전송을 허용합니다.

The IMAQ 1422 Series devices features 16 digital lines, and the IMAQ 1424 Series devices features 32 digital lines. Therefore, an IMAQ 1422 device can support cameras with one 16- bit tap or two 8-bit taps, and an IMAQ 1424 device can handle a single 32-bit tap, two 16-bit taps, or four 8-bit taps. IMAQ devices require a tap to be a multiple of 8 bits, so that even if a camera only has 10 bits per pixel, the device will require a tap of 16 bits to handle the data and ignore the upper 6 bits.
IMAQ 1422 시리즈 디바이스에는 16 개의 디지털 라인이 있으며 IMAQ 1424 시리즈 디바이스에는 32 개의 디지털 라인이 있습니다. 따라서 IMAQ 1422 장치는 하나의 16 비트 탭 또는 두 개의 8 비트 탭이있는 카메라를 지원할 수 있으며 IMAQ 1424 장치는 단일 32 비트 탭, 두 개의 16 비트 탭 또는 네 개의 8 비트 탭을 처리 할 수 ​​있습니다. IMAQ 디바이스는 탭이 8 비트의 배수가되어야하므로 카메라가 픽셀 당 10 비트 만 가지고 있어도 디바이스는 데이터를 처리하고 상위 6 비트를 무시하기 위해 16 비트의 탭이 필요합니다.

There are several different configurations multi-tap cameras use to store data. A single tap camera stores data beginning with the top left pixel and moves to the right before moving down to the next line, continuing in this manner until the last line is completed for that frame. The camera then starts acquiring the pixels at the top of the next frame. The following figures illustrate different storage configurations used by multi-tap cameras.
다중 탭 카메라가 데이터를 저장하는 데 사용하는 여러 가지 구성이 있습니다. 단일 탭 카메라는 왼쪽 상단 픽셀로 시작하는 데이터를 저장하고 오른쪽으로 이동하여 다음 줄로 이동 한 다음 마지막 줄이 해당 프레임에 대해 완료 될 때까지이 방식으로 계속됩니다. 그러면 카메라는 다음 프레임의 상단에서 픽셀 획득을 시작합니다. 다음 그림은 멀티탭 카메라에서 사용되는 다양한 스토리지 구성을 보여줍니다.
Figure 3. Tap illustration

3. Camera Communication
Digital cameras often allow you to change their functionality through serial commands or control signals. You can modify camera attributes through Measurement & Automation Explorer (MAX) by right-clicking on the camera, selecting Properties, and clicking on the Advanced tab. You can view and change all of your camera's properties on this tab. You can also access these properties programmatically using the function imgSetCameraAttributeString or the IMAQ Set Camera Attribute VI in LabVIEW.

Note: Be sure to check for the correct spelling and attribute order when you are setting your camera properties. Always set higher-level attributes first(i.e. before changing the Pulse Width, set the Shutter Control and Shutter Speed to the correct settings.)
지털 카메라는 종종 직렬 명령이나 제어 신호를 통해 기능을 변경할 수 있도록합니다. 카메라를 마우스 오른쪽 버튼으로 클릭하고 속성을 선택한 다음 고급 탭을 클릭하여 MAX (Measurement & Automation Explorer)를 통해 카메라 속성을 수정할 수 있습니다. 이 탭에서 카메라의 모든 속성을보고 변경할 수 있습니다. 또한 LabVIEW의 imgSetCameraAttributeString 또는 IMAQ Set Camera Attribute VI 함수를 사용하여 프로그래밍 방식으로 이러한 프로퍼티에 접근 할 수 있습니다.

참고 : 카메라 속성을 설정할 때 정확한 철자 및 속성 순서를 확인하십시오. 항상 높은 수준의 속성을 설정하십시오 (예 : 펄스 폭을 변경하기 전에 셔터 제어 및 셔터 속도를 올바른 설정으로 변경하십시오).

Serial Commands 
Digital cameras are controlled using either serial commands or control pulses. These methods use the same VIs or function calls. NI-IMAQ and your camera's camera file manage the serial commands and control pulses as required by your camera. The IMAQ 1422 and 1424 Series devices feature a UART chip designed for serial communication with digital cameras. The high-level commands called with the Camera Attribute functions allow you to set these properties without explicit knowledge of the low-level commands. The camera file also makes the use of serial commands and control pulses transparent.
직렬 명령
디지털 카메라는 직렬 명령 또는 제어 펄스를 사용하여 제어됩니다. 이 메소드는 동일한 VI 또는 함수 호출을 사용합니다. NI-IMAQ와 카메라의 카메라 파일은 카메라가 요구하는대로 직렬 명령과 제어 펄스를 관리합니다. IMAQ 1422 및 1424 시리즈 디바이스는 디지털 카메라와의 직렬 통신을 위해 설계된 UART 칩을 특징으로합니다. 카메라 속성 기능으로 호출 된 고급 명령을 사용하면 하위 수준의 명령에 대한 지식 없이도 이러한 속성을 설정할 수 있습니다. 카메라 파일은 또한 직렬 명령과 제어 펄스를 투명하게 사용합니다.

Control Pulses
Another method for controlling the camera is to send digital control pulses. Exposure time is a good example of an attribute that may be controlled with control signals. Some cameras may expect a rising edge before they open the shutter and the shutter stays open until the signal has a falling edge. As soon as the falling edge occurs, the shutter closes and the camera begins transferring the digital data to the image acquisition device. The length of the control pulse determines the shutter time, while the control pulse frequency determines the frame rate.
제어 펄스
카메라를 제어하는 ​​또 다른 방법은 디지털 제어 펄스를 보내는 것입니다. 노출 시간은 제어 신호로 제어 할 수있는 속성의 좋은 예입니다. 일부 카메라는 셔터를 열기 전에 상승 에지를 기대할 수 있으며 신호가 하강 에지에 도달 할 때까지 셔터는 열린 상태를 유지합니다. 하강 에지가 발생하면 셔터가 닫히고 카메라가 디지털 데이터를 이미지 수집 장치로 전송하기 시작합니다. 제어 펄스의 길이는 셔터 시간을 결정하는 반면, 제어 펄스 주파수는 프레임 속도를 결정합니다.

Note: You can set the shutter with serial commands, control pulses, or both. See your camera documentation for more information on which method your camera uses. 
참고 : 직렬 명령, 제어 펄스 또는 두 가지 모두로 셔터를 설정할 수 있습니다. 카메라가 사용하는 방법에 대한 자세한 내용은 카메라 설명서를 참조하십시오.

* Pixel Clock: 8bit(색의 종류에 따라 14bit 까지 가능?)로 이루어짐 하나의 픽셀을 나타낸다(역이서 1나의 픽셀은 한가지 색을 의미하는 것 같다)
3가지 색을 가진 Pixel 이라면 3개의 Pixel 클럭이 있어야 하나의 Pixel 을 나타낼 수 있다?
그러면 3Pixel 클럭이 가로 길이만큼 있으면 hsync, 가로 X 세로 만큼 있으면 vsync

Image Change
Some properties change how the image is formatted. These changes can cause timeout errors. For example, if you are expecting a 1000 x 1000 image, and you change an attribute that changes the image size to 500 x 500, NI-IMAQ will continue to look for a 1000 x 1000 image, resulting in the error message.
일부 속성은 이미지 서식을 변경합니다. 이러한 변경으로 인해 시간 초과 오류가 발생할 수 있습니다. 예를 들어, 1000 x 1000 이미지가 필요하고 이미지 크기를 500 x 500로 변경하는 속성을 변경하면 NI-IMAQ는 계속해서 1000 x 1000 이미지를 찾아 오류 메시지를 표시합니다.

A common example of an attribute that changes the images size is the binning attribute. Binning is a method of combining the charge of two consecutive pixels and returning a single pixel value with a greater charge, producing a smaller, brighter image. Since this attribute affects the image, make sure your window is reduced appropriately so that the reduced image size does not cause an error. While camera attribute functions send the serial command or control pulse and notify NI-IMAQ of the attribute change, you must still change the acquisition size.
이미지 크기를 변경하는 속성의 공통적 인 예는 binning 속성입니다. Binning은 두 개의 연속 픽셀의 전하를 결합하고 단일 픽셀 값을 더 큰 전하로 반환하여 더 작고 밝은 이미지를 생성하는 방법입니다. 이 속성은 이미지에 영향을 미치므로 축소 된 이미지 크기로 인해 오류가 발생하지 않도록 창을 적절하게 축소해야합니다. 카메라 속성 함수가 시리얼 명령 또는 제어 펄스를 전송하고 NI-IMAQ에 속성 변경을 알리는 동안, 여전히 획득 크기를 변경해야합니다.

Note: If the cable coming from the image acquisition device does not have the serial lines connected (often because the serial lines are housed in the power connector of the camera), change the window size to fit the image and then send the serial command using your operating system's COM port.
참고 : 이미지 수집 장치에서 나오는 케이블에 직렬 회선이 연결되어 있지 않은 경우 (종종 직렬 회선이 카메라의 전원 커넥터에 들어 있기 때문에) 이미지에 맞게 창 크기를 변경 한 후 다음을 사용하여 직렬 명령을 보냅니다. 운영 체제의 COM 포트

Camera Files
A camera file tells NI-IMAQ how the camera organizes the pixels, what attributes the camera supports and how to change them, either using serial commands or control pulses.
카메라 파일은 NI-IMAQ에 카메라가 픽셀을 구성하는 방법, 카메라가 지원하는 속성 및 변경 방법을 직렬 명령 또는 제어 펄스를 사용하여 알려줍니다.

Due to all the variations in digital cameras, such as how they format the data and the modes they support, NI-IMAQ requires a camera file to specify how the data is coming in and what serial commands and control pulses should be sent to the camera to change the mode or attributes of the acquisition. You can check the list of Compatible Digital Camera Files to see if there is a digital camera file available for your camera. If you do not see the camera listed here, the NI Camera File Generator can help you create your own custom camera files with an easy to use user interface.
NI-IMAQ는 데이터를 포맷하는 방법과 지원하는 모드와 같은 디지털 카메라의 모든 변형으로 인해 데이터 입력 방법과 카메라로 전송할 일련의 명령과 컨트롤 펄스를 지정하는 카메라 파일이 필요합니다 획득의 모드 또는 속성을 변경합니다. 호환되는 디지털 카메라 파일 목록을 확인하여 카메라에서 사용할 수있는 디지털 카메라 파일이 있는지 확인할 수 있습니다. 여기에 나열된 카메라가 보이지 않는다면 NI Camera File Generator를 사용하여 사용하기 쉬운 사용자 인터페이스로 사용자 정의 카메라 파일을 만들 수 있습니다.

See Also:
NI Camera File Generator

4. Signal Types

There are four types of digital signals used to send the image data to your image acquisition device.
이미지 수집 장치로 이미지 데이터를 전송하는 데 사용되는 네 가지 유형의 디지털 신호가 있습니다.

  • TTL is a single-ended, 0 to 5 V signal. It can travel only about 1 meter (6-8 feet) reliably. Due to the large voltage swing, the signal cannot maintain pixel clock frequencies above 20 MHz. TTL signals are not as common because of these limitations.
  • TTL은 단일 종단 형, 0 ~ 5V 신호입니다. 그것은 약 1 미터 (6-8 피트) 정도의 거리를 안정적으로 여행 할 수 있습니다. 전압 스윙이 크기 때문에 신호는 20MHz 이상의 픽셀 클럭 주파수를 유지할 수 없습니다. TTL 신호는 이러한 한계 때문에 흔하지 않습니다.
  • RS-422 is a differential signal that can travel about 6-8 meters (18-24 feet). It has the limitation of 20 MHz maximum for the pixel clock. This type of signal is typically used for digital cameras that do not require pixel clocks faster than 20 MHz.
  • RS-422는 약 6-8 미터 (18-24 피트)를 이동할 수있는 차동 신호입니다. 픽셀 클럭에는 최대 20 MHz의 한계가 있습니다. 이 유형의 신호는 일반적으로 20 MHz보다 빠른 픽셀 클럭을 필요로하지 않는 디지털 카메라에 사용됩니다.
  • LVDS (Low Voltage Differential Signal) is a differential signal with a lower voltage swing. The differential property allows for 6-8 meters (18-24 feet) of digital data integrity, and the lower voltage swing allows the signals to have greater than 20 MHz frequencies. Cameras that require faster pixel clocks use LVDS signals.
  • LVDS (Low Voltage Differential Signal)는 전압 스윙이 낮은 차동 신호입니다. 차동 특성은 6-8 미터 (18-24 피트)의 디지털 데이터 무결성을 허용하며, 낮은 전압 스윙은 신호가 20 MHz 이상의 주파수를 갖도록합니다. 더 빠른 픽셀 클럭을 필요로하는 카메라는 LVDS 신호를 사용합니다.
  • Camera Link is a new digital standard that sends back serialized data instead of parallel. All bits pass through a converter onboard the camera, which places all of the data on a single line. The device then sends this single line back through a converter to return the data to the camera. This standard allows for thinner cables and uses a standard connector. The Camera Link standard can support pixel clocks greater than 20 MHz and can travel up to 10 meters (30 feet). Camera Link's enable lines use the LVDS signal. Camera Link eliminates the burden of specialty cables, since the Camera Link cable is compatible with every Camera Link camera and image acquisition device.
  • Camera Link는 병렬 대신 직렬화 된 데이터를 다시 전송하는 새로운 디지털 표준입니다. 모든 비트는 카메라에 내장 된 변환기를 통과하여 모든 데이터를 한 줄에 배치합니다. 그런 다음 장치는이 단일 라인을 변환기를 통해 다시 전송하여 데이터를 카메라로 반환합니다. 이 표준은 더 얇은 케이블을 허용하고 표준 커넥터를 사용합니다. Camera Link 표준은 20 MHz 이상의 픽셀 클록을 지원하며 최대 10 미터 (30 피트)까지 이동할 수 있습니다. Camera Link의 인 에이블 라인은 LVDS 신호를 사용합니다. Camera Link 케이블은 모든 Camera Link 카메라 및 이미지 수집 장치와 호환되므로 Camera Link는 특수 케이블의 부담을 없애줍니다.

The table below lists the boards that support the four digital formats.

Note: The IMAQ 1424 and 1422 Series devices each have a RS-422 and LVDS version. 

댓글 없음:

댓글 쓰기