1. Introduction
In recent years, artificial intelligence has been widely applied in the field of medicine, breaking through the limitations of traditional medical practices that focus on the process of diagnosis and treatment. Especially in medical imaging and intelligent detection, the involvement of artificial intelligence in image detection, capture, and processing has significantly improved the efficiency of medical diagnosis. For example, Apple received Food and Drug Administration (FDA)approval for its smartwatch, which can easily share electrocardiogram and atrial fibrillation detections through smartphones. In the field of endocrinology, continuous glucose monitoring allows diabetes patients to view real-time blood sugar levels and understand trends in blood sugar fluctuations [1].
However, the specialization of medical devices results in relatively single-functioned instruments, incapable of comprehensively detecting multiple indicators within the human body. The high cost of medical equipment makes it difficult for various medical devices to achieve widespread use, leading to crowded hospital registration queues and longer doctor consultation times. This hinders the efficient implementation of auxiliary diagnostic and visualized treatment plan functions.
This paper is based on OpenCV's edge detection technology, combined with image acquisition techniques such as binocular stereo vision and image detection technologies involving artificial intelligence. It analyzes relevant literature on intelligent medicine and image detection, and designs an intelligent medical image detection system with a primary framework focusing on human health detection, image capture, image transmission, medical feedback, and visualized simulated treatment plans. The aim of this paper is to provide feasible implementation strategies for the development of intelligent medicine, while also presenting a simplified design for image detection.The medical system design carried out in this article has improved the efficiency of medical diagnosis, visualized the diagnosis and treatment plan, and provided feasible solutions for medical treatment with the participation of artificial intelligence and computers.
2. Image detection
2.1. The fundamental principles of image detection
Image detection technology is a technique that transforms the external environment into computer-readable data. It extends the concept of edge detection to the entire image. Based on image features, it segments the spatial regions of the image and highlights the significant portions. In the edge detection phase, the device receives image information from the external world. It evaluates the intensity values of the image using edge detection algorithms, identifying points with sudden changes in contrast and brightness. This determines the presence of edges in the image and simultaneously displays these edges, providing a holistic view of the recognized object. Typically, an edge in an image indicates the end of one region and the beginning of another. The set of pixels between adjacent regions in an image forms the edges of the image. Thus, image edges can be understood as areas where intensity, color, etc., undergo abrupt changes. Image edges have two main components: direction and magnitude. Pixels along the direction of the edge exhibit a relatively gradual change in value, while pixels along the direction perpendicular to the edge experience more significant changes. Edges can be categorized as strong edges (regions with abrupt color or intensity changes), weak edges (regions with relatively small color or intensity variations), fragmented edges (disconnected or discontinuous areas), and closed edges (forming enclosed regions). The detection process begins by examining the local discontinuities of each pixel element in the image. The amplitude, direction, and position of specific sub-regions within the image are essential features for potential edges [2].
2.2. Analysis of the current state of image detection
Early edge detection methods mainly include Prewitt, Canny, etc. These methods primarily rely on the gradient information of brightness variations in the image to detect edges. However, they may encounter problems when dealing with noise and continuous discontinuities. With the rise of deep learning, edge detection methods based on Convolutional Neural Networks (CNN) have also become popular. By training on a large amount of data, these methods can learn more complex feature representations, leading to more accurate edge detection in various scenarios.
In recent years, incorporating semantic information into edge detection has also become an important research direction. This approach can strengthen the connections between object edges and eliminate unnecessary edges. In certain specialized applications, edge detection based on multi-sensor data is required. For instance, joint edge detection from visible light images and infrared images necessitates effective fusion of information from different modalities. Early edge detection methods--Prewitt kernel is as follows:
\( [\begin{matrix}-1 & -1 & -1 \\ 0 & 0 & 0 \\ 1 & 1 & 1 \\ \end{matrix}][\begin{matrix}-1 & 0 & 1 \\ -1 & 0 & 1 \\ -1 & 0 & 1 \\ \end{matrix}] \) (1)
3. System architecture design
3.1. System overview
This paper mainly addresses issues such as the tight hospital registration queue, long doctor consultation times, lack of auxiliary diagnostic functions, and the inability to visualize diagnosis and treatment plan outcomes. An intelligent autonomous medical detection system is designed to improve existing medical equipment, as shown in Figure 1, divided into the following three parts:
Part 1: Image Detection Function Implementation - Image Capture. It is mainly based on infrared thermal imaging technology, using OpenCV's edge detection to capture human surface features and simultaneously detect body temperature, generating pseudocolored thermal images.
Part 2: Image Transmission and Medical Feedback. The generated pseudocolored thermal images are transmitted to the hospital and user systems, facilitating doctors' analysis of users' physical conditions based on the images.
Part 3: Visualized Diagnostic Solutions. Based on artificial intelligence, preliminary analysis of the images is conducted, providing initial suggestions for common illnesses and simulating diagnosis and treatment plans.
Figure 1. System Workflow Design.
3.2. Image detection for image capture implementation
3.2.1. Infrared thermal imaging technology. During the process of infrared thermal imaging of the body surface and temperature detection, the infrared thermal images can be blurry with low resolution. Therefore, preprocessing of the infrared thermal images is necessary to improve their quality. This process involves rotation, scaling, and noise reduction to obtain clearer images [3]. As the characteristics of the body surface vary with different levels of health, the generated images from infrared thermal imaging can reflect the features of the user's body surface. Consequently, corresponding thermal images for body surface detection can be obtained. Additionally, when there is a disease or functional change in a certain part of the human body, the blood flow in that area changes accordingly, leading to a local change in body temperature. This enables the use of temperature detection thermal images to determine the location and severity of bodily abnormalities.
3.2.2. Edge detection techniques. For the images generated by infrared thermal imaging, edge detection techniques based on OpenCV are utilized for identification. OpenCV is a cross-platform computer vision library that is lightweight, efficient, and offers numerous general algorithms for image processing and computer vision tasks [4]. OpenCV provides a training approach that effectively recognizes feature points. By applying the Canny function to the acquired thermal images, a list of edge pixel points is returned. This information is then superimposed onto the original image, completing the process of marking the image transformation. The Canny edge detection algorithm locates edges by convolving the image with a kernel and finding the maximum value in the direction of the edge. This approach determines whether a point is an edge point based on whether its value is the maximum in its neighborhood [5].
Building upon this foundation, OpenCV provides tools for recognition. We train the recognition tool using thermal images of regular human bodies. We can use GUI controls to continuously gather user data and train the recognition tool with accurate thermal images. Furthermore, this training can enable effective prediction of frequently occurring diseases.
3.3. Image transmission and medical feedback
The ‘imread’ function provided by OpenCV allows reading of previously saved images, which can be displayed using the `imshow` function. In this system, after receiving a processed image from the user, the information containing user details and the image is saved as a new file using the ‘imwrite’ function. As shown in table 1. This data is then uploaded to the hospital's database. The hospital's database assigns a consulting doctor to the user and provides the relevant information to the assigned doctor, facilitating medical diagnosis.
Table 1. The Main Operation Code.
Code | Function |
inwrite(“image.jpg”,image); | Image storage |
inread(“image.jpg”); | Image reading |
inshow(“image.jpg”,image); | Image display |
3.4. Visualized diagnostic solution
The system utilizes artificial intelligence to compare thermal images for diagnosis. It compares the user's detection results with thermal images of healthy human bodies, making an initial assessment of the user's physical condition. It then records any abnormal areas and sends this information to the diagnosing physician. For simpler cases, the system uses the database to provide users with reasonable recommendations for self-care. This technology has found extensive application in fields like weather forecasting. For instance, AI is used to predict typhoons by extracting relevant features from satellite cloud data, constructing classification models and similarity-based retrieval models for typhoon intensity prediction based on these features. The final prediction is made by fusing the recognition results of these two models [6].
4. Conclusion
This paper mainly analyzes employing OpenCV's edge detection technology to assess human health using infrared thermal imaging. This approach has enhanced the efficiency of medical diagnosis by providing a visual simulation of diagnostic solutions. It offers a viable direction for assisting medical practices. However, the inherent blurriness of infrared thermal images poses challenges in image processing. Additionally, the feasibility of the designed solution requires further validation through implementation and testing. Subsequent research needs to clarify the infrared thermal imaging image, combine system software and hardware, and verify its feasibility through application.