A Machine Vision-Based Method and System for Detecting Temperature Changes in Two-Wheeled Electric Vehicle Batteries

By performing layered processing and feature enhancement on infrared images, the accuracy problem of battery temperature detection was solved, enabling efficient identification and early warning of abnormal battery temperatures.

CN121366150BActive Publication Date: 2026-05-05BEIJING TEDA ZHIYUAN ENG TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING TEDA ZHIYUAN ENG TECH CO LTD
Filing Date
2025-10-30
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

In existing technologies, battery temperature detection suffers from inaccuracies due to differences in the position of the temperature sensor, and the infrared image enhancement effect is poor, which affects the accuracy of battery temperature identification.

Method used

By dividing the infrared image into a base image layer and a detail image layer, contrast enhancement processing is performed on salient and non-salient features respectively. Combined with local and global histogram equalization processing, an enhanced infrared image is generated for battery temperature identification.

Benefits of technology

The enhancement effect of infrared images has been improved, the accuracy of battery temperature identification has been enhanced, and real-time monitoring and abnormal warning of battery temperature have been realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121366150B_ABST
    Figure CN121366150B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for detecting battery temperature changes in two-wheeled electric vehicles based on machine vision. The invention performs image enhancement processing by dividing the battery's infrared image into a base image layer and a detail image layer. First, salient and insignificant features in the base image layer are used to highlight the target and suppress the background, thereby enhancing the contrast of the base image layer. For the detail image layer, detail enhancement is directly performed to obtain the enhanced base image layer. Then, the two are fused to obtain the enhanced infrared image, and image recognition is performed to obtain the current battery temperature detection result. Finally, the current temperature is compared with historical temperatures to obtain the battery temperature change result. Therefore, this invention effectively optimizes the detailed areas of the image while improving image contrast, thereby improving the infrared image enhancement effect and the accuracy of battery temperature recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine vision technology, specifically to a method and system for detecting temperature changes in batteries of two-wheeled electric vehicles based on machine vision. Background Technology

[0002] With increasing environmental awareness and worsening urban traffic congestion, electric bicycles, as a clean and convenient short-distance transportation tool, have been widely used in cities. During the charging process, the internal components of electric bicycles, such as high-voltage capacitors, switching transistors, and high-frequency transformers, dissipate heat to the outside, causing the battery to heat up. This is a normal phenomenon. However, when the battery overheats, it can disrupt the chemical balance within the battery, leading to side reactions and reducing battery safety. Therefore, it is necessary to monitor the battery's real-time temperature during charging to identify abnormal temperatures and ensure the battery's normal operation.

[0003] Currently, battery temperature monitoring is mostly achieved using temperature sensors. However, current battery temperature acquisition devices vary significantly depending on the location of the temperature sensor, and different bonding methods between the temperature sensor and the battery can also affect the accuracy of the temperature data. Therefore, temperature sensor monitoring has the problem of not being able to accurately detect the surface temperature of the battery. Against this backdrop, infrared image temperature detection technology based on machine vision has been widely used due to its sensitivity to temperature anomalies and comprehensive coverage.

[0004] Infrared images reflect the surface temperature distribution of batteries. Compared with ordinary optical images, they are characterized by blurred edges and details, strong spatial correlation, low image contrast, and poor signal-to-noise ratio. Therefore, enhancing and optimizing the details of infrared images before image recognition is crucial. Currently, histogram equalization and homomorphic filtering are commonly used for infrared image preprocessing. However, most of these techniques are based on global enhancement and do not focus on image details, resulting in only an improvement in overall image contrast without effectively optimizing detailed areas. This leads to poor infrared image enhancement, which in turn affects the accuracy of battery temperature detection. Therefore, based on the aforementioned shortcomings, providing a machine vision-based method for detecting battery temperature changes in two-wheeled electric vehicles with good infrared image enhancement to improve the accuracy of battery temperature detection has become an urgent problem to be solved. Summary of the Invention

[0005] The technical problem to be solved by this invention is the problem of electric vehicle battery temperature detection. The purpose is to provide a method and system for detecting the temperature change of two-wheeled electric vehicle batteries based on machine vision, which solves the problem that the infrared image enhancement effect is not good in traditional technology, thus affecting the accuracy of battery temperature identification.

[0006] This invention is achieved through the following technical solution:

[0007] Firstly, a machine vision-based method for detecting temperature changes in the batteries of two-wheeled electric vehicles is provided, including:

[0008] Acquire infrared images of the batteries of two-wheeled electric vehicles;

[0009] The infrared image is processed into layers to obtain a base image layer and a detail image layer;

[0010] Based on the base image layer, a first feature map and a second feature map are generated, wherein the first feature map is used to highlight background pixels in the base image layer, and the second feature map is used to highlight non-background pixels in the base image layer.

[0011] Based on the first feature map and the second feature map, the base image layer is subjected to contrast enhancement processing between the target and the background to obtain the enhanced base image layer.

[0012] The detail image layer is subjected to detail enhancement processing to obtain an enhanced detail image layer;

[0013] An enhanced infrared image is generated using the enhanced detail image layer and the enhanced base image layer;

[0014] Image recognition is performed on the enhanced infrared image to obtain the current temperature detection result of the two-wheeled electric vehicle battery. The current temperature detection result is then compared with the historical temperature detection results to obtain the battery temperature change result.

[0015] Based on the above disclosure, after acquiring the infrared image of a two-wheeled electric vehicle battery, this invention first performs layered processing on the infrared image to obtain a base image layer and a detail image layer. After completing the image layering, this invention generates feature maps highlighting background and non-background points based on the base image layer, and enhances the contrast between the target and the background in the base image layer based on these features, thus obtaining an enhanced base image layer. In this way, it utilizes the salient and non-salient features of the image to highlight the target in the base image layer and suppress the background, thereby enhancing the contrast of the base image layer. Simultaneously, this invention performs detail enhancement processing on the detail image layer separately to enhance the image's detail features. Then, the enhanced detail image layer and the enhanced base image layer can be used to generate an enhanced infrared image. Next, image recognition is performed on the enhanced infrared image to obtain the current temperature of the battery. Finally, the current temperature is compared with the historical temperature to obtain the battery temperature change result, and thus, an abnormal battery warning can be issued based on this result.

[0016] Through the above design, this invention divides the infrared image of the battery into a base image layer and a detail image layer for separate image enhancement processing. For the base image layer, salient and insignificant features are first utilized to highlight the target and suppress the background, thereby enhancing the contrast of the base image layer. For the detail image layer, detail enhancement is directly applied to obtain the enhanced base image layer. Then, by fusing the two, an enhanced infrared image is obtained, and image recognition is performed to obtain the current battery temperature detection result. Finally, comparing the current temperature with historical temperatures yields the battery temperature change result, which is used as a basis for battery anomaly warning. Therefore, this invention effectively optimizes the detail areas of the image while improving image contrast, thereby improving the infrared image enhancement effect and the accuracy of battery temperature recognition. Thus, this invention is highly suitable for large-scale application and promotion.

[0017] In one possible design, the infrared image is layered to obtain a base image layer and a detail image layer, including:

[0018] The infrared image is subjected to grayscale adjustment processing to obtain a grayscale adjusted image;

[0019] The filtering windows of each pixel in the grayscale adjusted image at different scales are determined, and based on the filtering windows of each pixel at different scales, the filtering weights and filtering parameters of each pixel at different scales are obtained.

[0020] By utilizing the filtering weights and parameters of each pixel at different scales, the grayscale adjusted image is subjected to multi-scale filtering to obtain several filtered images.

[0021] The base image layer is obtained by weighted fusion of several filtered images, and the detail image layer is obtained by subtracting the base image layer from the infrared image.

[0022] In one possible design, the infrared image is subjected to grayscale adjustment processing to obtain a grayscale adjusted image, including:

[0023] The infrared image is normalized to obtain a normalized image;

[0024] Calculate the pixel mean and pixel mean square error of the normalized image, and determine the maximum and minimum gray values ​​based on the pixel mean and pixel mean square error.

[0025] The grayscale adjustment factor for each pixel in the normalized image is determined based on the maximum and minimum grayscale values.

[0026] The grayscale adjustment image is obtained by using the grayscale adjustment factor of each pixel in the normalized image.

[0027] In one possible design, based on the filtering windows of each pixel at different scales, the filtering weights of each pixel at different scales are derived, including:

[0028] For the j-th pixel in the grayscale adjusted image, each pixel in the filter window at any scale of the j-th pixel is taken as the target pixel.

[0029] A coordinate vector is constructed based on the pixel coordinates of the target pixel and the pixel coordinates of the j-th pixel;

[0030] Based on each pixel in the filtering window of the j-th pixel at any scale, construct the gradient covariance matrix of the filtering window of the j-th pixel at any scale.

[0031] Using the gradient covariance matrix and the coordinate vector, the initial filtering weights of the filtering window for the j-th pixel at any scale are calculated.

[0032] Increment j by 1, and re-select each pixel in the filter window of the j-th pixel at any scale as the target pixel until j equals J, to obtain the initial filter weight of the filter window of each pixel in the grayscale adjusted image at any scale, where the initial value of j is 1, and J is the total number of pixels in the grayscale adjusted image.

[0033] For any pixel in a grayscale adjusted image, filter windows containing any pixel are selected from the filter windows of each pixel in the grayscale adjusted image at any scale, and used as the target window.

[0034] Based on the initial filtering weights corresponding to the target window, the filtering weights of any pixel at any scale are calculated, and after polling all pixels in the grayscale adjusted image, the filtering weights of each pixel at any scale are obtained.

[0035] In one possible design, based on the base image layer, a first feature map and a second feature map are generated, including:

[0036] For the i-th pixel in the base image layer, several neighborhood windows of the i-th pixel are determined, wherein each neighborhood window has a different size;

[0037] Calculate the average coordinates of all pixels within each neighborhood window, and calculate the initial feature value of the i-th pixel based on the pixel coordinates of the i-th pixel and the average coordinates within each neighborhood window.

[0038] The initial feature value of the i-th pixel is processed by feature mapping to obtain the feature value of the i-th pixel;

[0039] Increment i by 1 and redetermine several neighborhood windows of the i-th pixel until i equals n, thus obtaining the feature value of each pixel in the base image layer.

[0040] The feature values ​​of each pixel in the base image layer are grayscale mapped to obtain a second feature map for highlighting non-background pixels after grayscale mapping.

[0041] The second feature map is inverted to obtain the first feature map.

[0042] In one possible design, based on the first feature map and the second feature map, the base image layer is subjected to contrast enhancement processing to obtain an enhanced base image layer, including:

[0043] The base image layer is subjected to local histogram equalization and global histogram equalization to obtain a first initial enhanced image and a second initial enhanced image, respectively.

[0044] Based on the first feature map and the second feature map, a first mask image and a second mask image are generated;

[0045] Using the second mask image, the first initial enhanced image is masked to obtain a first processed image, and using the first mask image, the second initial enhanced image is masked to obtain a second processed image;

[0046] The enhanced base image layer is generated based on the first processed image and the second processed image.

[0047] In one possible design, local histogram equalization is performed on the base image layer to obtain a first initial enhanced image, including:

[0048] The base image layer is divided into multiple image blocks, and a histogram of each image block is generated.

[0049] For any image block, the maximum pixel value is selected from the image block, and the ratio between each pixel in the image block and the maximum pixel value is calculated to obtain several pixel ratios;

[0050] Based on several pixel ratios and the grayscale range of any image block, the histogram equalization threshold of any image block is calculated, and after all image blocks have been polled, the histogram equalization threshold of each image block is obtained.

[0051] Based on the histogram equalization threshold of each image block, each histogram is cropped, and the cropped part in each histogram is allocated to the uncropped part in each histogram to obtain each cropped histogram.

[0052] The first initial enhanced image is generated using the various cropped histograms.

[0053] In one possible design, the detail image layer is subjected to detail enhancement processing to obtain an enhanced detail image layer, including:

[0054] For the m-th pixel in the detail image layer, obtain the neighboring pixels of the m-th pixel;

[0055] Calculate the local grayscale mean based on the grayscale values ​​of the neighboring pixels of the m-th pixel, and then calculate the enhancement parameters of the m-th pixel based on the local grayscale mean.

[0056] The enhancement factor of the m-th pixel is calculated based on the gray value and enhancement parameters of the m-th pixel.

[0057] Using the enhancement factor, the m-th pixel is enhanced to obtain the enhanced m-th pixel;

[0058] Increment m by 1 and reacquire the adjacent pixels of the m-th pixel until m equals M, thus obtaining the enhanced detail image layer, where the initial value of m is 1 and M is the total number of pixels in the detail image layer.

[0059] Secondly, a machine vision-based battery temperature change detection system for two-wheeled electric vehicles is provided, including:

[0060] The acquisition unit is used to acquire infrared images of the batteries of two-wheeled electric vehicles;

[0061] A layering unit is used to perform layering processing on the infrared image to obtain a base image layer and a detail image layer;

[0062] The feature extraction unit is used to generate a first feature map and a second feature map based on the base image layer, wherein the first feature map is used to highlight background pixels in the base image layer, and the second feature map is used to highlight non-background pixels in the base image layer.

[0063] An enhancement unit is configured to perform contrast enhancement processing on the base image layer based on the first feature map and the second feature map to obtain an enhanced base image layer.

[0064] The enhancement unit is used to perform detail enhancement processing on the detail image layer to obtain an enhanced detail image layer;

[0065] The enhancement unit is also used to generate an enhanced infrared image using the enhanced detail image layer and the enhanced base image layer;

[0066] The temperature recognition unit is used to perform image recognition on the enhanced infrared image to obtain the current temperature detection result of the two-wheeled electric vehicle battery, and compare the current temperature detection result with the historical temperature detection result to obtain the battery temperature change result.

[0067] Thirdly, a machine vision-based device for detecting temperature changes in the battery of a two-wheeled electric vehicle is provided. Taking the device as an electronic device as an example, it includes a memory, a processor, and a transceiver that are connected in sequence. The memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the machine vision-based method for detecting temperature changes in the battery of a two-wheeled electric vehicle as described in the first aspect or any possible design of the first aspect.

[0068] Fourthly, a storage medium is provided, on which instructions are stored, which, when executed on a computer, perform the machine vision-based two-wheeled electric vehicle battery temperature change detection method as described in the first aspect or any possible design of the first aspect.

[0069] Fifthly, a computer program product containing instructions is provided, which, when executed on a computer, causes the computer to perform the machine vision-based method for detecting temperature changes in a two-wheeled electric vehicle battery as described in the first aspect or any possible design of the first aspect.

[0070] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0071] This invention divides the infrared image of a battery into a base image layer and a detail image layer for separate image enhancement processing. For the base image layer, salient and insignificant features are first utilized to highlight targets and suppress the background, thereby enhancing the contrast. For the detail image layer, detail enhancement is directly applied to obtain the enhanced base image layer. Then, the two are fused to obtain the enhanced infrared image, and image recognition is performed to obtain the current battery temperature. Finally, the current temperature is compared with historical temperatures to obtain the battery temperature change result, which is used as a basis for battery anomaly warning. Therefore, this invention improves image contrast while effectively optimizing the detail areas of the image, thereby improving the infrared image enhancement effect and the accuracy of battery temperature recognition. Thus, this invention is highly suitable for large-scale application and promotion. Attached Figure Description

[0072] To more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be considered as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort. In the drawings:

[0073] Figure 1 A schematic flowchart illustrating the steps of a machine vision-based method for detecting temperature changes in the battery of a two-wheeled electric vehicle, as provided in an embodiment of the present invention.

[0074] Figure 2 A structural diagram of a machine vision-based battery temperature change detection system for two-wheeled electric vehicles provided in an embodiment of the present invention;

[0075] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0076] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments and accompanying drawings. The illustrative embodiments and descriptions of this invention are for explanation only and are not intended to limit the invention. It should be understood that although terms such as "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another. For example, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit, without departing from the scope of the exemplary embodiments of this invention.

[0077] Example:

[0078] See Figure 1 As shown in this embodiment, the machine vision-based method for detecting battery temperature changes in two-wheeled electric vehicles divides the battery's infrared image into a base image layer and a detail image layer for image enhancement processing. Specifically, it utilizes the salient and non-salient features of the base image layer to highlight the target and suppress the background, thereby enhancing the contrast of the base image layer. For the detail image layer, it directly performs detail enhancement to obtain the enhanced base image layer. Then, the two are fused to obtain the enhanced infrared image. Next, image recognition is performed on the enhanced infrared image to obtain the current battery temperature detection result. Finally, the current temperature is compared with historical data... By comparing temperatures, the battery temperature change can be obtained, which can then be used as a basis for battery anomaly warning. Therefore, this method improves image contrast while effectively optimizing the detailed areas of the image, thereby enhancing the infrared image enhancement effect and improving the accuracy of battery temperature identification. For example, this method can be run on, but is not limited to, the battery temperature monitoring end. Optionally, the battery temperature monitoring end can be, but is not limited to, a computer or server. It is understood that the aforementioned execution entity does not constitute a limitation on the embodiments of this application. Accordingly, the operation steps of this method can be, but are not limited to, the steps S1 to S7 described below.

[0079] S1. Acquire infrared images of the two-wheeled electric vehicle battery; In this embodiment, for example, but not limited to, an infrared camera can be used to acquire infrared images of the two-wheeled electric vehicle battery, and acquisition is performed at preset intervals. After each acquisition, the image is transmitted to the temperature monitoring terminal so that the temperature monitoring terminal can obtain the current temperature detection result based on the currently acquired infrared image and compare it with the previous historical temperature detection result to obtain the temperature change result of the electric vehicle battery.

[0080] In practical applications, the acquired infrared images are characterized by blurred edges and details, strong spatial correlation, low image contrast, and poor signal-to-noise ratio. Traditional infrared enhancement techniques can only enhance global contrast but cannot effectively optimize image details. Therefore, this embodiment provides an improved infrared image enhancement method, which divides the image into a base image layer and a detail image layer, and performs contrast enhancement on the base image layer and detail enhancement on the detail image layer. Finally, by fusing the two, an enhanced infrared image with enhanced contrast and effectively optimized detail areas is obtained. The image enhancement process is shown in steps S2 to S6 below.

[0081] S2. The infrared image is processed into layers to obtain a base image layer and a detail image layer. In this embodiment, the infrared image is first adjusted in grayscale to improve the uneven distribution of shadows and increase contrast. Then, the filtering weights and parameters of each pixel in the image at different scales are determined. Next, multi-scale filtering is performed using the filtering weights and parameters of each pixel at different scales to obtain several filtered images. Finally, based on the several filtered images, the base image layer and the detail image layer are obtained. The aforementioned image layering process can be, but is not limited to, the steps S21 to S24 below.

[0082] S21. Perform grayscale adjustment processing on the infrared image to obtain a grayscale adjusted image; in specific applications, this embodiment provides an adaptive grayscale transformation method, that is, calculate the grayscale adjustment factor of each pixel in the infrared image and construct the corresponding adaptive grayscale adjustment function to complete the grayscale adjustment of the infrared image; wherein, the grayscale adjustment process can be, but is not limited to, as shown in the following steps S21a to S21d.

[0083] S21a. The infrared image is normalized to obtain a normalized image. In specific implementation, a histogram of the infrared image is first generated, and then the minimum and maximum values ​​of the non-zero gray levels in the histogram are calculated. Specifically, for any pixel in the infrared image, if the gray value of any pixel is less than the minimum value of the non-zero gray levels in the histogram, the gray value of any pixel is adjusted to 0. If the gray value of any pixel is greater than the maximum value of the non-zero gray levels in the histogram, the gray value of any pixel is adjusted to 1. If the gray value of any pixel is greater than or equal to the minimum value and less than or equal to the maximum value (i.e., between the two), the difference between the maximum and minimum values ​​is calculated first, and then the minimum value is subtracted from the gray value of any pixel. Finally, the ratio of the two values ​​is used as the adjusted gray value of any pixel. In this way, the normalization of the infrared image can be completed through the above operations.

[0084] However, the above operations will cause the gray values ​​of some pixels to be weakened or enhanced. Therefore, this embodiment provides an adaptive gray-scale transformation method based on normalization. That is, the gray-scale adjustment factor of each pixel in the normalized image is first calculated, and then the gray-scale adjustment of each pixel in the normalized image is realized based on this factor. The aforementioned process is as shown in the following steps S21b to S21d.

[0085] S21b. Calculate the pixel mean and pixel mean square error of the normalized image, and determine the maximum and minimum grayscale values ​​based on the pixel mean and pixel mean square error. In specific applications, the difference between the pixel value of each pixel in the normalized image and the pixel mean (the pixel mean is essentially the grayscale mean, while the pixel value is the grayscale value) is first calculated, and then the variance of the difference between the pixel value of each pixel in the normalized image and the pixel mean is used as the pixel mean square error.

[0086] Meanwhile, this embodiment also discloses one of the calculation processes for the maximum and minimum grayscale values, namely: first, obtain the grayscale weight (which may be, but is not limited to, set to 0.8), and calculate the product between the grayscale weight and the mean square error of the pixels as the grayscale parameter; then, take the difference between the mean pixel value and the grayscale parameter as the minimum grayscale value, and take the sum between the mean pixel value and the grayscale parameter as the maximum grayscale value.

[0087] Thus, after calculating the maximum and minimum gray values, the gray adjustment factor for each pixel in the normalized image can be calculated based on these values. The calculation process is shown in step S21c below.

[0088] S21c. Based on the maximum and minimum gray values, determine the gray adjustment factor for each pixel in the normalized image. In specific applications, for any pixel in the normalized image, if the gray value of any pixel is less than or equal to the minimum gray value, then the gray adjustment factor for that pixel is determined to be 0. Similarly, if the gray value of any pixel is greater than or equal to the maximum gray value, then the gray adjustment factor for that pixel is set to 1. If the gray value of any pixel is between the minimum and maximum gray values, then calculate the first difference between the gray value of that pixel and the minimum gray value, and calculate the second difference between the maximum and minimum gray values. Finally, the ratio between the first difference and the second difference can be used as the gray adjustment factor for that pixel. Thus, the gray adjustment factor for each pixel in the normalized image can be calculated using the aforementioned method.

[0089] After obtaining the grayscale adjustment factor for each pixel in the normalized image, the grayscale of the normalized image can be adjusted, as shown in step S21d below.

[0090] S21d. The normalized image is subjected to grayscale adjustment processing using the grayscale adjustment factor of each pixel in the normalized image to obtain the grayscale adjusted image; in specific applications, this embodiment constructs an adaptive grayscale adjustment function to realize the grayscale adjustment of each pixel in the normalized image.

[0091] The adaptive grayscale adjustment function is illustrated below, using any pixel in a normalized image as an example:

[0092] (1)

[0093] In equation (1), This represents the adjusted grayscale value corresponding to any given pixel. This represents the grayscale value of any given pixel. This represents the grayscale adjustment factor corresponding to any given pixel. Indicates the grayscale stretching factor. This represents the grayscale retention factor, where, for example... The value is 0.7. Take 0.4.

[0094] Therefore, according to the aforementioned formula (1), the adaptive grayscale adjustment function in this embodiment has three terms, corresponding to three functions respectively. Among them, by analyzing the function curves, it can be seen that in the low grayscale region, the adaptive grayscale adjustment function is most affected by the first term, the dynamic range is stretched, and the overall grayscale value is increased; in the medium grayscale region, the three functions reach a dynamic balance, and the original grayscale value is well preserved; in the high grayscale region, the third term (i.e. The high grayscale region plays a dominant role, increasing the dynamic range and improving the contrast. It also reduces the grayscale value of the high grayscale region, thus improving the phenomenon of over-enhanced image.

[0095] Thus, by using the aforementioned step S21 and its sub-steps and employing an adaptive grayscale adjustment function, the grayscale of the infrared image can be adjusted, thereby improving the uneven distribution of shadows in the image.

[0096] After grayscale adjustment is completed, multi-scale filtering can be performed to obtain filtered images at different scales. In this embodiment, it is necessary to calculate the filtering weight and filtering parameters of each pixel in the grayscale adjusted image at each scale so as to complete the multi-scale filtering. The calculation process of the filtering weight and filtering parameters of each pixel at different scales is shown in step S22 below.

[0097] S22. Determine the filtering windows for each pixel in the grayscale adjusted image at different scales, and based on the filtering windows for each pixel at different scales, derive the filtering weights and filtering parameters for each pixel at different scales. In practical applications, first, construct a filtering window for each pixel in the grayscale adjusted image centered on it (e.g., 2×2, 3×3, 5×5, etc., different window sizes represent different filtering scales). Then, calculate the initial filtering weights for each pixel's filtering window based on the pixels within that window. Simultaneously, since pixel overlap may occur during the construction of the filtering window, at any scale, for any pixel in the grayscale adjusted image, a filtering window containing any pixel in the grayscale adjusted image can be selected. Based on the initial filtering weights of the selected filtering window, the filtering weights for any pixel in the grayscale adjusted image at any of the aforementioned scales can be obtained.

[0098] Specifically, taking any scale as an example, the calculation of the filter weight is illustrated in the following steps S22a to S22g.

[0099] S22a. For the j-th pixel in the grayscale adjusted image, take each pixel in the filter window at any scale as the target pixel.

[0100] After obtaining the target pixel, the coordinate vector can be constructed, as shown in step S22b below.

[0101] S22b. Construct a coordinate vector based on the pixel coordinates of the target pixel and the pixel coordinates of the j-th pixel. In this embodiment, the pixel coordinates of the j-th pixel are first calculated, and the differences between them and the pixel coordinates of each target pixel are obtained, thus obtaining several pixel coordinate differences (represented as (xj-xv, yj-yv), where xi and yj are the x and y coordinates of the j-th pixel, and xv and yv are the x and y coordinates of the target pixel). Then, the pixel coordinate differences are used to construct the coordinate vector. Thus, the coordinate vector contains J pixel coordinate differences.

[0102] After constructing the coordinate vector, the gradient covariance matrix of the filter window at any scale for the j-th pixel can be constructed. The construction process is shown in step S22c below.

[0103] S22c. Based on each pixel in the filtering window of the j-th pixel at any scale, construct the gradient covariance matrix of the filtering window of the j-th pixel at any scale. In specific applications, the horizontal and vertical gradients of each target pixel can be calculated (the Soble operator can be used for gradient operation). Then, the horizontal and vertical gradients of each pixel are used to construct gradient vectors and form a gradient matrix. Next, covariance operation is performed on the gradient matrix to obtain the gradient covariance matrix. The aforementioned gradient operation is a common technique in image processing, while covariance operation is a common method for matrix calculation. Therefore, the principles of both will not be elaborated further.

[0104] After constructing the gradient covariance matrix of the filter window of the j-th pixel at any scale, the corresponding initial filter weight can be calculated by combining the aforementioned coordinate vector. The calculation process is shown in step S22d below.

[0105] S22d. Using the gradient covariance matrix and the coordinate vector, calculate the initial filtering weight of the filtering window of the j-th pixel at any scale; in specific applications, for example, but not limited to, the following formula (2) can be used to calculate the aforementioned initial filtering weight.

[0106] (2)

[0107] In the formula, This represents the initial filter weights of the filter window for the j-th pixel at any given scale. Represents the gradient covariance matrix. Represents the coordinate vector, This represents the filter factor (which is a preset value). represents matrix determinant operations, and T represents transpose operations.

[0108] In this embodiment, the coordinate vector is a row vector; therefore, the product of the coordinate vector and the gradient covariance matrix is ​​another row vector (i.e., ...). Each line and (dot product of vectors), and then, After transposing, it becomes a column vector; therefore... The result of multiplication is a single numerical value.

[0109] Thus, based on the aforementioned formula (2), after calculating the initial filtering weight of the filtering window of the j-th pixel at any scale, the initial filtering weight of the remaining pixels in the grayscale adjustment image at any scale can be calculated, as shown in the following step S22e.

[0110] S22e. Increment j by 1, and re-select each pixel in the filter window of the j-th pixel at any scale as the target pixel until j equals J, thus obtaining the initial filter weight of the filter window of each pixel in the grayscale adjusted image at the stated scale, where the initial value of j is 1, and J is the total number of pixels in the grayscale adjusted image.

[0111] After calculating the initial filtering weight of the filtering window for each pixel in the grayscale adjusted image at any given scale through the aforementioned steps, the filtering weight of each pixel at any given scale can be calculated, as shown in steps S22f and S22g below.

[0112] S22f. For any pixel in the grayscale adjusted image, filter out the filter window containing the pixel at any scale from the filter windows of each pixel in the grayscale adjusted image, and use it as the target window. In this embodiment, as explained above, since the corresponding filter window is obtained with each pixel in the grayscale adjusted image as the center, there is a problem of pixel overlap in the filter window. That is, any pixel in the grayscale adjusted image may be contained in different filter windows. Therefore, it is necessary to filter out the filter window containing the pixel. Then, use the initial filter weight of the filter window containing the pixel to calculate the filter weight of the pixel at any scale. The calculation process is shown in step S22g below.

[0113] S22g. Based on the initial filtering weights corresponding to the target window, the filtering weight of any pixel at any scale is calculated, and after polling all pixels in the grayscale adjusted image, the filtering weight of each pixel at any scale is obtained; in this embodiment, the average of the initial filtering weights of the target window is used as the filtering weight of any pixel at any scale.

[0114] Therefore, through the aforementioned steps S22a to S22g, the filtering weight of each pixel in the grayscale adjusted image at any given scale can be calculated; thus, by changing the size of the filtering window and using the same method, the filtering weight of each pixel in the grayscale adjusted image at different scales can be calculated.

[0115] After calculating the filtering weights of each pixel in the grayscale adjusted image at different scales, the filtering parameters can be calculated. The calculation process for the filtering parameters is the same as that for the filtering weights: first, obtain the filtering window for each pixel in the grayscale adjusted image at any scale; then, calculate the initial filtering parameters for each pixel based on the filtering window at any scale; next, for any pixel in the grayscale adjusted image, select the filtering window containing that pixel from all the filtering windows at any scale in the image, and use it as the designated window; finally, use the mean of the initial filtering parameters of the designated window as the filtering parameters for that pixel in the grayscale adjusted image at that scale.

[0116] The formula for calculating the initial filtering parameters of the j-th pixel in the grayscale adjusted image at any scale is as follows:

[0117] (3)

[0118] In formula (3), This represents the initial filtering parameters for the j-th pixel at any scale. Let $\mathbf{j}$ represent the grayscale variance and grayscale mean of the $j$-th pixel within the filter window at any scale. denoted as regularization factor; thus, based on the aforementioned formula (3), the initial filtering parameters of each pixel in the grayscale adjusted image at any given scale can be calculated; then, by changing the size of the filtering window and in the same manner, the initial filtering parameters of each pixel in the grayscale adjusted image at different scales can be calculated; based on this, the filtering parameters of each pixel in the grayscale adjusted image at different scales can be obtained.

[0119] After obtaining the filtering weights and filtering parameters of each pixel in the grayscale adjusted image at different scales, multi-scale filtering processing can be performed, as shown in step S23 below.

[0120] S23. Using the filtering weights and parameters of each pixel at different scales, the grayscale adjusted image is subjected to multi-scale filtering to obtain several filtered images; in this embodiment, taking any scale as an example, the filtered image of the grayscale adjusted image at any scale is as follows: In the formula, Let be the grayscale value of the j-th pixel in the filtered image at any scale of the grayscale-adjusted image. To adjust the grayscale value of the j-th pixel in the image, This represents the filtering weight of the j-th pixel at any given scale. Let represent the filtering parameters for the j-th pixel at any scale; thus, based on the aforementioned filtering formula, multi-scale filtering processing of grayscale adjusted images can be completed.

[0121] After obtaining filtered images at different scales, a base image layer and a detail image layer can be generated, as shown in step S24 below.

[0122] S24. Perform weighted fusion processing on several filtered images to obtain the base image layer, and subtract the base image layer from the infrared image to obtain the detail image layer; in this embodiment, the weights of each filtered image can be obtained first, and then each filtered image can be multiplied by its respective weight and summed to obtain the base image layer; finally, the base image layer can be obtained by subtracting the base image layer from the infrared image.

[0123] Therefore, after completing the layering of the infrared image through the aforementioned steps S21 to S24, the base image layer and the detail image layer can be processed separately. In this embodiment, the base image layer is enhanced by using its corresponding salient and non-salient features, as shown in steps S3 and S4 below.

[0124] S3. Based on the base image layer, generate a first feature map and a second feature map, wherein the first feature map is used to highlight background pixels in the base image layer, and the second feature map is used to highlight non-background pixels in the base image layer; in specific implementations, for example, but not limited to, the following steps S31 to S36 can be used to generate the first feature map and the second feature map.

[0125] S31. For the i-th pixel in the basic image layer, determine several neighborhood windows of the i-th pixel, wherein each neighborhood window has a different size; in specific applications, the size of the neighborhood window can be preset, such as 2×2, 4×4, 8×8, etc.; of course, other sizes of neighborhood windows can also be selected, and it is not limited to the above examples.

[0126] After obtaining several neighborhood windows of the i-th pixel, the initial feature value of the i-th pixel can be calculated. The calculation process is shown in step S32 below.

[0127] S32. Calculate the average coordinates of all pixels within each neighborhood window, and calculate the initial feature value of the i-th pixel based on the pixel coordinates of the i-th pixel and the average coordinates within each neighborhood window. In this embodiment, the distance between the i-th pixel coordinates and the average coordinates within each neighborhood window is calculated (i.e., calculated based on the coordinate distance calculation formula). Then, the distances between the i-th pixel coordinates and the average coordinates within each neighborhood window are summed to obtain the total distance. Finally, the total distance is normalized (linear normalization can be used) to obtain the initial feature value of the i-th pixel.

[0128] After obtaining the initial feature value of the i-th pixel, feature mapping can be performed, as shown in step S33 below.

[0129] S33. Perform feature mapping processing on the initial feature value of the i-th pixel to obtain the feature value of the i-th pixel; in this embodiment, the larger the feature value of the i-th pixel, the higher the importance of the i-th pixel, that is, the greater the probability of it being a region of interest (battery region).

[0130] For example, the following formula (4) can be used to calculate the feature value of the i-th pixel.

[0131] (4)

[0132] In equation (4), This represents the feature value of the i-th pixel. This represents the initial feature value of the i-th pixel. This represents the feature mapping factor (with a value between 10 and 20). and Both represent mapping bias, with values ​​of 0.2-0.6 and 0.1 respectively.

[0133] Thus, after calculating the feature value of the i-th pixel using the aforementioned formula (4), the feature values ​​of the remaining pixels in the basic image layer can be calculated, as shown in step S34 below.

[0134] S34. Increment i by 1 and redetermine several neighborhood windows of the i-th pixel until i equals n, thus obtaining the feature value of each pixel in the base image layer; after obtaining the feature value of each pixel in the base image layer, grayscale mapping can be performed, as shown in step S35 below.

[0135] S35. Perform grayscale mapping on the feature values ​​of each pixel in the base image layer to obtain a second feature map for highlighting non-background pixels after grayscale mapping. In this embodiment, for example, but not limited to, multiplying the feature value of each pixel by 255 and rounding it down, the second feature map can be obtained. At this time, the higher the grayscale value in the second feature map, the greater its importance, and the higher the probability that it is a pixel in the target, that is, the salient area, that is, the area of ​​interest (battery area).

[0136] After obtaining the second feature map, it is inverted to obtain the first feature map, as shown in step S36 below.

[0137] S36. Invert the second feature map to obtain the first feature map. In this embodiment, the gray value of each pixel in the second feature map can be subtracted from 255 to obtain the first feature value. At this time, the smaller the gray value of the pixel in the second feature map (i.e., non-target, non-significant area, i.e., background area), the larger the gray value. At this time, the first feature map that highlights the background pixel is obtained.

[0138] Therefore, after obtaining the salient and non-salient features of the basic image layer through the aforementioned steps S31 to S36, the contrast enhancement of the background and target of the basic image layer can be performed, as shown in step S4 below.

[0139] S4. Based on the first feature map and the second feature map, the base image layer is subjected to contrast enhancement processing of the target and the background to obtain the enhanced base image layer; in specific implementation, the contrast enhancement process may be, but is not limited to, the steps S41 to S44 below.

[0140] S41. Perform local histogram equalization and global histogram equalization on the base image layer to obtain a first initial enhanced image and a second initial enhanced image, respectively. In this embodiment, local histogram equalization can effectively improve the contrast of local areas of the image and highlight local details, while global histogram equalization can improve the overall contrast of the image and improve the brightness distribution of the image. However, local histogram equalization can introduce blocky effects, resulting in unnatural textures in the image, while global histogram equalization may lose local details, resulting in overly bright or dark areas in the image. Therefore, this embodiment uses the aforementioned salient and non-salient features to perform different enhancement processes on the salient and non-salient areas in the base image layer, respectively.

[0141] Optionally, this embodiment provides an improved local histogram equalization processing method, the process of which is shown in the following steps S41a to S41e.

[0142] S41a. Divide the base image layer into multiple image blocks and generate a histogram for each image block.

[0143] After obtaining the histograms of each image block, histogram cropping can be performed. Traditional techniques typically use a fixed equalization threshold, which is selected based on experience. If the threshold is set too high, over-enhancement will occur; if it is set too low, under-enhancement will occur. Even if an intermediate value is used, uneven brightness and darkness will result. Therefore, this embodiment proposes an adaptive histogram equalization threshold to avoid the problem of poor enhancement effect caused by the use of a fixed equalization threshold in traditional techniques.

[0144] In this embodiment, the histogram equalization threshold of each image block is adaptively calculated based on the grayscale range and pixel ratio of each image block. The calculation process is shown in steps S41b and S41c below.

[0145] S41b. For any image block, select the maximum pixel value from the image block and calculate the ratio between each pixel in the image block and the maximum pixel value to obtain several pixel ratios.

[0146] After calculating a certain pixel ratio, the histogram equalization threshold of any image block can be calculated by combining the grayscale range of any image block, as shown in step S41c below.

[0147] S41c. Based on several pixel ratios and the grayscale range of any image block, calculate the histogram equalization threshold of any image block, and obtain the histogram equalization threshold of each image block after polling all image blocks; in specific applications, for example, but not limited to, the following formula (5) can be used to calculate the histogram equalization threshold of any image block.

[0148] (5)

[0149] In equation (5), This represents the histogram equalization threshold for any given image block. This represents the total number of pixels in any given image block. The grayscale range of any image block can be, but is not limited to, the maximum grayscale level within the grayscale range of the histogram corresponding to that image block. For example, assuming the grayscale range of its histogram is [100, 200], then... Then take 200; This represents the equilibrium weight, with a value of 0.5. This represents the variance of a certain pixel ratio.

[0150] Thus, based on the aforementioned formula (5), after calculating the histogram equalization threshold of each image block, the histogram of each image block can be cropped, as shown in step S41d below.

[0151] S41d. Based on the histogram equalization threshold of each image block, each histogram is cropped, and the cropped portion of each histogram is allocated to the uncropped portion within each histogram to obtain each cropped histogram. In this embodiment, for any histogram of an image block, the portion of the histogram of the image block that is higher than its corresponding histogram equalization threshold is cropped, and then the cropped portion is evenly allocated to the uncropped portion within each histogram (for example, assuming that U pixels are cropped, and the uncropped portion has a total of S gray levels, then the number of pixels allocated to each gray level is U / S, that is, assuming that the gray level is 100, originally corresponding to 10 pixels, now allocated to 2 pixels, at this time the gray level 100 corresponds to 12 pixels), thereby obtaining each cropped histogram.

[0152] After obtaining the various cropped histograms, a first initial enhanced image can be generated based on them, as shown in step S41e below.

[0153] S41e. The first initial enhanced image is generated using each cropped histogram. In this embodiment, each cropped histogram is mapped to an image block, and then the images are stitched together to obtain the first initial enhanced image. Of course, mapping histograms to original image blocks is a common technique for histogram equalization, and its principle will not be elaborated here.

[0154] Thus, through the aforementioned steps S41a to S41e, local histogram equalization processing of the basic image layer can be achieved based on the adaptive histogram equalization threshold; then, the contrast enhancement between the target and the background can be performed by combining the aforementioned first feature map and second feature map, as shown in step S42 below.

[0155] S42. Based on the first feature map and the second feature map, generate a first mask image and a second mask image; in this embodiment, the first feature map is directly binarized to obtain the first mask image, and the second feature map is binarized to obtain the second mask image; then, mask processing can be performed on the aforementioned first initial enhancement and second initial enhancement images respectively, as shown in step S43 below.

[0156] S43. Using the second mask image, the first initial enhancement image is masked to obtain a first processed image, and using the first mask image, the second initial enhancement image is masked to obtain a second processed image. In this embodiment, the second mask image is directly multiplied by the first initial enhancement image to obtain the first processed image; similarly, the first mask image is multiplied by the second initial enhancement image to obtain the second processed image. The reason for masking is that by using salient and non-salient feature maps as masks, the images after local histogram equalization and global histogram equalization can be processed respectively. Different enhancement processing can be performed on salient and non-salient regions in the image. That is, salient features can be used to more effectively highlight the details in the base image layer, while using non-salient features as masks can improve the background brightness distribution and avoid the background being too bright or too dark, thereby achieving the purpose of suppressing the background.

[0157] After the image masking process is completed, an enhanced base image layer can be generated based on the processed image, as shown in step S44 below.

[0158] S44. Based on the first processed image and the second processed image, the enhanced base image layer is generated; in this embodiment, the enhanced base image layer is obtained by adding the first processed image and the second processed image together.

[0159] Thus, through the aforementioned steps S41 to S44, the contrast enhancement of the basic image layer can be completed; then, the detail enhancement of the detail image layer can be performed, and the processing procedure is shown in step S5 below.

[0160] S5. Perform detail enhancement processing on the detail image layer to obtain the enhanced detail image layer; in specific applications, this embodiment calculates the enhancement factor of each pixel in the detail image layer, and then obtains the enhanced detail image layer based on the enhancement factor of each pixel, as shown in steps S51 to S55 below.

[0161] S51. For the m-th pixel in the detail image layer, obtain the neighboring pixels of the m-th pixel; in this embodiment, the neighboring pixels of the m-th pixel are the pixels within the neighborhood window centered on the m-th pixel, wherein the size of the neighborhood window can be set to 3×3.

[0162] After obtaining the neighboring pixels of the m-th pixel, the enhancement parameters of the m-th pixel can be calculated, as shown in step S52 below.

[0163] S52. Calculate the local grayscale mean based on the grayscale values ​​of the adjacent pixels of the m-th pixel, and calculate the enhancement parameter of the m-th pixel based on the local grayscale mean. In this embodiment, the average grayscale value of the adjacent pixels of the m-th pixel is used as the local grayscale mean, and then the corresponding enhancement parameter is calculated according to the following formula (6).

[0164] (6)

[0165] In equation (6), This represents the enhancement parameters of the m-th pixel. This represents the local grayscale mean.

[0166] After calculating the enhancement parameters of the m-th pixel based on the aforementioned formula (6), its corresponding enhancement factor can be calculated by combining its gray value. The calculation process is shown in step S53 below.

[0167] S53. Calculate the enhancement factor of the m-th pixel based on the gray value and enhancement parameters of the m-th pixel. In specific applications, the enhancement factor of the m-th pixel can be calculated using, but is not limited to, the following formula (7).

[0168] (7)

[0169] In formula (7), Let m be the enhancement factor for the m-th pixel. Let be the grayscale value of the m-th pixel.

[0170] After calculating the enhancement factor of the m-th pixel based on the aforementioned formula (7), the m-th pixel can be enhanced accordingly, as shown in step S54 below.

[0171] S54. Using the enhancement factor, the m-th pixel is enhanced to obtain the enhanced m-th pixel. In this embodiment, the gray value of the enhanced m-th pixel is calculated using the gray value of the m-th pixel as the base and the enhancement factor as the exponent. In this way, the enhancement of each of the remaining pixels in the detail image layer can be completed in the same manner as described above, as shown in step S55 below.

[0172] S55. Increment m by 1 and reacquire the adjacent pixels of the m-th pixel until m equals M, thus obtaining the enhanced detail image layer, where the initial value of m is 1 and M is the total number of pixels in the detail image layer.

[0173] Thus, through the aforementioned steps S51 to S55, the enhancement processing of the detail image layer can be completed; then, the enhanced base image layer can be combined to generate an enhanced infrared image, as shown in step S6 below.

[0174] S6. Using the enhanced detail image layer and the enhanced base image layer, an enhanced infrared image is generated. In this embodiment, the enhanced detail image layer and the enhanced base image layer are first weighted and summed to obtain an initial enhanced infrared image. Then, the initial enhanced infrared image is weighted and summed with the original infrared image to obtain the enhanced infrared image.

[0175] After obtaining the enhanced infrared image, image recognition can be performed to obtain the current temperature detection result of the two-wheeled electric vehicle battery, as shown in step S7 below.

[0176] S7. Perform image recognition on the enhanced infrared image to obtain the current temperature detection result of the two-wheeled electric vehicle battery, and compare the current temperature detection result with the historical temperature detection result to obtain the battery temperature change result; in this embodiment, for example, but not limited to, a battery detection model can be used to perform target recognition on the enhanced infrared image to extract the battery area in the enhanced infrared image; then, based on the conversion formula between the gray value of the pixel in the battery area and the temperature, the temperature distribution of the battery area is obtained; finally, based on the temperature distribution, the current temperature detection result is obtained, wherein the current temperature detection result may include the average temperature, the highest / lowest temperature, and the temperature standard deviation.

[0177] The formula for converting the grayscale value of a pixel to temperature is as follows:

[0178] In the formula, F represents the grayscale value of a pixel. This represents the temperature value corresponding to a pixel. This is the environmental noise compensation value. Indicates the sensor response coefficient. It is the Stefan constant. Emissivity (i.e., the ratio of the actual radiant energy on the battery surface to the radiant energy of an ideal blackbody at the same temperature) is typically taken as 0.85-0.95.

[0179] Thus, after obtaining the current temperature detection result of the two-wheeled electric vehicle battery using machine vision, it can be compared with the historical temperature detection results to obtain the battery temperature change result. The historical temperature detection result can be the previous battery temperature detection result (such as collecting infrared images every 30 seconds or 1 minute). By comparing the current temperature detection result with the previous battery temperature detection result, the battery temperature change can be determined. For example, but not limited to, comparing the average temperature. When the battery temperature change value exceeds the change threshold, an alarm can be triggered and the charging power of the two-wheeled electric vehicle can be disconnected to prevent battery safety accidents.

[0180] Therefore, through the machine vision-based battery temperature change detection method for two-wheeled electric vehicles described in detail in steps S1 to S7 above, this invention improves image contrast while effectively optimizing the detailed areas of the image. Based on this, the infrared image enhancement effect is improved, thereby improving the accuracy of battery temperature identification. Therefore, it is very suitable for large-scale application and promotion.

[0181] like Figure 2 As shown, the second aspect of this embodiment provides a hardware system for implementing the machine vision-based two-wheeled electric vehicle battery temperature change detection method described in the first aspect of the embodiment, comprising:

[0182] The acquisition unit is used to acquire infrared images of the batteries of two-wheeled electric vehicles.

[0183] A layering unit is used to perform layering processing on the infrared image to obtain a base image layer and a detail image layer.

[0184] The feature extraction unit is used to generate a first feature map and a second feature map based on the base image layer, wherein the first feature map is used to highlight background pixels in the base image layer, and the second feature map is used to highlight non-background pixels in the base image layer.

[0185] An enhancement unit is used to perform contrast enhancement processing on the base image layer based on the first feature map and the second feature map to obtain an enhanced base image layer.

[0186] The enhancement unit is used to perform detail enhancement processing on the detail image layer to obtain an enhanced detail image layer.

[0187] The enhancement unit is also used to generate an enhanced infrared image using the enhanced detail image layer and the enhanced base image layer.

[0188] The temperature recognition unit is used to perform image recognition on the enhanced infrared image to obtain the current temperature detection result of the two-wheeled electric vehicle battery, and compare the current temperature detection result with the historical temperature detection result to obtain the battery temperature change result.

[0189] The working process, working details and technical effects of the system provided in this embodiment can be found in the first aspect of the embodiment, and will not be repeated here.

[0190] like Figure 3 As shown, the third aspect of this embodiment provides a machine vision-based device for detecting temperature changes in the battery of a two-wheeled electric vehicle. Taking the device as an electronic device as an example, it includes: a memory, a processor, and a transceiver that are connected in sequence. The memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program and execute the machine vision-based method for detecting temperature changes in the battery of a two-wheeled electric vehicle as described in the first aspect of the embodiment.

[0191] For specific examples, the memory may include, but is not limited to, random access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out (FIFO) memory, and / or first-in-last-out (FILO) memory, etc.; specifically, the processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor may be implemented using at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), PLA (Programmable Logic Array). The processor may also include a main processor and a coprocessor. The main processor, also known as the CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state.

[0192] In some embodiments, the processor may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. For example, the processor may not be limited to microprocessors of the STM32F105 series, reduced instruction set computer (RISC) microprocessors, x86 architecture processors, or processors with integrated neural network processing units (NPUs). The transceiver may be, but is not limited to, a Wi-Fi transceiver, a Bluetooth transceiver, a General Packet Radio Service (GPRS) transceiver, a ZigBee (a low-power LAN protocol based on the IEEE 802.15.4 standard) transceiver, a 3G transceiver, a 4G transceiver, and / or a 5G transceiver. Furthermore, the device may also include, but is not limited to, a power module, a display screen, and other necessary components.

[0193] The working process, working details and technical effects of the electronic device provided in this embodiment can be found in the first aspect of the embodiment, and will not be repeated here.

[0194] The fourth aspect of this embodiment provides a storage medium that stores instructions containing the machine vision-based method for detecting temperature changes in a two-wheeled electric vehicle battery as described in the first aspect of the embodiment. That is, the storage medium stores instructions that, when executed on a computer, perform the machine vision-based method for detecting temperature changes in a two-wheeled electric vehicle battery as described in the first aspect of the embodiment.

[0195] The storage medium refers to a carrier for storing data, which may include, but is not limited to, floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or memory sticks. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

[0196] The working process, working details and technical effects of the storage medium provided in this embodiment can be found in the first aspect of the embodiment, and will not be repeated here.

[0197] The fifth aspect of this embodiment provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform the machine vision-based two-wheeled electric vehicle battery temperature change detection method as described in the first aspect of this embodiment, wherein the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.

[0198] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for detecting temperature changes in a two-wheeled electric vehicle battery based on machine vision, characterized in that, include: Acquire infrared images of the batteries of two-wheeled electric vehicles; The infrared image is processed into layers to obtain a base image layer and a detail image layer; Based on the base image layer, a first feature map and a second feature map are generated, wherein the first feature map is used to highlight background pixels in the base image layer, and the second feature map is used to highlight non-background pixels in the base image layer. Based on the first feature map and the second feature map, the base image layer is subjected to contrast enhancement processing between the target and the background to obtain the enhanced base image layer. The detail image layer is subjected to detail enhancement processing to obtain an enhanced detail image layer; An enhanced infrared image is generated using the enhanced detail image layer and the enhanced base image layer; Image recognition is performed on the enhanced infrared image to obtain the current temperature detection result of the two-wheeled electric vehicle battery, and the current temperature detection result is compared with the historical temperature detection result to obtain the battery temperature change result; Based on the first feature map and the second feature map, the base image layer is subjected to contrast enhancement processing to obtain an enhanced base image layer, including: The base image layer is subjected to local histogram equalization and global histogram equalization to obtain a first initial enhanced image and a second initial enhanced image, respectively. Based on the first feature map and the second feature map, a first mask image and a second mask image are generated; Using the second mask image, the first initial enhanced image is masked to obtain a first processed image, and using the first mask image, the second initial enhanced image is masked to obtain a second processed image; The enhanced base image layer is generated based on the first processed image and the second processed image.

2. The method according to claim 1, characterized in that, The infrared image is subjected to layer processing to obtain a base image layer and a detail image layer, including: The infrared image is subjected to grayscale adjustment processing to obtain a grayscale adjusted image; The filtering windows of each pixel in the grayscale adjusted image at different scales are determined, and based on the filtering windows of each pixel at different scales, the filtering weights and filtering parameters of each pixel at different scales are obtained. By utilizing the filtering weights and parameters of each pixel at different scales, the grayscale adjusted image is subjected to multi-scale filtering to obtain several filtered images. The base image layer is obtained by weighted fusion of several filtered images, and the detail image layer is obtained by subtracting the base image layer from the infrared image.

3. The method according to claim 2, characterized in that, The infrared image is subjected to grayscale adjustment processing to obtain a grayscale adjusted image, including: The infrared image is normalized to obtain a normalized image; Calculate the pixel mean and pixel mean square error of the normalized image, and determine the maximum and minimum gray values ​​based on the pixel mean and pixel mean square error. The grayscale adjustment factor for each pixel in the normalized image is determined based on the maximum and minimum grayscale values. The grayscale adjustment image is obtained by using the grayscale adjustment factor of each pixel in the normalized image.

4. The method according to claim 2, characterized in that, Based on the filtering windows of each pixel at different scales, the filtering weights of each pixel at different scales are obtained, including: For the j-th pixel in the grayscale adjusted image, each pixel in the filter window at any scale of the j-th pixel is taken as the target pixel. A coordinate vector is constructed based on the pixel coordinates of the target pixel and the pixel coordinates of the j-th pixel; Based on each pixel in the filtering window of the j-th pixel at any scale, construct the gradient covariance matrix of the filtering window of the j-th pixel at any scale. Using the gradient covariance matrix and the coordinate vector, the initial filtering weights of the filtering window for the j-th pixel at any scale are calculated. Increment j by 1, and re-select each pixel in the filter window of the j-th pixel at any scale as the target pixel until j equals J, to obtain the initial filter weight of the filter window of each pixel in the grayscale adjusted image at any scale, where the initial value of j is 1, and J is the total number of pixels in the grayscale adjusted image. For any pixel in a grayscale adjusted image, filter windows containing any pixel are selected from the filter windows of each pixel in the grayscale adjusted image at any scale, and used as the target window. Based on the initial filtering weights corresponding to the target window, the filtering weights of any pixel at any scale are calculated, and after polling all pixels in the grayscale adjusted image, the filtering weights of each pixel at any scale are obtained.

5. The method according to claim 1, characterized in that, Based on the base image layer, a first feature map and a second feature map are generated, including: For the i-th pixel in the base image layer, several neighborhood windows of the i-th pixel are determined, wherein each neighborhood window has a different size; Calculate the average coordinates of all pixels within each neighborhood window, and calculate the initial feature value of the i-th pixel based on the pixel coordinates of the i-th pixel and the average coordinates within each neighborhood window. The initial feature value of the i-th pixel is processed by feature mapping to obtain the feature value of the i-th pixel; Increment i by 1 and redetermine several neighborhood windows of the i-th pixel until i equals n, thus obtaining the feature value of each pixel in the base image layer. The feature values ​​of each pixel in the base image layer are grayscale mapped to obtain a second feature map for highlighting non-background pixels after grayscale mapping. The second feature map is inverted to obtain the first feature map.

6. The method according to claim 1, characterized in that, The base image layer is subjected to local histogram equalization to obtain a first initial enhanced image, including: The base image layer is divided into multiple image blocks, and a histogram of each image block is generated. For any image block, the maximum pixel value is selected from the image block, and the ratio between each pixel in the image block and the maximum pixel value is calculated to obtain several pixel ratios; Based on several pixel ratios and the grayscale range of any image block, the histogram equalization threshold of any image block is calculated, and after all image blocks have been polled, the histogram equalization threshold of each image block is obtained. Based on the histogram equalization threshold of each image block, each histogram is cropped, and the cropped part in each histogram is allocated to the uncropped part in each histogram to obtain each cropped histogram. The first initial enhanced image is generated using the various cropped histograms.

7. The method according to claim 1, characterized in that, The detail image layer is subjected to detail enhancement processing to obtain an enhanced detail image layer, including: For the m-th pixel in the detail image layer, obtain the neighboring pixels of the m-th pixel; Calculate the local grayscale mean based on the grayscale values ​​of the neighboring pixels of the m-th pixel, and then calculate the enhancement parameters of the m-th pixel based on the local grayscale mean. The enhancement factor of the m-th pixel is calculated based on the gray value and enhancement parameters of the m-th pixel. Using the enhancement factor, the m-th pixel is enhanced to obtain the enhanced m-th pixel; Increment m by 1 and reacquire the adjacent pixels of the m-th pixel until m equals M, thus obtaining the enhanced detail image layer, where the initial value of m is 1 and M is the total number of pixels in the detail image layer.

8. A machine vision-based battery temperature change detection system for two-wheeled electric vehicles, characterized in that, The apparatus is used to perform the machine vision-based method for detecting temperature changes in batteries of two-wheeled electric vehicles according to any one of claims 1 to 7, wherein the apparatus comprises: The acquisition unit is used to acquire infrared images of the batteries of two-wheeled electric vehicles; A layering unit is used to perform layering processing on the infrared image to obtain a base image layer and a detail image layer; The feature extraction unit is used to generate a first feature map and a second feature map based on the base image layer, wherein the first feature map is used to highlight background pixels in the base image layer, and the second feature map is used to highlight non-background pixels in the base image layer. An enhancement unit is configured to perform contrast enhancement processing on the base image layer based on the first feature map and the second feature map to obtain an enhanced base image layer. The enhancement unit is used to perform detail enhancement processing on the detail image layer to obtain an enhanced detail image layer; The enhancement unit is also used to generate an enhanced infrared image using the enhanced detail image layer and the enhanced base image layer; The temperature recognition unit is used to perform image recognition on the enhanced infrared image to obtain the current temperature detection result of the two-wheeled electric vehicle battery, and compare the current temperature detection result with the historical temperature detection result to obtain the battery temperature change result.

9. An electronic device, characterized in that, include: The system comprises a memory, a processor, and a transceiver connected in sequence for communication. The memory is used to store computer programs, the transceiver is used to send and receive messages, and the processor is used to read the computer programs and execute the machine vision-based method for detecting temperature changes in batteries of two-wheeled electric vehicles as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • High-dynamic infrared image adaptive enhancement and compression method

    CN115496695A