A method, device, terminal equipment and storage medium for detecting metal objects

By generating a hyperspectral reflectivity density image and analyzing its characteristics, the problem of low accuracy in detecting metal foreign matter in the prior art is solved, and higher detection accuracy is achieved.

CN115343774BActive Publication Date: 2025-04-11SHENZHEN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210810162.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-11
Publication Date
2025-04-11
Estimated Expiration
2042-07-11

AI Technical Summary

Technical Problem

The prior art has low accuracy when detecting metal foreign matters, especially when non-metallic materials are completely wrapped in metal foreign matters or have high hyperspectral similarity, it is difficult to accurately judge.

Method used

By acquiring the hyperspectral image of the area to be detected, a hyperspectral reflectivity density image is generated, a light intensity reflectivity specific gravity in different bands is described, and a metal object exists based on the image.

Benefits of technology

The accuracy of detecting metal foreign matter is improved, and the specific gravity of light intensity reflectivity in each position of the area to be detected can be considered in different wavelength bands, which significantly improves the misjudgment rate in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115343774B_ABST
    Figure CN115343774B_ABST
Patent Text Reader

Abstract

The present application is applicable to the technical field of metal detection, and provides a method, device, terminal device and storage medium for detecting metal objects, wherein the method comprises: obtaining a hyperspectral image of the area to be detected; generating a hyperspectral reflectance density image based on the hyperspectral image, wherein the hyperspectral reflectance density image is used to describe the proportion of the light intensity reflectance of each position in the area to be detected to the total light intensity reflectance under different wavebands; and determining whether there is a metal object in the area to be detected based on the hyperspectral reflectance density image. The present application scheme can improve the accuracy of detecting metal foreign bodies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the technical field of metal detection, and in particular, relates to a method, apparatus, terminal device and storage medium for detecting metal objects. Background Art

[0002] With the technological update and widespread promotion of electric vehicles, electric vehicles have been better developed. Power transmission is the biggest feature of electric vehicles. Compared with wired charging methods, wireless power transmission technology has the advantages of non-contact, simple operation and safe charging, so it is favored and concerned by the market. There are three main types of wireless power transmission technology, namely electromagnetic radiation, electric coupling and magnetic coupling. The main choice of the most popular and widely used wireless power transmission technology is magnetic coupling, also known as inductive power transmission, that is, power is transmitted by generating a strong alternating magnetic field between coils. Magnetic coupling technology has the advantages of high power, high efficiency and long transmission distance. However, if a metal foreign object (such as a key, coin, can, metal clip, screw or cigarette foil, etc.) falls into the charging area during the charging process, the metal foreign object will generate eddy currents due to the strong alternating magnetic field between the transmitting coil and the receiving coil, resulting in a decrease in the transmission efficiency of the charging power and may also cause a fire. Therefore, the wireless charging system must also have the ability to detect metal foreign objects.

[0003] The existing technology for detecting metal foreign bodies usually detects exposed metal foreign bodies. In practical applications, there are cases where non-metallic materials completely cover metal foreign bodies, and there are also cases where the hyperspectral characteristics of some non-metallic materials are highly similar to the hyperspectral characteristics of some metals. Both of the above situations may lead to misjudgment of the classifier, resulting in a low accuracy rate in detecting metal foreign bodies. Summary of the invention

[0004] The present application provides a method, apparatus, terminal device and storage medium for detecting metal objects to solve the problem of low accuracy in the prior art.

[0005] In a first aspect, the present application provides a method for detecting a metal object, comprising:

[0006] Acquire a hyperspectral image of the area to be detected;

[0007] Generate a hyperspectral reflectance density image according to the hyperspectral image, wherein the hyperspectral reflectance density image is used to describe the proportion of the light intensity reflectance at each position of the area to be detected in the total light intensity reflectance in different wavebands;

[0008] It is determined whether there is a metal object in the area to be detected according to the hyperspectral reflectance density image.

[0009] In a second aspect, the present application provides a device for detecting metal objects, comprising:

[0010] An image acquisition module, used to acquire a hyperspectral image of the area to be detected;

[0011] A density image generation module, used to generate a hyperspectral reflectance density image according to the hyperspectral image, wherein the hyperspectral reflectance density image is used to describe the proportion of the light intensity reflectance of each position of the area to be detected in the total light intensity reflectance in different bands;

[0012] A judgment module is used to determine whether there is a metal object in the area to be detected according to the high-spectral reflectance density image.

[0013] In a third aspect, the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0014] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0015] Compared with the prior art, the present application has the following beneficial effects: in the method of the present application, whether each target object is a metal object is determined based on the hyperspectral reflectance density image, taking into account the proportion of the light intensity reflectance at each position in the area to be detected in different bands to the total light intensity reflectance. Different from the attribute of hyperspectral reflectance, metal objects and non-metallic objects usually have a large difference in the attribute of hyperspectral reflectance density. Therefore, the above method is conducive to improving the accuracy of detecting metal foreign bodies, and to a certain extent solves the current problem of low accuracy in detecting metal foreign bodies.

[0016] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 This is a schematic diagram of a first implementation flow of the method for detecting metal objects provided in an embodiment of the present application;

[0019] Figure 2 This is a schematic diagram of a second implementation flow of the method for detecting metal objects provided in an embodiment of the present application;

[0020] Figure 3 This is a schematic diagram of a third implementation flow of the method for detecting metal objects provided in an embodiment of the present application;

[0021] Figure 4 It is a flowchart of step S3201 in the embodiment of the present application;

[0022] Figure 5 is a flow chart of step S3204 in an embodiment of the present application;

[0023] Figure 6 is a flow chart of step S3207 in an embodiment of the present application;

[0024] Figure 7 is a flow chart of step S3211 in an embodiment of the present application;

[0025] Figure 8 is a flow chart of step S3212 in an embodiment of the present application;

[0026] Fig. 9 is a structural block diagram of a device for detecting metal objects provided in an embodiment of the present application;

[0027] Fig.10 It is a schematic diagram of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0029] In order to detect metal foreign bodies in the charging area, in some existing schemes, a mutual inductance coupling model between the metal foreign body and the primary coil is first established, and then the influence of the metal foreign body on the model is analyzed, and then the possibility of the existence of the metal foreign body is judged based on the influence; in some other existing schemes, the field-based method refers to the use of an additional induction coil and its measurement circuit to detect the change in magnetic field distribution caused by the metal foreign body, and then the possibility of the existence of the metal foreign body is judged based on the change in magnetic field distribution; in some other existing schemes, the possibility of the existence of the metal foreign body is judged by a double-layer symmetrical sensing coil layout; in some other existing schemes, the possibility of the existence of the metal foreign body is judged by analyzing the situation where the high-frequency magnetic field generates strong eddy currents on the metal foreign body and causes a significant temperature rise; in practical applications, when the non-metallic material completely wraps the metal foreign body, or the hyperspectral similarity of some non-metallic and some metal hyperspectral is high, the accuracy of the existing technology in detecting metal foreign bodies is low; and both the field-based method and the detection scheme based on system parameters are difficult to detect tiny metal foreign bodies. Compared with the existing schemes, the embodiments of the present application provide a method, device, terminal device and storage medium for detecting metal objects, which can improve the accuracy of detecting metal foreign bodies.

[0030] In order to illustrate the technical solution proposed in this application, a specific embodiment is provided below for illustration.

[0031] It should be understood that when used in this specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0032] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0033] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0034] In addition, in the description of the present application, the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0035] Embodiment 1

[0036] The following is an explanation of the method for detecting metal objects provided by the embodiment of the present application. Figure 1 , Figure 1 A schematic diagram of the implementation process of the first implementation mode of the method is given. The method includes but is not limited to the following steps:

[0037] In step S100, a hyperspectral image of the area to be detected is acquired.

[0038] Specifically, the terminal device obtains the hyperspectral image of the area to be detected through the hyperspectral image sampling platform, wherein the hyperspectral image sampling platform includes a hyperspectral camera, the model of the hyperspectral camera can be SHIS VNIR, and the model of the hyperspectral camera lens can be ML-2825M-32F. When the above-mentioned hyperspectral camera and lens are used, the image resolution of the captured hyperspectral image can reach 2448×2048, the minimum resolution distance can reach 0.1 mm, the hyperspectral acquisition band can reach 51, the acquisition spectrum wavelength range can be 450 mm to 950 mm, the scanning accuracy can reach 1 nanometer, and the acquisition interval within the wavelength range can be 10 nanometers, thereby preliminarily improving the accuracy of the measured hyperspectral data. The area to be detected can be the charging area in the car wireless charging system or the detection area in the customs inspection system.

[0039] In practical applications, the surface of metal objects may be covered with impurities such as dust, which may reduce the accuracy of the measured hyperspectral data; at the same time, due to the processing accuracy errors of electronic devices, the hyperspectral camera may have a small system error. Therefore, in some possible implementations, the acquired hyperspectral image can be processed by mean filtering, where the window size used by the mean filtering can be 9×9 or other values, which are not limited here.

[0040] In step S200, a hyperspectral reflectance density image is generated according to the hyperspectral image.

[0041] Without loss of generality, in the prior art, classification applications based on hyperspectral imaging technology usually use hyperspectral images or hyperspectral reflectance images. However, hyperspectral images and hyperspectral reflectance images have the following defects in the application process: hyperspectral images ignore the proportion of different bands in the incident light intensity; hyperspectral reflectance images ignore the influence of the inclination of the reflecting surface and the shadow area on the hyperspectral reflectance curve; at the same time, for the same object, the hyperspectral reflectance of the object under different shadows will be completely different, but the hyperspectral reflectance density is highly similar. Therefore, in order to obtain the hyperspectral characteristics of the object material in a strict sense and improve the accuracy of detecting metal foreign bodies, the embodiment of the present application proposes the concepts of hyperspectral reflectance density and hyperspectral reflectance density image; wherein, the hyperspectral reflectance density image represents the hyperspectral reflectance density of each position in the area to be detected under different bands, and the hyperspectral reflectance density refers to: the proportion of light intensity reflectance to the total light intensity reflectance.

[0042] Specifically, when the environment is not completely dark, the hyperspectral reflectance density can be calculated using the following formula, and then the hyperspectral reflectance density image can be generated based on the result of the formula:

[0043]

[0044] In the formula, represents the hyperspectral reflectance density of the object indicated by the pixel coordinate (x, y) of the image at wavelength λ;

[0045]

[0046]

[0047] Among them, k0 represents the value of the channel number -1,

[0048] λ Δ is the selected wavelength range, that is, the difference between the selected minimum wavelength and the selected maximum wavelength;

[0049] λ0 is the starting wavelength, which is also the minimum wavelength selected;

[0050] Δλ is the wavelength interval;

[0051] As an example, when the minimum wavelength is 450 nanometers, the maximum wavelength is 900 nanometers, and Δλ is 10 nanometers, the wavelength λ0 corresponding to the first channel is 450 nanometers, and λ Δ is 450 nanometers, and ko is 50 accordingly (that is, there are 51 channels in total).

[0052] r0(λ0+kΔλ,x,y) represents r0(λ,x,y) when the wavelength λ is λ0+kΔλ;

[0053]

[0054] Among them, I0(λ,x,y) can represent the incident light intensity when there is no object in the detection area, and can represent the ambient light intensity when a standard calibration whiteboard with a reflectivity of 99% is placed;

[0055] R(λ,x,y) can represent the reflected light intensity of the object indicated by the (x,y) coordinates at wavelength λ in the detection area;

[0056] In some possible implementations, when in complete darkness, the hyperspectral reflectance can be calculated using the following formula:

[0057]

[0058] Wherein, B(λ,x,y) is a constant, which can represent the ambient light intensity obtained when the lens of the hyperspectral camera is completely covered. It can also represent the influence of dark current on the measurement result when the lens of the hyperspectral camera is completely covered, and is an offset that needs to be corrected. The definitions of other parameters in the calculation formula are consistent with those in non-completely dark conditions and will not be repeated here.

[0059] In some possible implementations, since there are some invalid characteristic bands in the hyperspectral bands, the reflectance density corresponding to each hyperspectral band can be subjected to hyperspectral correlation analysis, and the highly correlated bands can be selected as the classification basis by analyzing the correlation between each band and the category; since the variable distribution of the reflectance density is continuous and the category is discrete, the reflectance density can be discretized, and then the bands of each channel can be scored by the common method of measuring the correlation between discrete variables, and the obtained scoring results can be normalized and compared. Among them, the scoring means can be: F test, chi-square test or mutual information test. Through the above hyperspectral correlation analysis, it can be seen that in the wavelength of 450nm to 950nm, the bands with higher correlation are mainly concentrated in three bands, namely 480nm to 550nm, 580nm to 600nm and 680nm to 880nm. Therefore, the wavelengths of 32 channels are selected as correlation hyperspectral features to assist in generating hyperspectral reflectance density maps; highly correlated bands can reduce data redundancy, reduce costs and improve classification accuracy; in practical applications, the 32 channels can be directly selected to skip the correlation calculation stage.

[0060] In step S300, it is determined whether there is a metal object in the area to be detected based on the hyperspectral reflectance density image.

[0061] Specifically, objects of different materials appear differently in the hyperspectral reflectance density image. In view of this, the terminal device can detect each pixel in the hyperspectral reflectance density image and determine whether there is a metal object in the area to be detected based on the detection results of each pixel.

[0062] Embodiment 2

[0063] In some possible implementations, in order to improve the accuracy of detecting metal foreign matter, based on the above-mentioned embodiment 1, the second embodiment of the present application also proposes another implementation of the method. Figure 2 , Figure 2 A schematic diagram of the implementation flow of the second embodiment is given.

[0064] In step S110 , a hyperspectral image of the area to be detected is acquired.

[0065] Specifically, step S110 is the same as step S100 in the first embodiment, and the specific description of step S100 can be referred to, which will not be repeated here.

[0066] In step S111 , a color image is generated by using at least three designated single-channel images in the hyperspectral image.

[0067] Exemplarily, the terminal device can extract single-channel images of three wavelengths in the hyperspectral image, and the channels of the single-channel images can respectively select the 680nm channel, 750nm channel and 820nm channel of the hyperspectral image, and then combine the three single-channel images into a red, green and blue (RGB) image, that is, a color image.

[0068] In step S112, target detection is performed on the color image.

[0069] Specifically, the terminal device can perform target detection processing on the color image based on a preset target detection model to obtain the target object. As an example only, the target detection model can be a YOLO v5 deep learning network.

[0070] Exemplarily, the YOLO v5 deep learning network is used to locate foreign objects in color images, wherein the YOLO deep learning network is one of the classic algorithms for target detection, and the YOLO v5 deep learning network can maintain high precision and high speed, and the weight file size is only one-ninth of the YOLO v4 deep learning network; the YOLO v5 deep learning network is used to locate and classify foreign objects, and metal foreign objects wrapped or covered by non-metallic materials can be judged through information such as shape, texture and color, thereby improving the comprehensiveness of metal foreign object detection; at the same time, the YOLO v5 deep learning network is more suitable for situations with high requirements on the accuracy and real-time performance of metal foreign object detection, such as electric vehicle wireless charging systems; in order to improve the adaptability of the YOLO v5 deep learning network, the YOLO v5 deep learning network can be trained; in the training process of the YOLO v5 deep learning network, the CIoU function can be used as the loss function of the bounding box.

[0071] Without loss of generality, in order to avoid subsequent operations on pixels in the entire area, after obtaining the target object, only the selected target area can be considered, reducing the consideration of invalid areas, thereby improving the detection speed and the execution efficiency of subsequent steps.

[0072] In step S210 , if there are target objects in the color image, a hyperspectral reflectance density area image corresponding to each target object is determined according to the image position information of each target object and the hyperspectral image.

[0073] Specifically, after training the YOLO v5 deep learning network, the YOLO v5 deep learning network can output two classification results, namely metal objects and objects of unknown classification category. When the existence of the unknown classification category object, that is, the target object, is detected, the following scheme can be adopted: according to the image position information and the hyperspectral image of each target object, the hyperspectral reflectance density area image corresponding to each target object is determined.

[0074] In some possible implementations, since in the actual application of automotive wireless charging, there may be cases where encapsulated metals are located in the charging area, and these encapsulated metals usually have unique shapes, such as paper clips, these encapsulated metals are defined as metal categories in advance.

[0075] In step S310 , it is determined whether each target object belongs to a metal category according to the high spectral reflectance density region image corresponding to each target object.

[0076] Specifically, whether each target object belongs to the metal category is determined based on the hyperspectral reflectance density area image corresponding to each target object. Because the detection range is changed from the hyperspectral reflectance density image to the hyperspectral reflectance density area image, and the hyperspectral reflectance density area image is actually a part of the hyperspectral reflectance density image, this step can greatly reduce the redundant information of the hyperspectral reflectance density image, thereby improving the detection efficiency while ensuring the detection accuracy.

[0077] Embodiment 3

[0078] In some possible implementations, in order to further improve the accuracy of metal foreign matter detection, based on the above-mentioned embodiment 2, the third embodiment of the present application also proposes another implementation of the method. Figure 3 , Figure 3 A schematic diagram of the implementation flow of the third embodiment is given.

[0079] In step S120, a hyperspectral image of the area to be detected is acquired.

[0080] In step S121 , a color image is generated by using at least three designated single-channel images in the hyperspectral image.

[0081] In step S122, target detection is performed on the color image.

[0082] In step S220 , if there are target objects in the color image, a hyperspectral reflectance density area image corresponding to each target object is determined according to the image position information of each target object and the hyperspectral image.

[0083] Specifically, step S120 is the same as step S110 of embodiment 2, step S121 is the same as step S111 of embodiment 2, step S122 is the same as step S112 of embodiment 2, and step S220 is the same as step S210 of embodiment 2. Please refer to the corresponding specific descriptions, which will not be repeated here.

[0084] In step S230 , if there are target objects in the color image, the color region image corresponding to each target object is determined according to the image position information and the color image of each target object.

[0085] In step S320, it is determined whether each target object belongs to the metal category according to the high spectral reflectance density region image and the color region image corresponding to each target object.

[0086] Specifically, the terminal device determines whether each target object belongs to the metal category based on the hyperspectral reflectance density area image and color area image corresponding to each target object, taking into account not only the characteristic information contained in the hyperspectral reflectance density area image, but also the characteristic information contained in the color area image, thereby further improving the detection accuracy while improving the detection efficiency.

[0087] In some possible implementations, since the terminal device performs the same operation for each target object, the following takes any target object as an example to explain and illustrate the process of determining whether the target object is a metal object. Figure 4 Step S320 includes but is not limited to the following three sub-steps:

[0088] In step S3201, a texture feature image corresponding to the color target area image is calculated.

[0089] Specifically, the color target area image represents the color area image corresponding to the target object; the texture feature image can be embodied by the Chebyshev moment (TM), which can provide image-specific geometric information and can be used to describe the global characteristics of the object shape and texture. The discrete Chebyshev polynomial is a set of orthogonal polynomials defined on discrete coordinates; while the Zernike polynomials in the prior art are defined on polar coordinates, and there are coordinate approximation errors in the calculation process. Since the common geometric moments are simple to calculate, the simplicity of Zernike makes it difficult to describe more information of the image. Therefore, the TM moment is selected to measure the information of the texture of the foreign body.

[0090] In some possible implementations, a texture feature image may be constructed based on the vertical features used to describe the color target area image, the horizontal features used to describe the color target area image, and the overall distribution features used to describe the color target area image; TM may be expressed by the following formula:

[0091] TM=[TM 01 ,TM 02 ,…,TM 08 ,TM 10 ,TM 20 ,…,TM 80 ,TM 00 ,TM 11 ,…,TM 88 ],

[0092] In the formula, TM can represent the texture information of the image and can be used as an effective image feature descriptor;

[0093] TM 01 ,TM02 ,…,TM 08 Represents the vertical characteristics of the color target area image;

[0094] TM 10 ,TM 20 ,…,TM 80 Represents the horizontal characteristics of the color target area image;

[0095] TM 00 ,TM 11 ,…,TM 88 Represents the uniform features of the color target area image;

[0096] Among them, low-order moments are used to describe the overall shape of the image, and high-order moments are used to describe the detailed information of the image.

[0097] In some possible implementations, since in actual applications, metal foreign bodies are most likely three-dimensional and the reflective surface has a certain inclination, the illumination intensity of each surface of the metal foreign body will be inconsistent, weakening the texture. Therefore, in order to eliminate the influence of light intensity, each color target area image can be histogram-averaged before constructing a TM.

[0098] In step S3202, the texture feature image and the density target area image are fused to obtain a fused area feature image.

[0099] Specifically, the density target area image represents the high spectral reflectance density area image corresponding to the target object. In an embodiment of the present application, the terminal device can splice the texture feature image and the density target area image in the dimension of the channel to obtain a fused area feature image. Generally speaking, the number of channels involved in the fused area feature image is the sum of the number of channels of the texture feature image and the density target area image.

[0100] In step S3203, the fused region feature image is detected by a classifier to determine whether the target object belongs to the metal category.

[0101] Specifically, the classifier can be a support vector machine (SVM), and the most commonly used Gaussian kernel can be selected as the kernel function of SVM. SVM can use kernel techniques to map data to a high-dimensional feature space through nonlinear transformation, and try to find a linear classification hyperplane in this space. Compared with linear kernel functions and polynomial kernel functions, Gaussian kernel functions have better classification effects in nonlinearly separable samples.

[0102] In some possible implementations, to determine whether a target object belongs to the metal category, see Figure 5Step S3203 includes but is not limited to the following three sub-steps:

[0103] In step S3204, each pixel in the fused region feature image is classified by a classifier.

[0104] Specifically, the terminal device classifies each pixel in the feature image of the fusion region through a support vector machine. The support vector machine can be pre-trained with a binary classification task so that the classification results output by the support vector machine can have two possibilities, namely, metal category and non-metal category. That is, for any pixel, the pixel can be classified as a metal category or a non-metal category.

[0105] In step S3205, if there is a target pixel in the fused region feature image, it is determined that the target object belongs to the metal category.

[0106] Specifically, the target pixel point represents a pixel point classified into the metal category; as long as the target pixel point exists in the fusion region feature image, it is determined that the target object belongs to the metal category.

[0107] In step S3206, if there is no target pixel in the fused region feature image, it is determined that the target object belongs to the non-metal category.

[0108] Specifically, as long as there is no target pixel in the fused regional feature image, it is determined that the target object belongs to the non-metal category.

[0109] In some possible implementations, since in practical applications, there are scattered misjudged pixels in the fused regional feature image, filtering is required; Figure 6 After step S3204, if there is a target pixel in the fused region feature image, for each target pixel, the method further includes but is not limited to the following sub-steps:

[0110] In step S3207, within the neighborhood of the target pixel, the number of pixels classified as metal is counted.

[0111] Specifically, the terminal device can count the number of pixels classified as metal in the neighborhood of the target pixel; the specific statistical means are existing technologies and will not be described in detail.

[0112] In step S3208, if the number is less than a preset number threshold, the target pixel point is reclassified into a non-metal category.

[0113] Specifically, if the number of pixels classified into the metal category is less than a preset threshold, the target pixel may be reclassified into the non-metal category.

[0114] For example, for any target pixel point P1: within a neighborhood with a size of 3×3 and centered on the target pixel point P1, the quantity threshold can be set to 4. That is, within the neighborhood with a size of 3×3, when there are less than 4 pixels classified as metal, the target pixel point P1 can be reset to the non-metal category. Through the above process, the noise caused by false detection can be effectively eliminated.

[0115] For some possible implementations, see Figure 7 Step S3201 includes but is not limited to the following three sub-steps:

[0116] In step S3211, the color target area image is segmented to obtain a plurality of color target area image blocks.

[0117] Specifically, the terminal device can segment the color target area image according to a preset size to obtain multiple color target area image blocks; since the correlation between texture features and color is low, the multiple color target area image blocks can be grayscale processed.

[0118] In step S3221, the texture features of each color target area image block are calculated.

[0119] Specifically, the terminal device may calculate the texture features of each grayscale processed color target area image block, thereby obtaining the surface properties of the color target area image block.

[0120] In step S3231, a texture feature image is obtained by splicing according to the texture features of each color target area image block.

[0121] Specifically, the terminal device obtains a texture feature image of each target object based on the texture features of each color target area image block, thereby obtaining the overall surface properties of the target object.

[0122] Accordingly, see Figure 8 Step S3202 includes but is not limited to the following two sub-steps:

[0123] In step S3212, down-sampling processing is performed on the density target area image to obtain a density target area down-sampled image.

[0124] Exemplarily, the terminal device may divide each density target area image into N×N size, randomly extract a pixel from each density target area image block of size N×N obtained by division, and then combine each pixel according to the position of each pixel in the density target area image block to obtain a density target area downsampled image; the size of each density target area downsampled image is consistent with the size of the corresponding texture feature image. Alternatively, the central pixel of each density target area image block of size N*N obtained by division may be directly extracted and combined to obtain a density target area downsampled image, and the specific method of downsampling is not limited here. As an example only, N may be 16.

[0125] In step S3222, the texture feature image and the density target area down-sampled image are fused to obtain a fused area feature image.

[0126] Specifically, the terminal device can fuse the texture feature image and the density target area down-sampled image, and then obtain a fused area feature image, thereby further improving the accuracy of detection.

[0127] The inventors conducted a series of tests on the method in this application, as follows:

[0128] Please refer to Table 1 and Table 2. Table 1 shows the test results of the prior art and various solutions proposed in the embodiments of the present application. Table 2 shows the comparison results between the solution proposed in the embodiments of the present application and the prior art.

[0129]

[0130] Table 1

[0131]

[0132] Table 2

[0133] It can be seen from Table 1 and Table 2 that the method for detecting metal objects proposed in the embodiment of the present application has a high accuracy rate and can meet the requirements of the electric vehicle wireless charging system for high accuracy of metal foreign body detection.

[0134] The implementation principle of a method for detecting metal objects in an embodiment of the present application is as follows: the terminal device first determines the color area image and the hyperspectral reflectance density area image corresponding to each target object through the hyperspectral image, then obtains the texture feature image through the color area image, and obtains the density target area image through the hyperspectral reflectance density area image, and then fuses the texture feature image and the density target area image to obtain a fused area feature image. When there are target pixels in the fused area feature image, it is determined that the target object belongs to the metal category, thereby achieving reliable detection of metal foreign matter.

[0135] It should be noted that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0136] The embodiment of the present application also provides a device for detecting metal objects. For ease of description, only the parts related to the present application are shown, such as Fig. 9 As shown, the device 900 includes,

[0137] An image acquisition module 901 is used to acquire a hyperspectral image of the area to be detected;

[0138] The density image generating module 902 is used to generate a hyperspectral reflectance density image according to the hyperspectral image, wherein the hyperspectral reflectance density image is used to describe the proportion of the light intensity reflectance of each position of the to-be-detected area to the total light intensity reflectance in different wavebands;

[0139] The judgment module 903 is used to determine whether there is a metal object in the area to be detected according to the hyperspectral reflectance density image.

[0140] It should be noted that the information interaction, execution process and other contents between the above-mentioned modules are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0141] The present application also provides a terminal device, such as Fig.10 As shown, the terminal device 10 of this embodiment includes: a processor 101, a memory 102, and a computer program 103 stored in the memory 102 and executable on the processor 101. When the processor 101 executes the computer program 103, the steps in the above-mentioned traffic processing method embodiment are implemented, for example Figure 1 Steps S100 to S300 shown; or, when the processor 101 executes the computer program 103, the functions of each module in the above device are implemented, for example Fig. 9 Functions of modules 901 to 903 are shown.

[0142] The terminal device 10 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server, and the terminal device 10 includes but is not limited to a processor 101 and a memory 102. Those skilled in the art will appreciate that Fig.10 It is only an example of the terminal device 10 and does not constitute a limitation of the terminal device 10. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device 10 may also include input and output devices, network access devices, buses, etc.

[0143] Among them, the processor 101 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.; the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0144] The memory 102 may be an internal storage unit of the terminal device 10, such as a hard disk or memory of the terminal device 10, or an external storage device of the terminal device 10, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device 10; further, the memory 102 may also include both an internal storage unit and an external storage device of the terminal device 10, and the memory 102 may also store a computer program 103 and other programs and data required by the terminal device 10, and the memory 102 may also be used to temporarily store data that has been output or is to be output.

[0145] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc.; the computer-readable medium may include: any entity or device that can carry computer program code, recording medium, USB flash drive, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0146] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, all equivalent changes made according to the methods, principles, and structures of the present application should be included in the protection scope of the present application.

Claims

1. A method for detecting a metal object, characterized in that: include: Acquire a hyperspectral image of the area to be detected; Generate a hyperspectral reflectance density image according to the hyperspectral image, wherein the hyperspectral reflectance density image is used to describe the proportion of the light intensity reflectance at each position of the area to be detected in the total light intensity reflectance in different wavebands; Generate a color image through at least three designated single-channel images in the hyperspectral image; Performing target detection on the color image; If there is a target object in the color image, determining a color area image corresponding to each target object according to the color image position information of each target object and the color image, and determining a high spectral reflectance density area image corresponding to each target object according to the high spectral reflectance density image position information of each target object and the high spectral reflectance density image; For each of the target objects: Segmenting the color target area image to obtain a plurality of color target area image blocks, wherein the color target area image refers to: a color area image corresponding to the target object; Calculating the texture features of each of the color target area image blocks; According to the texture features of each of the color target area image blocks, stitching is performed to obtain a texture feature image; Downsampling the density target area image to obtain a density target area downsampled image, wherein the size of the density target area downsampled image is consistent with the size of the texture feature image, and the density target area image refers to: a high spectral reflectance density area image corresponding to the target object; Fusing the texture feature image and the density target area down-sampled image to obtain a fused area feature image; The fusion region feature image is detected by a classifier to determine whether the target object belongs to the metal category.

2. The method according to claim 1, characterized in that The detecting the fusion region feature image by a classifier to determine whether the target object belongs to the metal category includes: Classifying each pixel in the fusion region feature image by the classifier; If there is a target pixel point in the fusion region feature image, it is determined that the target object belongs to the metal category, wherein the target pixel point is: a pixel point classified into the metal category; If the target pixel does not exist in the fusion region feature image, it is determined that the target object belongs to the non-metal category.

3. The method according to claim 2, characterized in that After classifying each pixel point in the fusion region feature image by the classifier, the method further includes: If the target pixel exists in the fusion region feature image, then for each target pixel: In the neighborhood of the target pixel, counting the number of pixels classified as metal; If the number is less than a preset number threshold, the target pixel point is reclassified into a non-metal category.

4. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.

5. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.