Design Article
Camera design for machine vision
Venkata Raghavan
Cypress Semiconductor Corporation
12/19/2008 2:00 AM EST
Machine vision, speaking generally, is an electro optical system (camera) connected to a processing unit such as a computer for image processing and to control a system. It is a system or computer that can "see" a target object. The system under control of machine vision could be production units, product quality control, pick and place machines, etc.
What is required for machine vision?
A machine vision system can be realized with an image sensor and lens system -- a camera -- connected to a computer through an electrical interface such as Firewire, USB, or Ethernet, with the computer connected to the control machinery.
Machine vision applications require a combination of hardware and software to ensure success:
- Camera
- Computer (Host)
- Frame grabber
- Application software
While choosing the right hardware is important, the visual inspection software forms the core of any machine vision system.
Sensors, generally driven by a pixel clock, will have a register set to configure the resolution, speed of operation, gain control, exposure time, and integration time by the user through an SPI or I2C interface. The sensor outputs Frame sync and line sync pulses along with the digital data to be processed.
The electrical interface from the sensor is CMOS for speeds up to 200 MHz. An LVDS interface is required for signal integrity at higher speeds.
Typical system architecture of the machine vision camera:

Figure 1: Elements of a machine vision system
Next: Off-line vs. on-line processing, applications, critical specifications, lenses and sensors
Camera with off-line processing
This configuration of the machine vision system works with a standalone camera using an industry standard electrical interface such as Firewire, USB, or GigE.

Figure 2: Camera with off-line processing
The camera is powered separately, and raw data is sent over the electrical interface to the host. The video transport can be continuous frames or could be one frame of data, based on the needs of the application. Single frame capture and video transfer are called triggered modes, with an external system sending an electrical pulse, typically at CMOS levels, to the camera system.
The camera logic will initiate one-frame integration and transfers the scanned data over the electrical interface to the host. In some cases, the raw data is transmitted over the bus with the sync signals, clock, and the data to the end-data acquisition system such as the frame grabber. The frame grabber stores the data in memory, which can then be accessed by the host application software for processing and control.
Electrical interfaces from the camera to the host include:
- Firewire IEEE 1394 Interface
- USB Interface
- GigE Vision interface defined by automated imaging association
- Composite analog video
- LVDS

Table 1: Electrical interfaces
Next: Online processing, accuracy, lenses, sensors
Camera with online processing
Recent development of DSP processors with adequate computational power for executing complex algorithms in real-time has made online processing possible. The camera houses the sensor and a DSP processor connected either gluelessly or with some glue logic.

Figure 3: Camera with online processing
The video scanned from the sensor is directly transferred to the DSP's memory by DMA and processed frame by frame. The end result or the control function is then initiated by the processor directly to the system to be controlled or to the host as a command.

Figure 4: Machine vision camera's for inspection: in the era of automation, in order to inspect multiple devices or products in parallel, robotic arms with multiple cameras are used. This type of configuration is popular in production tests for high throughput of operation.
The advantage of the video processing in the camera is that data processing can be done in real-time with no overhead for packet processing across Firewire, USB, or GigE interfaces. Byte-optimized assembly code can be utilized for faster and real-time processing using DSP processors running at clock frequencies over 300 MHz.
Real-time processing of the image algorithms is crucial for inspection applications where, for example, a device on a conveyer is moving at high speeds. Imaging of one frame needs to be computed and action taken before another image frame is transferred into the system.
Next: Critical specs, lens selection, sensor parameters
Critical specifications
For machine-vision systems, image quality is the major factor directly affecting final image processing results. Especially under natural lighting conditions, image quality varies significantly as the light source condition changes. Adjustment of camera settings, such as the "gain" and "exposure time", will compensate for unstable ambient illumination and improve image quality.
Depending upon the end application and the sensor proximity to the object scanned, the light source can be a separate unit or part of the camera head around the lenses. If the light source is around the camera head then the camera can be moved along with the light source. Commonly used light sources are Halogen bulb, fluorescent bulb, and light emitting diodes (LEDs).
Factors affecting image quality:
- Light intensity
- Light direction
- Object distance
- Focal length
- Sampling rate
- Exposure time and gain
- Dark leakage current
- Resolution (Number of pixels)
Lens selection and requirements
A good quality lens is as important as the quality of the sensor. A camera is an electro-optical system and hence optics and the electronics together form the image. Image blur is a common effect caused by bad lens selection.
The optimal lens size and the shape to use depend on focal length, but for smaller object distances "C" mount lenses are commonly used. If the camera needs to operate in an environment with high reflections, a lens with antireflection coating is preferred. Overall camera coverage is based on the field of view required, working distance, and the lens.
Next: Accuracy and end object resolution
Accuracy and end object resolution
Another critical parameter for lens design / selection is the end object resolution required in mm or mils (1/1000th of an inch).
When a camera is used for measurements of the object dimensions in production, several important parameters need to be considered:
- Field of view
- Sensor resolution (Number of pixels)
- Image quality
- Vision tool accuracy
Resolution: VGA to Megapixel arrays are commonly used based on the field of view and granularity of the image required for the end object scanned.

Figure 5: Machine vision guided system for inspection: device or product inspection requires automation for efficiency of operation and also throughput. One application for machine vision is based on inspection of products on a conveyor belt. This figure shows a robotic arm which can see with the help of industrial camera using high-frame rate of scanning.
Sensitivity
Monochrome or color: Most inspection applications can employ monochrome sensors generating grey levels. Typical applications are bar code readers, fingerprint scanners, dimension measurement for production devices, and so on.
Color devices are used when the color of the object has relevance for the quality or production control. An example would be grading and sorting peppers or apples. 24-bit color data from the sensor can capture 17.4 million different shades of color.
Next: Sensor parameters and selection
Sensor parameters and selection
For machine vision applications, the sensor and camera need to support multiple resolutions and frame rates. Implementing these as a programmable feature makes for a more versatile camera design across the various machine vision applications. Some of the generally supported features are:
- Windowing and resolution selection
- High Frame rate programmable by the user
- Standard electrical CMOS interface
- Low Sensor dark leakage current
- Wide dynamic range

Figure 6: Robotic head equipped with cameras. In this configuration, two cameras are axis-aligned for stereoscopic vision.
Applications:
- Guidance: systems in robotics pick-and-place machines
- Inspection: Texture, surface, label, assembly
- Measurements: Production parts physical dimensions, assembly parts dimensions
- Identification: pick and place machines, Robotics, read characters, read codes
Cypress Semiconductor provides image sensors with high-frame rate and user-selectable parameters while supporting industrial temperature grades, making them ideally suited for machine vision camera design. Frame rates range from 30 F/sec to 500 f/sec within the IBIS and LUPA families of sensors.
About the author
Venkata Raghavan is the Product Applications Manager with Cypress Semiconductor, India. With 15 years of industry experience, Venkata has worked for Indian space research organizations as well as within the Telecommunications Industry. He has a Bachelor of Engineering in Electronics and Telecommunications. He can be reached at vds@cypress.com.



