Vision system check for authentication of quality of industry automation for detection of system parts using raspberry pi

Typical tasks of vision systems are included in Recognition area of work – object recognition, identification, detection, content-based image retrieval, pose estimation, optical character recognition (OCR), 2-D encoding and decoding, shape recognition technology, facial recognition and many more. The process followed in order to attain these tasks generally follows the same pattern. First step is image acquisition using various types of cameras according to the requirements (light-sensitive cameras, range sensors, ultrasonic cameras and many more) and acquiring pixel intensities corresponding to light intensity or other measures. Followed by preprocessing in order to reduce noise, increase contrast, resample or scaling using filters, histogram equalization, re-sampling algorithms.


Introduction
Vision Systems in industries, typically known as Machine Vision, aid in applications such as robotic guidance, process control using automatic inspection and analysis on production line. They are generally used for enhanced accuracy and efficiency by reducing human-induced error and decreasing cycle time, virtue to its fast-processing capacity. Having overcome the prototype stage in last few decades and descended into industrialization, many companies today provide Vision Systems for industries including but not limited to the automotive sector, healthcare, defense, online platforms, etc. Particular to automotive sector, the systems have to be robust and immune to all noises. However, the mechanical and electrical aspects of the system got to be considered for a strong system resistant to noisemechanical vibrations, EMI interference, ambient light conditions etc. All these aspects are considered in the design and implementation of such systems on shop-floor, individual to each project/set-up.

Literature review
In this paper author presents [3] an overview of computer vision systems, some applications on automated visual inspection, aspects involved in their development, and aspects related to the integration of the vision system to the industrial process. Digital image processing or other image processing [4] tend to evolve into the most extensive mainstream with support from other theoretical fields supported by the rapid development of specific disciplines such as mathematics, Linear algebra, statistics, Soft Computing, and Computational neurosciences the supported regulations supporting the development of digital image processing. It also combined with lighting systems to facilitate [5] image acquisition continued with image analysis. In more detail, the stages of image analysis are: image formation, in which image of object is captured and stored in computer; image preprocessing, whereby quality of image is improved to enhance the image detail image segmentation, in which the object image is identified and separated from the background, image measurement, where several significant features are quantized, and image interpretation, where the extracted images are then interpreted.

Defining the Objective
The process of image processing in this project is followed by image acquisition by cameras and thus the preprocessing in [6] order to reduce noise, increase contrast, resample or scaling using filters, histogram equalization, re-sampling algorithms and scaling functions respectively. Next come feature extraction/detection/segmentation to extract relevant information from images by using different models. It is followed by post-processing and decision making based on sequential conditional statements. The decisions like pass/fail or flagged for human intervention/review can be easily added.

Process Used
In this proposed work, we have horizontally deployed existing methodology on 16p production line. It includes a new compact, lightweight mechanical set-up which was mounted on the line. It was made of aluminum for light-weight body and strength. Stainless steel wasn't required since the area was nowhere near any AC supply board or cables and hence tolerant to surrounding ineffective and weak noise.

Framed Work
Therefore the task to accomplish in this work is to measure various characteristics of part for decision making to check whether the part is Ok or NOK

Steps
To start with the process some steps were decided which are as follows: i. Study the basic concepts in training which includes Open CV and Python for Image Processing, Raspberry Pi and Pi Camera modules, electrical circuit integration. ii. Getting acquainted with the various color models and advantages of YCrCb Color Model overall. iii. Designing Vision System along with image processing algorithm and GUI in Python IDLE using necessary libraries. iv. Penultimate integration of software in Raspberry Pi with hardware setup on product online. v. Successful trials and achieving cent percent accuracy.

Process
Based on the above steps and as shown in figure 1 when a new 16 pin header entered the cameracovered area and trigger is received, the camera captures the image, Raspberry Pi processes it to detect pin height and true position of housing from its PCB and mating side and then the Raspberry Pi gives an OK or NOK signal from one of the GPIOs through PCB to PLC. If OK signal is received, housing should move ahead in pipeline. If NOK signal received, system should remain stand-still. OK / NOK status of housing images should be displayed on screen with green or red blinking respectively.

Autoliv Fiat
The existing methodology on autoliv fiat production line is widely used, when a new housing entered the camera-covered area and trigger is received as shown in figure 2, the camera captures the image, Raspberry Pi processes it to detect the print and open distance of wire from the housing and then the Raspberry Pi gives an OK or NOK signal from one of the GPIOs through PCB to PLC. If OK signal is received, housing should move ahead in pipeline. If NOK signal received, system should remain standstill. OK / NOK status of housing images should be displayed on screen with green or red blinking respectively.

Login page Pseudo Code
Login page Code as shown in figure 6. is very straight forward page which sets ups various things in vision system to maintain the system once the access is given to user. Server will serve the user by establishing a connection, only if the username and password entered by the user are correct. Anonymous users can also access the server if permissions are given. Python and tkinter library is used to develop a login code. Mysql is used for creating a database which is fully secured by end to end encryption. The encrypted password get save in the database.

Features of Vision System using Open CV, Raspberry Pi Open Source The vision system built in-house uses open source operating system (Linux based Raspbian) on
Raspberry Pi and open source libraries in code. Hence, the systems are open for outsourcing and improvements through external sources. This significantly increases the ease of utility, scope for improvement and constructive critique from all sources. It also makes the system universal so that anyone can contribute towards it.

Raspberry Pi for processor/ Pi Camera for Image Capture
The camera unit is mounted at the bottom of the set-up with a hole provided for the lens. The Raspberry Pi is mounted above it and connected to it using a data cable. The Raspberry Pi includes a heat sink or a 5V DC fan used for ventilation and cooling system to cool the processor. Raspberry Pi 3B+ model is used with Raspbian OS with LXDE user interface. A stainless steel enclosure can be used to isolate the system from electrical noise in places of installation where surrounding EMI due to AC power supplies might hamper the signals and cause interference at GPIOs (General Purpose Input Outputs).

Integration of System on Shop Floor
The system consist of a raspberry pi, PCB and PLC as shown in figure 7. It needs two SMPS which give 24V DC supply. SMPS is switched mode power supply. It converts the power which having high frequencies and storage components like capacitors and inductors to power supply when switching device is in nonconductive state. Its function is to convert a level of voltage to the voltage or current required by the client through different forms of architecture.

Improvements Proposed and Solutions
The trials further revealed certain improvements needed in the code. The GUI needed to be more operator-friendly. The processing time needed to reduce, this was done by reducing sleep time. This significantly reduced the cycle time.

Conclusion
From the experimentation it has been found that outputs of trial's accuracy is found to be 100%, under the assumptions that the camera module's mechanical vibrations doesn't affect the image quality. Most of the time, the vibrations caused the housing to go out of the region of interest or the image get blurred in the extraction process. This issue was resolved by mounting the camera module firmly on the set-up. The problem of getting worst blur images prohibited resulting into good quality pictures and hence increased the housing' exposure to camera. Color intensity variations don't rely on this detection in any way. The housing shifting, out of image problem was resolved simply by increasing the region of interest in software program. The trials further revealed certain improvements needed in the code. The GUI needed to be more operator-friendly. The processing time needed to reduce, this was done by reducing sleep time. This significantly reduced the cycle time.