zuruck zur Themenseite

Articles and background information on the topic

Image processing under Windows

Bernhard Hartmann | Inka Krischke,

The challenge of real time

Image processing in real time under Windows - this topic is becoming increasingly important in view of the targeted growth rates in the use of image processing systems in automation. However, the associated requirements are considerable.

© Matrox, Microsoft, Messe Stuttgart

Most users are aware that there are problems with conventional image processing in conjunction with real-time under Windows and the ever faster and more efficient machines, and some have already experienced this themselves. Using an imaginary example, various solutions and avoidance strategies are discussed below.

Delayed image acquisition

Currently available image processing systems - such as Halcon, Matrox Imaging Library (MIL for short) or VisionPro - preferably run under Windows. As all Windows users know, this operating system was developed for desktop applications. This results in delays or latency times of up to 500 ms due to the Windows scheduler, which determines the current order in which tasks are processed. Every user is familiar with the behavior where the mouse does not react for a short time and 'virtually' stands still before suddenly moving somewhere uncoordinated. This uninfluenceable behavior can lead to delays during image acquisition - i.e. the transport of image data to the memory via GigE Vision, for example. If the machine control or the process is dependent on an image being available at an exact time, this can lead to an unacceptable time difference, which can result in a machine standstill.

For example, when opening a can of peanuts, everyone expects it to contain only edible nuts. However, it happens time and again that you bite into peanuts that taste strange (= bad). This can be recognized by their color, as the bad nuts are usually much darker. Sorting could be done by dropping the peanuts over a defined distance with simultaneous image recording and evaluation. Of course, no image must be lost, an inedible nut must be reliably detected and removed by blowing it out within a defined period of time. However, if this image is taken too late due to latency times, the nut has already fallen too far for it to be removed.

Advertisement

Complex image algorithms

The algorithms for shape or color recognition are normally applied to every image read into the Windows memory. These image processing algorithms can be very complex and may require different calculation times. This can occur, for example, with iterations (functions whose number of passes cannot be predicted exactly). If these take too long, termination mechanisms can be defined. Every algorithm running under Windows control can be interrupted or delayed during processing. As a result, the result of the calculation may not be available at the required time, which in turn can lead to a malfunction of the machine.

Again, the peanut example: Ideally, the image acquisition should always take place at the correct time without interruption and no image should be lost. The machine requires a signal at a defined and precisely adhered to time (= deterministic) with which the blow-out valve can be controlled to remove the 'defective' peanut. If this signal arrives too late or not at all due to the non-definable latency times of Windows, the valve may be opened and a good peanut removed. In the meantime, the 'faulty' peanut has already fallen a few centimetres further due to the delay or has already arrived in the delivery box.

What remedies or strategies are now available to deal with this dilemma?

The frame grabber strategy

A common solution is frame grabbers, on which not only the image acquisition but also the complete calculation can be carried out directly. In this case, the algorithms must be created in advance as a VHDL program, compiled with the appropriate VHDL compiler - which can take up to a day per compilation process - and then tested. This means a great deal of effort and additional development time. Without programming, such frame grabbers cost several hundred euros each - without including the required interface (GigE, CameraLink or CoaXPress) or the camera. Whether this can be a solution with regard to self-configuring and autonomous machines under Industry 4.0 remains to be seen.

PCI card developed in-house

Another strategy is the complete in-house development of a PCI plug-in card based on a DSP or an FPGA. This means that image capture and all real-time processing takes place on the plug-in card and therefore runs separately from Windows. However, the interface must be programmed and the real-time processing must be developed and tested. In addition, an operating system is required for the DSP or for the FPGA, which may need to be adapted. The image processing algorithms must also be adapted to the chip used.

It is also unavoidable to develop your own hardware with the associated circuit board developments, error iterations and test scenarios. And last but not least, there is the need for stock-keeping for service and breakdowns. The possible discontinuation of a component - in the worst case the central, active component - and the fact that the board is only designed for a limited performance, with the result that a new board has to be developed if more performance is required, are also problematic.

The image processing PC

From these two challenges, 'resourceful minds' devised a strategy that at first glance appears to solve the problem, but on closer inspection turns out to be a sham: the solution is a dedicated PC for image processing only. Nobody is allowed to move anything on this PC, for example the mouse. In this environment, there are also systems in which various Windows services have been deactivated in order to avoid any disruption to the image processing system. However, this can lead to an unstable Windows. And even with a stand-alone PC just for image processing, the tape may stop several times a day for reasons that are not clear. However, in the absence of cost-effective alternatives, this strategy is a common scenario in today's automation world.

In order to get all Windows latency times under control, it would be necessary for image acquisition and image processing to run independently of Windows. Depending on the camera interface used, image acquisition would have to run as an independent process on a separate core to which Windows has no access. In this case, the image transmitted by the camera or the associated image data would not be stored in the Windows memory, but in a separate memory that is independent of Windows.

If the image algorithms could also be applied to the image data independently of Windows, it would be possible to implement a complete machine, including the controller and fieldbus connections, on a PC using modern multi-core processors.

Real-time processing under Windows

Screenshot of a demo application consisting of a camera with 1k × 1k pixels with 8-bit depth, which sent the images to the PC via a double camera link cable and the Radient-CL frame grabber at 335 fps.

© Intervalzero

One such solution for complete real-time image processing is available from Intervalzero: it consists of a PC, a Radient-CL class cameralink frame grabber from Matrox with the associated RTX64 driver and the porting of the entire MIL algorithms to the RTX64 subsystem. This subsystem can be installed subsequently to Windows and is ready for use after a short configuration. It functions as a 'Symmetric Multi Processing' (SMP) extension and transforms Windows into an RTOS. At the same time, it ensures the independent use of existing cores for real-time applications; one core always remains reserved for Windows.

No image was lost with an RTX64 subsystem. It is also possible to integrate a real-time capable master stack and a self-programmed sequence controller on the PC in order to be prepared for future requirements.

© Intervalzero

All mechanisms such as mutex or semaphore that a software developer expects from an RTOS are available. In addition, the development environment - Microsoft VisualStudio - allows you to implement your own algorithms under standard C/C++. Depending on the interface required, only software components are used, which reduces costs. Instead of the costs for the frame grabber, the self-developed plug-in card or a separate PC, only the license costs for the linearly scaling RTX64 subsystem are incurred. A PC with Windows or the MIL library is required in any case, or both are often already available.

With reference to the example of the peanut sorting machine, image acquisition in this approach takes place under the control of RTX64. This means that the images are written to the memory managed by RTX64 without any interaction from Windows. Since the MIL algorithms run on a second core of the 4-core system and can be applied to the image immediately after image acquisition, the machine could easily sort out the bad peanuts during the falling phase.

Author: Bernhard Hartmann is Sales Manager for Central Europe at Intervalzero in Munich.

  • Xing Icon
  • LinkedIn Icon
Advertisement
Back to topic page
Advertisement

You might also be interested in

Advertisement

TSN and OPC UA

The deterministic IIoT

Network and real-time specialist TTTech is working flat out to further optimize its TSN solution for broad rollout - and link it to its growing IIoT platform. An interview with Georg Kroiss, Business Development Manager Industrial.

read more...

Panel PCs

For a wide range of applications

As operating stations, panel PCs are right at the heart of the production process. Depending on the industry, the devices must therefore meet certain minimum requirements - for example with regard to protection class, hygiene and glove operation.

read more...

Cybersecurity

When botnets attack

The fact that IoT systems are very easy to attack has not only been proven by countless live hacks, but also by real botnet attacks. Service access points are proving to be a serious weak point.

read more...
Advertisement
Advertisement
Advertisement

Computer-on-Modules

Real-time for Fog Server

In the age of Industry 4.0, real-time communication between machines and systems and their supply and removal systems is required. Virtualized fog servers in a redundant design are predestined for this. Computer-on-Modules with 10 GbE real-time...

read more...

Flash memory

Robust in production

Flash modules score points for space savings and stability compared to mechanical hard disks. But is data really safe in the event of power failure, vibration and temperature fluctuations?

read more...
Advertisement
Advertisement
Advertisement

AllJoyn

The IIoT alternative

AllJoyn is an open source IoT initiative aimed at the consumer electronics market. The aim is for devices and systems to recognize and interact with each other independently. The first AllJoyn connections for CAN-based products also make the...

read more...

Controls

Controller for the IIOT

National Instruments is now presenting a family of industrial controllers that are predestined for use on 'smart machines' and in intelligent systems for the Industrial Internet of Things. Rahman Jamal, Global Technology & Marketing Director,...

read more...

Rasperry Pi

The new role of single-board computers

The Raspberry Pi was originally developed to get children interested in programming and spark their interest in a job in the electronics industry. But its success has also sparked the creativity of professional engineers, who use the Pi to bring...

read more...
Subscribe to our newsletter
Advertisement
Back to home