Article sections
How does a camera image reach the application?Are GenICam, GenApi, and GenTL the same thing?How is the raw data rate calculated?Which problems suit area-scan and line-scan cameras?The sequence of trigger, exposure, and frame-ready eventsWhy does the SDK buffer lifecycle matter?How do you distinguish frame loss from a late decision?Why should we be careful with different timestamp types?Where do bottlenecks occur in multi-camera systems?Format conversions and pixel integritySafe recovery after losing the camera connectionWhat data should be collected during site acceptance testing?What problems do jumbo frames, packet size, and NIC settings solve?How do bit depth and pixel format change capacity?Hardware trigger or software trigger?How should the buffer count be determined?Which counters are needed to analyze packet loss?What should on-site documentation contain?What checks can be performed on the first 100 frames from a camera?Why are measurements misleading without aligning hardware clocks?Calculating the line rate for line-scanChanging camera settings during productionCPU core distribution for multi-camera dataAn example root-cause investigation for data lossTwo different calculations for 12-bit image transferHow do we prove that two cameras see the same product?A camera troubleshooting sequence for the maintenance teamFrequently asked questionsHow does a camera image reach the application?
With an industrial camera, saying "I captured a frame" assumes that several separate operations have completed. The sensor converts light into an electrical signal; the analog-to-digital converter produces raw data, the camera packs it into a pixel format, transfers it to the computer over a physical interface, and the driver/SDK places it in appropriate memory. The application takes this buffer and proceeds with preprocessing or model execution. If even one stage in this chain fails, the image may be incomplete, late, or misinterpreted.
In most applications, the problem is less about the camera brand than a lack of clarity in the data and timing contract. Is the image arriving as an 8-bit representation of a 12-bit sensor output? Does the camera assign the frame ID? For how many milliseconds does the SDK give the application ownership of the buffer? Is the trigger initiated through hardware or a software command? Testing model accuracy before resolving these questions can be misleading.
Are GenICam, GenApi, and GenTL the same thing?
No. GenICam is a family of standards intended to make it easier to access camera features from different manufacturers in a common way. GenApi enables device features to be described in an interface-accessible form; SFNC provides common feature names. GenTL provides common interfaces for the image transport layer. These help standardize the application's image acquisition logic, but they do not guarantee that all differences disappear across every camera and driver.
GigE Vision and USB3 Vision are different interface standards related to transporting image data. GigE Vision benefits from Ethernet infrastructure, while USB3 Vision provides a direct high-speed USB connection on compatible devices. In actual use, cable length, bandwidth, power, packet loss, driver quality, and device compatibility must also be examined. "GenICam-compatible" does not mean that all devices have the same FPS or triggering behavior.
Typical operations in manufacturer SDKs include device discovery, querying features, opening a stream, allocating buffers, listening for frame-completion events, and releasing resources. The application may need to manage timeout and reconnection behavior around this flow itself. Buffer ownership and callback restrictions in the SDK documentation must be read carefully.
How is the raw data rate calculated?
The theoretical data volume of an uncompressed stream can be calculated as image width × height × bits per pixel × FPS / 8. For example, 1920 × 1200 pixels, 8-bit mono, at 60 FPS produces approximately 138.24 MB/s of raw data. This figure excludes Ethernet/USB packet headers, retransmission, inter-packet gaps, and other data transport overhead.
A gigabit Ethernet link has a physical bit rate of 1 Gb/s, mathematically equivalent to 125 MB/s. The amount available to the application is lower. Consequently, the example's raw load of 138.24 MB/s does not fit over a single 1 GbE connection. Changing packet size does not remove the physical limit; resolution, FPS, pixel format, the connection, or the use of multiple interfaces must be reconsidered.
The maximum FPS stated by camera manufacturers may depend on settings such as the selected ROI and pixel format. For a 10- or 12-bit camera, the transport format does not always mean tightly packed 10/12-bit data; some formats use 16-bit words. The theoretical calculation should therefore be compared with the actual payload size reported by the SDK. In multi-camera use, the total load on NICs, switches, and memory must also be included.
Which problems suit area-scan and line-scan cameras?
An area-scan camera produces a two-dimensional frame from a single trigger. It is common for individually arriving parts, assembly inspection, and products that pause on a conveyor. A line-scan camera acquires one or a few lines per measurement; as the product or camera moves, these lines are combined into a large image. Line-scan can offer significant advantages in applications such as continuous metal strip, fabric, film, and roll printing.
In line-scan, the line rate must match conveyor speed and the target longitudinal resolution. For example, a surface moving at 1 m/s with a desired longitudinal pixel pitch of 0.1 mm requires at least approximately 10,000 lines/s. This is only a geometric rate calculation; light levels, camera capacity, and data transfer speed must also be suitable. Encoder triggering can make it easier to maintain constant line spacing as speed changes.
There is no hierarchy in which area-scan is "easy" and line-scan is "advanced." The right choice depends on product motion and the information needed. Choosing an apparently suitable area-scan solution initially and then trying to turn the image into a huge panorama can sometimes conceal a need for line-scan.
The sequence of trigger, exposure, and frame-ready events
When an external photoelectric sensor detects a part, it can send a trigger signal to the PLC or camera input. The camera begins exposure after a certain delay from this signal; once exposure is complete, the image is read out and transferred. The application can begin processing when it learns that the buffer is ready. Each of these stages is a separate point in time.
Trigger time and the time the image reaches the application are not the same. On a moving line, this difference changes the product's physical position. In addition, sensors using a rolling shutter may expose different lines at different times, whereas a global shutter captures the image area more simultaneously. Distortion of a moving image must be evaluated alongside optics and exposure calculations.
If a multi-camera system needs simultaneous frame acquisition, a common trigger, hardware inputs, and, on some devices, PTP-based clock synchronization can be used. Having PTP does not automatically mean that all cameras have the same exposure timing. Camera trigger and exposure behavior must be measured separately.
Why does the SDK buffer lifecycle matter?
Camera SDKs may use a preallocated buffer pool for performance. When a frame arrives, the SDK provides the application with a reference to one of these buffers. The application must process the image or copy it into its own memory while it still owns the buffer. If a new image overwrites a buffer released too early, the model may see unstable, truncated, or another product's data. This error does not always crash the program.
Zero-copy is not an acceleration feature automatically used on every device; it is an approach to reducing unnecessary copies when the memory infrastructure allows it. If memory ownership is not tracked correctly, data integrity may be lost in pursuit of speed. Increasing the buffer count can accommodate short bursts, but if the application consumes frames more slowly than the camera produces them over the long term, the latency problem remains.
Is it appropriate to do heavy processing inside a callback?
Performing heavy operations such as GPU inference, disk writes, or network requests directly inside the SDK's frame-completion callback can reduce the driver's ability to receive new frames. A better arrangement has the callback hand off the image safely and performs heavy processing in a separate, controlled queue. However, this new queue must also be bounded and observable.
How do you distinguish frame loss from a late decision?
Observing "camera at 60 FPS, system at 55 FPS" does not directly mean that five frames have been lost. Frames may still be queued; results may be delayed; the camera may have rejected some triggers; or network packets may be missing. To distinguish these cases, monitor the camera frame counter, SDK completion/incomplete-frame information, the application's job queue, and PLC decision records together.
If the frame counter shows gaps, investigate the camera/transport layer first. If all frames have arrived but processing finishes late, the problem may be in the application or GPU. The system's production decision behavior when an image is lost must be explicitly defined. Silently skipping a missing frame can mean accepting an unassessed product as non-defective in a mandatory quality inspection.
Why should we be careful with different timestamp types?
A camera may generate timestamps from its sensor or transport layer. The operating system may record its own clock time when the image is delivered. The PLC may track the trigger event using a different clock. There is no guarantee that these three times share a reference. If the clocks are not synchronized, calculating the difference between two events can produce spurious latency or a negative duration.
Where possible, use start and end points within a single time domain for measurement; when comparing clocks on different devices, verify time mapping and synchronization. PTP can provide a common time base on cameras/network devices that support it; the clock profile and hardware timestamp used must be documented.
Where do bottlenecks occur in multi-camera systems?
A 2448 × 2048, 8-bit mono camera at 30 FPS produces approximately 150.4 MB/s of raw data. Four identical cameras produce approximately 601.6 MB/s of raw traffic; this is 4.81 Gb/s, excluding protocol overhead. The NIC, switch, CPU memory bandwidth, disk, and GPU transfers must be considered together. Connecting each camera through a separate port reduces some bottlenecks but does not eliminate the total memory-copying load.
As camera count grows, unexpected limits can emerge in shared CPU cores, PCIe lanes, NIC interrupt handling, and storage. Testing individual cameras initially at low load does not show that the entire system will remain stable under simultaneous load. In particular, extended tests should cover thermal conditions and bursts close to production pace.
Format conversions and pixel integrity
Obtaining RGB from a Bayer sensor, converting Mono12 for a viewer, or ignoring row-stride information can change the meaning of the image. The pixel format from the camera SDK must be read explicitly; the color order, bit scaling, and normalization used during model training must be reproduced in production. A color conversion that looks visually plausible can systematically change the model's confidence scores.
In particular, interpreting Mono12Packed in the same way as Mono12 stored in 16-bit words can produce incorrect pixels. The actual bytes per row in an image buffer may differ from the assumption of image width × channel count. Stride and padding must therefore be handled according to the SDK contract.
Safe recovery after losing the camera connection
When a device disconnects, it may be necessary to close the SDK session, rediscover the device, reallocate buffers, and verify camera settings. However, a camera reconnecting does not mean previous captures can be assumed to belong to the current product. The status of products passing during the disconnection must be handled explicitly; the trigger counter and product matching must be checked before the system is put back into operation.
Camera parameters automatically reverting to defaults is a separate risk. Exposure, gain, pixel format, ROI, trigger mode, and network settings should be read at application startup and compared with the versioned configuration. The policy for automatic correction or operator approval when a difference is found must be defined in advance.
What data should be collected during site acceptance testing?
At a minimum, record image count, expected trigger count, completed frames, missing packets, buffer overflows, latency percentiles, product match rate, and camera reconnection time. Testing must take place under actual lighting, vibration, and peak product rates, not just for a few minutes on an empty line. Events such as line start/stop cycles and intermittent cable connections must also be addressed separately.
"Images are arriving" cannot be a camera acceptance criterion. Conditions such as "no product will remain unrecorded after 10,000 triggers," "camera settings will be verified after reconnection," and "the system will report a lost frame using a distinct error code" are much more meaningful for production.
What problems do jumbo frames, packet size, and NIC settings solve?
In systems using GigE Vision, image data from the camera travels in packets. Larger packets can reduce per-packet CPU and protocol overhead on some networks; however, connection failures may occur if the camera, NIC, switch, and other intermediate devices do not support the same capabilities. Jumbo frame settings are therefore not an arbitrary "speed boost button." The MTU, camera packet size, and maximum frame size accepted by intermediate devices must be considered together.
Increasing packet size does not raise the physical network's 1 Gb/s limit. For example, 138.24 MB/s of raw data exceeds 1 GbE's mathematical limit of approximately 125 MB/s; jumbo frames cannot bridge this fundamental shortfall. Larger packets can reduce protocol overhead in a compatible environment, but the actual capacity of the camera stream must still be measured.
During testing, record incomplete-frame and retransmission counts, CPU usage, and the effects of other network traffic. If one camera works correctly on an otherwise idle network but problems appear when a second camera is enabled on the same switch, investigate total bandwidth and buffer capacity.
How do bit depth and pixel format change capacity?
Formats such as Mono8, Mono12Packed, BayerRG8, and RGB8 produce different data sizes at the same image resolution. A 1920×1200 RGB8 frame occupies approximately 6.91 MB of raw space, compared with approximately 2.30 MB for Mono8. At 60 FPS, this makes a very large difference. However, discarding color information solely to reduce data size can impair defect visibility in the application.
Converting a Bayer image to RGB requires demosaicing. It is important to understand whether the camera SDK performs this conversion on the CPU or in hardware. A system trained with RGB but accidentally fed BGR in production can produce unexpected quality errors despite apparently plausible images. Changing the input format also requires model regression testing.
There are also cases where 12-bit sensor data is transported in a 16-bit container. In that case, calculations must use the actual transferred payload size rather than 12 bits. The packing format, row stride, and padding fields must be read from the SDK.
Hardware trigger or software trigger?
Software triggering can be flexible for simple experiments but may have variable latency due to operating-system and network scheduling. A photoelectric sensor or PLC signal connected to a hardware input can provide more repeatable timing. Nevertheless, the camera's internal trigger delay, strobe timing, and exposure duration must be measured separately; an external trigger does not mean absolutely zero latency.
If conveyor speed varies, acquiring frames at fixed time intervals changes the physical sampling interval. Encoder-based triggering or motion-related timing can reduce this problem. However, physical errors such as encoder resolution limits, gear backlash, and product slippage may remain. Camera timing reliability depends not only on software parameters but also on the repeatability of the mechanical design.
If two cameras must capture the same product, each camera's trigger-acceptance and frame-completion events must be matched. Simply writing the same computer time to two frames does not prove physical simultaneity. This is why in-camera timestamps and, where needed, a PTP setup matter.
How should the buffer count be determined?
The minimum buffer count is selected according to camera driver requirements and variations in application processing. If the camera produces 100 frames per second and, in the worst case, the application cannot consume new images for 80 ms, approximately eight frames can accumulate during that interval. Still, eight buffers are not "definitely enough"; transfer, callback latency, simultaneous cameras, and an additional margin must be considered.
The latency target must not be forgotten when increasing buffer capacity. At 100 FPS, a twenty-frame queue can create hundreds of milliseconds of waiting in the worst case. If the total window for a rejection decision is 150 ms, waiting in the buffer is itself a failure. Buffer size is therefore determined by both the memory budget and the validity window.
The application must safely release the buffer when processing ends and avoid leaks even on errors or exceptions. Old pointers must not be used after a connection is lost and re-established. Often these lifecycle errors do not appear with synthetic test images; an extended run with the actual camera SDK is required.
Which counters are needed to analyze packet loss?
An ideal observability set keeps separate counts for expected triggers, triggers accepted by the camera, captured frames, completed transfers, incomplete frames, frames delivered to the application, and product decisions. These numbers are reported together against production pace. If 9,998 transfers complete for 10,000 triggers, the quality status of two products may be explicitly unknown. Filling in these gaps with old frames or empty data is not appropriate.
Network devices' CRC error counters, packet resend counters, and NIC drop information are valuable, but the names may differ between manufacturers. Isolated testing with one camera, replacing the switch, and retesting under load can help determine whether lost packets originate in the camera or network. A problem quietly disappearing does not mean it will not recur.
What should on-site documentation contain?
Documenting the camera model is not enough. Firmware, SDK/GenTL version, pixel format, ROI, shutter, trigger mode, exposure, gain, MTU, NIC and connection port, buffer count, time synchronization method, and product ID matching rule must be versioned. This document must be updated whenever a device changes.
The camera replacement procedure for maintenance must be explicit: remove the old device, discover the new device, load the calibration profile, verify timestamps, acquire a test image, and compare model behavior against reference defect samples. Replacing hardware is a change that affects quality decisions; merely seeing an image on the screen is not enough for acceptance.
What checks can be performed on the first 100 frames from a camera?
When a new device is connected, the first 100 frames should not be used solely to verify that an image appears. Pixel format, resolution, payload size, frame counter, and timestamp can be checked for each frame. Gaps in expected sequence numbers suggest trigger loss or a transfer problem. Light levels and the histogram should also remain consistent in a static image; if automatic exposure or gain has been left enabled, defect visibility may change.
A longer load test follows the initial short test. The camera's maximum FPS may not be suitable for continuous operation; incomplete-frame counts can increase when network traffic or disk writes are added. Initial acceptance for one camera therefore does not replace multi-camera and peak-line-speed testing.
Why are measurements misleading without aligning hardware clocks?
A camera's timestamp counter may be based on its own clock starting at 0, while the PC's date is based on the system clock. Directly subtracting these values produces a meaningless duration. Duration calculations can even jump when the PC clock is adjusted backward or forward by NTP. Elapsed times within one device require a monotonic clock; measurements across devices require a synchronized time reference and conversion.
Protocols such as PTP can help devices align to a common time, but they do not eliminate the delay between triggering and exposure or the time the application takes to receive a buffer. If images from multiple cameras must show the same physical event, actual simultaneity must be tested using a test object.
Calculating the line rate for line-scan
For example, if a conveyor moves at 1.2 m/s and the desired resolution in the direction of motion is 0.08 mm/pixel, the theoretical line rate is 1200/0.08 = 15,000 lines/s. The camera and lighting must be capable of operating above this rate. However, if the sensor's exposure time is not short enough relative to the surface motion, blur can occur throughout the line-scan image.
Because line-scan combines many lines into a long image, encoder loss or incorrect speed sampling can distort geometric measurements. It is therefore necessary not just to select the line rate but also to measure motion and verify the image's physical length. Encoder calibration becomes important when measuring scratch length on a roll or strip.
Changing camera settings during production
Some cameras allow settings such as exposure, gain, or ROI to be changed while streaming. However, these changes can affect the appearance of new frames, payload size, and model input. Live setting changes must therefore be authorized, and the frame from which they take effect must be recorded. A separate validity policy may be needed for products passing during the setting change.
For example, a shorter exposure can reduce motion blur but darken the image. Increasing gain can brighten the image while also increasing sensor noise. The result can affect the system's model decision. A setting change should not be deployed to production before its effects on image quality and defect detection performance have been verified.
CPU core distribution for multi-camera data
If all callbacks from four cameras concentrate on one CPU core, packet delivery can be delayed. CPU preprocessing, disk writes, and PLC communication can also create load at the same time. It is therefore useful to examine processor utilization by core and process, not just as an overall percentage. NIC interrupt distribution, driver options, and application thread count can affect performance.
Having camera data on separate ports does not automatically reduce the aggregate CPU load. Buffer occupancy, scheduler latency, and NIC counters should be monitored together when analyzing problems. Increasing thread count does not guarantee faster results either; excessive concurrency can increase lock contention and context-switching costs.
An example root-cause investigation for data loss
Suppose 15 missing images are observed in 20,000 triggers. First, extract the times of the loss events, product speeds, and camera frame-counter records. If all coincide with a busy period when four cameras are operating together, examine total bandwidth and the queue. If camera counters show gaps for some missing frames while application processing time increases for others, there may be two separate problems.
Next, check variables one at a time: a different NIC, lower FPS, temporarily disabling disk recording, a larger buffer, and a different packet setting. Record the loss count and p99 latency for every experiment. Making many random adjustments at once and seeing the problem disappear does not explain the actual root cause; controlled comparisons are needed to prevent recurrence in production.
Two different calculations for 12-bit image transfer
At 2048×2048 resolution, a Mono12 image carries approximately 6.29 MB of raw data per frame if it is truly packed into 12 bits per pixel. If the same pixel is stored in a 16-bit container, the frame is approximately 8.39 MB. At 30 FPS, these approaches require approximately 188.7 MB/s and 251.7 MB/s respectively. Thus, "the sensor is 12-bit" alone does not determine the number of bytes transported. The actual pixel format and payload size must be read from the SDK.
This difference matters when selecting a camera: instead of solving a connection problem solely by lowering FPS, packed formats or a faster interface can be considered. However, format conversion can increase CPU cost; transport benefits alone should not determine the choice. How the target model uses bit depth and its quantization range must also be verified.
How do we prove that two cameras see the same product?
Two cameras may receive the same trigger signal while one uses a shorter exposure and the other a longer readout. FIFO order is misleading when images are delivered to the software at different times. A common product identity, trigger counters, and, where possible, camera-generated timestamps should be evaluated together. PTP can provide a shared clock reference, but internal camera delays must be measured separately.
Moving a test object in a controlled way allows observation of how closely two cameras capture the same physical instant. Particularly in multi-angle measurement, a difference of a few milliseconds can make the product appear in different positions. Results must be compared with production tolerances.
A camera troubleshooting sequence for the maintenance team
If no image is available, first verify the camera's physical connection, power, device discovery, and trigger mode. If an image is present but incomplete, examine the frame counter, NIC drops, and buffer overflows. If the image is complete but model performance has deteriorated, compare pixel format, exposure, gain, ROI, and color order. This systematically separates model problems from camera/optics problems.
After a device reconnects, the entire configuration must not be assumed to have automatically remained unchanged. The system can be prevented from entering the Ready state until calibration and reference-image testing have been performed.
Frequently asked questions
Does using GenICam eliminate the need for a camera SDK?
GenICam provides common interfaces, but manufacturer-specific transport-layer, driver, or SDK components may still be needed. Compatibility with the actual camera and operating system must be verified.
Can a 1 GbE camera send 138 MB/s?
Uncompressed 138 MB/s over one connection exceeds 1 GbE's theoretical physical limit of 125 MB/s. Protocol overhead adds further demand, so another data transfer solution is required.
Does using many buffers eliminate frame loss?
It can only tolerate short-term rate fluctuations. If the average input rate exceeds output capacity, the buffer eventually fills up.
Does PTP solve every synchronization problem?
No. It can provide a common clock, but trigger delay, exposure start, encoder timing, and application message timing must be tested separately.
Interactive tool: camera bandwidth
Ideal uncompressed payload calculation. For example, enter 12 for a packed 12-bit format, 16 for a 16-bit container, or 24 for RGB8. Row padding, packet headers, and other network traffic are excluded.
Technical sources and verification
Manufacturers' and standards organizations' documentation was used as the basis for standards and runtime details of the methods. Unless explicitly stated otherwise, all example numbers are for educational purposes.
Visual note: The nine technical diagrams are original, and numerical examples are for educational purposes. The illustrations are not actual device benchmarks, facility measurements, or factory acceptance tests.