Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 9, No. 2, 2024 162 Image Enhancement Research System Based on OpenCV Jinhua Li1, * 1Lianyungang Technical College, Lianyungang, China * Corresponding author Abstract: As a carrier of information, image analysis and processing are indispensable in the construction of smart cities. For example, object detection, tracking and recognition in the study of automatic driving all rely on external input images. Therefore, high-quality images play an important role in the era of intelligence, and the study of image enhancement has very high practical significance. In this paper, the convolutional neural network is designed for feature extraction to achieve fuzzy image enhancement, and the image enhancement research system is designed based on openCV and Qt. Keywords: Image enhancement; Convolutional neural network; openCV; System design. 1. Introduction Image enhancement refers to a series of algorithms and technologies that purposefully emphasize the overall or local characteristics of the image, improve the color, brightness and contrast of the image, make the originally unclear image clear or emphasize some features of interest, expand the difference between the features of different objects in the image, suppress the features of disinterest, and improve the visual effect of the image[1]. The traditional method is generally relatively simple and fast, but it does not take into account the context information in the image, so the effect is not very good. Deep learning can simulate the neural representation learning and interpretation of sample data (such as images, sounds, texts, etc.) by simulating the neural representation of human brain[2]. It can realize the change of complex functions by learning deep nonlinear network structure, and it can show a strong ability to learn data features from a small number of samples. Currently, popular deep learning network structures include convolutional neural network (CNN), recurrent neural network (RNN), deep neural network (DNN), etc. In the context of deep learning, deep learning models are applied to computer vision and image processing, and trainable neural networks are used to achieve image enhancement. In this paper, convolutional neural network is used for image feature extraction, and image enhancement research system is designed based on openCV and Qt technology. 2. Construct Neural Network Model Convolutional Neural Network (CNN) is a general term for a class of neural networks that use Convolutional Kernel combined with hierarchical grid structure to extract features. Convolutional neural networks (CNNS) are widely used to extract high-dimensional features of image and super-two- dimensional (spatiotemporal) information types[3]. This paper adopts the structure of convolution and pooling, and uses the activation function to increase the nonlinearity of the neural network, which is mainly divided into the following links: (1) Extract preliminary features. For the input image to be enhanced, the convolutional neural network convolutional layer with convolution kernel size of 7×7×64 and step size of 1 is used for processing to extract the preliminary features. (2) Extract specific features. For the initially extracted features, two convolution operations were carried out again, and the size of the convolution kernel was 5×5×128 and 3×3×256, respectively, for normalization processing. (3) Output pictures. Deconvolution operation is carried out. The convolution kernel size is 3×3×256, and the original image is fused with the features extracted by multiple convolution, and the image is finally output. 3. Development Tool Visual studio, referred to as VS, is a development kit launched by Microsoft Corporation in the United States. It is the most popular integrated development environment for Windows platform applications at present. With Visual studio, you can use any language to generate applications or extensions, simplify the software development process, and improve development efficiency. The Open Source Computer Vision Library, or OpenCV, was originally established by Intel Corporation and is now supported by Willow Garage[4] .OpenCV is a cross-platform computer vision library based on BSD-written by C++ language, providing python, MATLAB and other language interfaces, and can run on Linux, Windows and other operating systems. OpenCV has implemented many image processing algorithms, which are open source to researchers, have strong matrix computing capabilities and flexible user interfaces, and play an important role in image processing and computer vision research. Qt is a C++ graphical user interface development framework released by Haavard Nord and Eirik Chambe-Eng in 1995, and the role of MFC under the Windows platform can be used to develop GUI programs, now Qt has developed many mature software frameworks[5,6]. Qt's interface designer provides drawable widgets, such as Qwidget, Qlabel and QPushButton, which can effectively implement GUI interface design. Qt responds to the interface operations of an application by using a mechanism of signals and slots, which can be thought of as functions that receive and process signals. Qt has a good encapsulation mechanism to make Qt modularity is very high, good reusability, and Qt can be cross- platform, support object-oriented programming, can provide 163 rich apis, Qt has become more and more developers used as the choice of system interface development. 4. System Design This system adopts VS2015 integrated development environment, configs openCV3.4.5 open source vision library and Qt5.12 framework in VS2015 environment, realizes the operation of image processing based on openCV programming, and uses Qt5.12 framework to realize the interface design of fuzzy image enhancement system. In the actual use of the above models, the dnn::readNet() function is provided in OpenCV to load the trained model. The image enhancement system should have the following functions: 1) Can normally open the image in the specified local folder, and can normally read common image formats, such as JPG, PNG, etc. 2) It can realize the enhancement of fuzzy images, so that the images can recover more details and have a good visual feeling. 3) Can display the original image and the enhanced image respectively. 4) The enhanced image can be saved to the local specified folder. The overall design process of this system is shown in Figure 1: Figure 1. Design process 5. Implementation of System The system uses Qt framework to encode and design the interface, and uses functions in OpenCV open source vision library to process images. The system is mainly composed of four modules: input module, processing module, display module and saving module. (1) Input module: The user can input the image needed to be processed into the system, and the image formats that can be input include JPG, PNG, etc. (2) Processing module: It is the core module of this system. The trained model is embedded in this module, which can realize the enhancement of fuzzy images. (3) Display module: provides a display window to display the image after software exit, original image and enhanced processing. (4) Save module: The user can save the enhanced image to the specified local folder. Based on the analysis of the fuzzy image enhancement system function, in the layout design of the main interface, the Label control in the Display Widgets container bar is used to display text, and the Push Button control in the Buttons container bar is used to submit the response click event. The property Settings of each control on the main interface are shown in the following table: Table 1. property Settings Numble Class text objectName 1 Qlabel system SystemLabel 2 QpushButton go RSBtn 3 QpushButton exit RSBtn The main interface layout design of the system is shown in Figure 2 below: Figure 2. Layout design On the main interface, there are two click buttons, click the "go" button to enhance the image system, click the "exit" button to exit. Figure 3 shows the processing results of the input fuzzy image: 164 Figure 3. Results of the input fuzzy image There are two buttons on the interface of this function, namely "open" and "save". Click the "open" button at the top to input the image to be processed from the local computer, and the system will display the image to be processed at the top. After the image to be processed is confirmed, the system will perform image enhancement, and the enhanced image will be displayed at the bottom. Click the "save" button below to save the enhanced image. 6. Summary In this paper, through the system, the effect of real-time image enhancement is achieved, and the image sharpness is significantly improved. Although the enhancement of the image has achieved a good effect, some details are still lost in the process of enhancement. Therefore, in the process of continuous summary and improvement, the appropriate algorithm should be selected according to the necessary retained information of the image in the process of image enhancement, so that the image enhancement in different scenes can achieve better results. References [1] Liu Wankui, Liu Yue.Review on illumination estimation in augmented reality [J]. Journal of Computer-Aided Design & Computer Graphics, 2016, 28 (2): 197-207. [2] Wang Ping, Sun Zhenming.Multi-level decomposition retinex low-light image enhancement algorithm [J]. Application Research of Computers, 2020, 37 (4): 1204-1209. [3] Huang Hui, Dong Linlu, Liu Xiaofang, et al. Improved retinex low light image enhancement method [J]. Optics and Precision Engineering, 2020, 28 (8): 1835-1849 [4] Mao xingYun. Introduction to OpenCV3 programming [M]. Beijing: Publishing House of Electronics Industry, 2015.. [5] Blanchette J, Summerfield M.C++ GUI Programming with Qt 4[M].America:Prentice Hall Press, 2006 [6] Lu Wenzhou.Qt5 Development and Practice [M]. 2nd Ed., Beijing: Publishing House of Electronics Industry, 2015.