Real-time industrial image detection based on PC104
2026-04-06 07:28:21··#1
Abstract: With the development of image processing software and hardware, image processing technology is increasingly being applied to industrial sites. This paper fully utilizes the optimized, small, and stacked structure of the embedded industrial computer PC104, combining it with image processing technology to digitally process the detection images captured in the industrial field, obtain the image feature values of the target to be monitored, and issue corresponding control commands based on the results to complete the industrial automatic control process. This paper discusses the feasibility of real-time industrial image detection based on PC104 from the perspectives of hardware composition and software implementation. Keywords: PC104; Image processing; Serial port LCD Introduction Applying images to industry is of great practical value. Image acquisition is usually non-destructive and safe. It is also a labor-saving and inexpensive process. The combination of computers and image processing is also developing rapidly. Since the 1960s, people have wanted to use the principles of computer vision to construct useful computer systems, but due to various factors, it has been difficult to achieve. With the development of technology, the price of computers and image systems has become very cheap, meaning that research is feasible. In modern large-scale production, visual inspection is often an indispensable link. For example, the appearance of automotive parts, the correctness of pharmaceutical packaging, the quality of IC character printing, and the quality of circuit board soldering all require numerous inspection workers to observe and inspect with the naked eye or a microscope. A large number of manual inspectors not only affects factory efficiency but also introduces unreliable factors, directly impacting product quality and cost. Furthermore, many inspection processes require more than just visual inspection; they also demand accurate data acquisition, such as the width of parts, the diameter of holes, and the coordinates of reference points—tasks that are difficult to perform quickly by the human eye. Meanwhile, PC-compatible single-board computers have further developed due to hardware leverage—namely, compatibility with PC chips reduces costs and provides simpler and easier system support—and software leverage—allowing them to fully utilize PC operating systems, languages, and software tools. The main differences between PC104 and ordinary PC bus control systems are: 1. Small size structure: The mechanical size of the standard module is 3.6 x 3.8 inches, or 96 x 90 mm. 2. Stacked connection: The bus is connected in a stacked manner in the form of "pins" and "holes". The connection between PC104 bus modules is that the upper layer pins and the lower layer wiring holes are interlocked. This stacked packaging has excellent shock resistance. 3. Easy bus drive: Reduces the number of components and power consumption. A 4mA bus drive is sufficient for the module to work normally, and each module consumes 1-2 watts of power. 1 System Composition 1.1 System Hardware Composition The system is based on the embedded industrial computer PC/104. Infrared proximity switches detect whether a workpiece enters the detection range. When a workpiece enters the measurement range, the USB interface camera is activated to capture the detection image and convert it into a digital signal. After software processing, the corresponding processing results are recorded and displayed on the LCD. When a workpiece that does not meet the conditions is encountered, the control process switch detects the workpiece. See Figure 1 for the system block diagram. [align=center]Figure 1 System Block Diagram[/align] 1.2 System Hardware Description After the workpiece on the industrial production line undergoes mechanical position adjustment, when the workpiece triggers an infrared proximity switch, the USB interface camera captures the workpiece image, which is then input into the computer as a digital signal for further image processing. The image feature values of the target to be monitored are obtained, and corresponding control commands are issued based on the results to complete the industrial automatic control process. The processing results can be displayed via a serial port LCD module, or stored in a large-capacity storage unit expanded via a CF card interface and transmitted to the host computer via an RJ45 Ethernet interface. Embedded Industrial Computer PC/104: The embedded industrial computer uses STMicroelectronics' embedded CPU STPC Atlas, an enhanced 486 DX/DX2 CPU. When operating in DX2 mode, its operating frequency can reach 133MHz. Atlas integrates a 2D graphics controller and a memory controller, and can directly expand LCD/CRT interfaces and 100MHz SDRAM, with a maximum capacity supporting 64Mbytes. The board also integrates a 10/100Mbps network interface, DOC interface, EIDE, two USB ports, a universal serial port, a parallel port, and a PC/104 interface. It is a high-performance, compact embedded control module. A 5V regulated power supply powers the entire system; alternatively, 220V AC can be used after a transformer and output by a 7805 or other three-terminal voltage regulator. A 3.3V lithium battery powers the RTC, maintaining the calendar clock. A CF card interface is used for large-capacity data storage and exchange. A serial LCD module: The PC104 has 3-wire and 9-wire serial ports, which can connect to MAX211, MAX232, MAX485, and other level conversion chips for serial communication. An extended serial communication LCD can display characters, graphics, curves, etc., via an RS232 serial port. Includes 12*12, 16*16, and 24*24 dot matrix fonts. Communication speeds are selectable: 1200/2400/9600/19200/38400/57600/115200 bps, software-configurable with a default speed of 9600 bps via jumpers. Built-in flash memory can store over 100 pages or images. Ethernet interface: Equipped with an RJ45 interface and two LEDs to indicate its status. PS/2 debugging keyboard expansion standard AT-PS2 keyboard: Connects to a PS/2 industrial standard keyboard via an adapter cable; inexpensive and universal. Employs a bidirectional synchronous serial protocol, tightly integrated with the BIOS, achieving BIOS-level compatibility in programming and allowing direct use of various C library functions. Run PS2KEY.EXE to execute the keyboard resident program. Since the keyboard is only used for debugging in the system, a common matrix keyboard is not used, eliminating the need for external keyboard circuitry. USB Interface Camera: The system detects products on the production line, determines whether they meet quality requirements, and generates corresponding signals to input to the host computer based on the results. Image acquisition devices in the system include light sources and USB interface cameras. For USB interface camera drivers incompatible with PC104, corresponding DLL files need to be written. Infrared Proximity Switch: Utilizing the blocking or reflection of infrared light by the detected object, the presence or absence of the object is detected by a synchronous circuit selection. The object is not limited to metal; it can detect any object that can reflect light. In an infrared proximity switch, once the IR transmitter is driven, it emits an IR signal. The receiver receives this signal and outputs a low level. Because industrial environments are prone to interference, a through-beam photoelectric switch is used. Simultaneously, the IR LED sends a pulse signal of a certain width. A discrimination circuit is connected to the transmitting and receiving ends. If the transmitted/received signals are consistent, it is considered that no object is approaching; otherwise, an object is present. The through-beam photoelectric switch consists of a transmitter and receiver that are structurally separated and placed with their optical axes opposite each other. The light emitted by the transmitter directly enters the receiver. When the detected object passes between the transmitter and receiver and blocks the light, the photoelectric switch generates a switching signal. For opaque objects, a through-beam photoelectric switch is used to ensure the reliability of the detection. 2 System Flow 2.1 Control Flow Machine vision is formed through a USB interface camera to acquire images. The digital image is processed and analyzed in the PC104, and the output results are displayed. Nearly 80% of industrial vision systems are mainly used for inspection, including improving production efficiency, controlling product quality during the production process, and collecting product data. Product classification and selection are also integrated into the inspection function. The real-time industrial image detection control flow based on PC104 is shown in Figure 2. [align=center] Figure 2 System Control Flowchart[/align] Initialization parameters are input into the industrial computer through the PS/2 debugging keyboard, and software debugging is performed. A special industrial keyboard can also be used for convenient debugging and industrial operation. The corresponding keyboard software flow is shown in the next section. When the mechanical conveyor belt delivers the workpiece to be measured to the camera's field of view, the infrared proximity switch gives a trigger signal when the workpiece reaches the center of the camera's field of view. The camera acquires the workpiece image and sends the digital image to the PC104, where the image processing software calculates the required image feature values. Compared with the workpiece standard, the corresponding data image is displayed and instructions are issued based on the results. 2.2 Related Software Flow Image Processing Software Flow: Image Acquisition Due to pulse interference in the industrial environment, noise such as salt-and-pepper pulses is generated during image capture and transmission, which must be filtered. Opening operations are performed on the image to remove bright details smaller than the structuring element, and then closing operations are used to remove dark details smaller than the structuring element. Opening and closing operations are used to smooth the image and remove noise at the same time. See Figure 3 for the flowchart. [align=center] Figure 3 Image Processing Flow[/align] If a special keyboard is extended, the keyboard software reference program is as follows, keyboard routine: #include <*.h> // Include the required header file Int main(int argc, char * argv[]) { Int keyval; . . // Initialize While (1) { keyval= getch(); // Get the input character switch (keyval) { case '1': // If key 1 is pressed user_fun1(); // User program break; . . // Other key values default: ; } } return 0; } 3 System Simulation Using computer hardware and software technology to process image digital signals, thereby obtaining various target image feature values required, and then displaying the image, outputting data, issuing instructions, and cooperating with the execution mechanism to complete the automated process of position adjustment, good and bad filtering, data statistics, etc. Compared with human vision, the biggest advantages of machine vision are accuracy, speed, reliability, and digitization. Figure 4 illustrates the system's processing of a simulated workpiece, determining the cylinder diameter of the simulated workpiece: [align=center] Figure 4 Simulated workpiece processing[/align] The simulated workpiece triggers an infrared proximity switch during transport, and a USB interface camera captures image a of the workpiece. Due to the significant interference in the industrial environment, the image undergoes filtering (b) and smoothing processing (c) after opening and closing operations. To calculate the cylinder diameter of the workpiece, the image is binarized, skeletonized, and reconstructed to obtain the diameter parameter. This parameter is compared with the standard workpiece parameter. If the error exceeds the allowable range, a signal is given, and the relevant data is recorded or uploaded to the host computer. 4 Conclusion Since the first PC104 was produced in 1987, more and more people have become interested in PC104. This paper discusses the real-time detection of industrial images using PC104. Image processing equipment includes corresponding software and hardware systems; output devices are related systems connected to the manufacturing process, including process controllers and alarm devices. After the image data is processed by the software, the obtained image feature values are analyzed and the product control of the production line is completed. If a defective product is found, the alarm will sound and the product will be removed from the production line. This system has practical application value. References: [1] Gonzalez, RC and Woods, RE Digital Image Processing, 2nd ed., Prentice Hall, Upper Saddle River, NJ. 2002. [2] Li Jiegu. Theory and Practice of Computer Vision. Second Edition. Shanghai: Shanghai Jiaotong University Press, 1998. [3] Zhang Yujin. Image Engineering. Beijing: Tsinghua University Press. 2000. [4] Product Technical Specifications of Eurotech, Digital-logic and other companies [5] Li Weimin. Image Acquisition and Network Transmission of Microcontroller. Microcomputer Information, 2005, No. 11-2