Image detection method and device, terminal equipment and storage medium

By extracting targets and blurring image data, blurred image data is generated, which solves the problems of slow acquisition speed and high cost of blurred lane line data and improves the performance of image detection models.

CN119048855APending Publication Date: 2024-11-29HAOMO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310612628.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-26
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

The slow speed and high cost of collecting fuzzy lane line data result in poor performance of image detection models.

Method used

By extracting targets from image data and generating binary images of the targets, fuzzy parameters are determined using fuzzy parameter calculation formulas, and the image data is then fuzzed to generate fuzzy image data. Finally, the fuzzy image data is used to train an image detection model.

Benefits of technology

It improves the acquisition speed of blurred image data, reduces costs, and enhances the detection performance of image detection models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119048855A_ABST
    Figure CN119048855A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of image processing, and provides an image detection method and device, terminal equipment and a storage medium, and the image detection method comprises the steps: obtaining image data; performing target extraction on the image data to obtain a target object binary image; based on the target object binary image and a preset number of times, fuzzy parameters are determined through a fuzzy parameter calculation formula, and the fuzzy parameters are used for determining fuzzy processing intensity; carrying out preset times of fuzzy processing on the binary image of the target object based on the fuzzy parameters to obtain fuzzy image data; and performing target object detection on the image data through an image detection model trained based on the blurred image data. The speed of collecting the blurred image data can be improved, the cost is reduced, and the detection performance of the image detection model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and in particular, relates to an image detection method, apparatus, terminal device and storage medium. Background Art

[0002] In the field of autonomous driving, image detection models are usually needed to detect lane lines, obstacles, traffic lights and other objects in visual perception images. The training of image detection models requires a large amount of labeled data. When encountering scenes with no data or a small amount of data, the detection effect of the image detection model will be poor. Fuzzy lane lines are one of the scenes with a small amount of data. In order to solve the problem of poor detection effect of fuzzy lane lines, it is usually necessary to collect fuzzy lane line data in a real environment to supplement the training data set. However, this method is slow and costly, and it is difficult to find fuzzy lane line data that meets the requirements, resulting in poor performance of the image detection model. Summary of the invention

[0003] The embodiments of the present application provide an image detection method, apparatus, terminal device and storage medium, which can solve the problems in the prior art of slow data collection speed and high cost of fuzzy lane lines, resulting in poor performance of the image detection model.

[0004] A first aspect of an embodiment of the present application provides an image detection method, comprising:

[0005] Get image data;

[0006] Performing target extraction on the image data to obtain a binary image of the target object;

[0007] Based on the target binary image and the preset number of times, a fuzzy parameter is determined by a fuzzy parameter calculation formula, and the fuzzy parameter is used to determine the fuzzy processing intensity;

[0008] Performing the fuzzy processing on the target binary image for the preset number of times based on the fuzzy parameter to obtain fuzzy image data;

[0009] The image data is subjected to target object detection using an image detection model trained based on the blurred image data.

[0010] Optionally, the performing target extraction on the image data to obtain a target binary image includes:

[0011] Performing semantic segmentation on the image data to obtain target object segmentation blocks;

[0012] If a pixel block in the target object segmentation block is a target object, the pixel block is set to a first pixel value; if the pixel block is a non-target object, the pixel block is set to a second pixel value;

[0013] Based on the pixel values ​​of each pixel block in the target object segmentation block, a target object binary image is obtained.

[0014] Optionally, after obtaining the target object binary image based on the pixel values ​​of each pixel block in the target object segmentation block, the method further includes:

[0015] Determine the color of each pixel block in the target binary image;

[0016] If the color of the pixel block is less than a preset threshold, the pixel block is re-determined as a non-target object.

[0017] Optionally, determining the fuzzy parameter by a fuzzy parameter calculation formula based on the target object binary image and a preset number of times includes:

[0018] Performing a closing operation on the target object binary image to obtain a target object closing operation result image;

[0019] Based on the target object binary image and the target object closed operation result image, determining the damage degree through a damage degree calculation formula, wherein the damage degree is used to characterize the damage degree of the target object in the image data;

[0020] Based on the damage degree, the preset number of times and the preset blur strength, a blur parameter is determined by a blur parameter calculation formula.

[0021] Optionally, after determining the fuzzy parameter by a fuzzy parameter calculation formula based on the damage degree, the preset number of times and the preset fuzzy strength, the method further includes:

[0022] Based on the damage degree and the preset blur strength, a smoothing parameter is determined by a smoothing parameter calculation formula, and the smoothing parameter is used to determine the smoothing processing strength.

[0023] Optionally, the performing the fuzzy processing on the target binary image for the preset number of times based on the fuzzy parameter to obtain fuzzy image data includes:

[0024] The target binary image is subjected to the preset number of fuzzy processing and random resetting based on the fuzzy parameters to obtain fuzzy image data.

[0025] Optionally, after the fuzzy processing is performed on the target binary image for the preset number of times based on the fuzzy parameter to obtain fuzzy image data, the method further includes:

[0026] The blurred image data is smoothed based on a smoothing parameter to obtain smoothed image data.

[0027] A second aspect of an embodiment of the present application provides an image detection device, including:

[0028] An image acquisition module, used for acquiring image data;

[0029] A target extraction module, used to extract the target from the image data to obtain a binary image of the target object;

[0030] A parameter determination module, used to determine a fuzzy parameter through a fuzzy parameter calculation formula based on the target binary image and a preset number of times, wherein the fuzzy parameter is used to determine the fuzzy processing intensity;

[0031] A fuzzy processing module, used for performing the fuzzy processing on the target binary image for the preset number of times based on the fuzzy parameters to obtain fuzzy image data;

[0032] The target detection module is used to detect targets on the image data using an image detection model trained based on the blurred image data.

[0033] A third aspect of an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image detection method as described above when executing the computer program.

[0034] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the image detection method described above is implemented.

[0035] The image detection method provided by the first aspect of the embodiment of the present application obtains a binary image of the target object by performing target extraction on the acquired image data, determines the fuzzy parameters through a fuzzy parameter calculation formula based on the binary image of the target object and a preset number of times, and performs fuzzy processing on the binary image of the target object a preset number of times based on the fuzzy parameters to obtain fuzzy image data. The fuzzy image data can be generated based on the original image data, thereby improving the speed of collecting fuzzy image data and reducing the cost. The image detection model can be trained by using the generated fuzzy image data to improve the detection performance of the image detection model.

[0036] It can be understood that the beneficial effects of the second, third and 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

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

[0038] Figure 1 A schematic diagram of a first process flow of an image detection method provided in an embodiment of the present application;

[0039] Figure 2 A second flow chart of the image detection method provided in the embodiment of the present application;

[0040] Figure 3 A third flow chart of the image detection method provided in the embodiment of the present application;

[0041] Figure 4 A fourth flow chart of the image detection method provided in the embodiment of the present application;

[0042] Figure 5 A schematic diagram of the structure of an image detection device provided in an embodiment of the present application;

[0043] Figure 6 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] 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.

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

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

[0047] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

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

[0049] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. "Multiple" means "two or more".

[0050] Currently, there is a problem that the data collection speed of blurred lane lines is slow and costly, resulting in poor performance of image detection models.

[0051] In response to the above problems, an embodiment of the present application provides an image detection method, which obtains a binary image of the target object by performing target extraction on the acquired image data, determines a fuzzy parameter through a fuzzy parameter calculation formula based on the binary image of the target object and a preset number of times, and performs fuzzy processing on the binary image of the target object a preset number of times based on the fuzzy parameter to obtain fuzzy image data. The fuzzy image data can be generated based on the original image data, thereby improving the speed of collecting fuzzy image data and reducing the cost. The image detection model can be trained with the generated fuzzy image data to improve the detection performance of the image detection model.

[0052] The image detection method provided in this application is exemplarily described below in conjunction with specific embodiments.

[0053] Embodiment 1

[0054] like Figure 1 As shown, the image detection method provided in this embodiment includes the following steps S11 to S15:

[0055] S11. Acquire image data.

[0056] In applications, the above-mentioned acquired image data may be original image data containing a target object to be detected in a real environment, such as original image data of lane lines and original image data of traffic lights in a real environment.

[0057] S12, performing target extraction on the image data to obtain a binary image of the target object.

[0058] In the application, since the image data obtained above may contain other background objects in addition to the target object, in order to accurately process the image data, it is necessary to extract the target object from the image data. The above target extraction of the image data to obtain a binary image of the target object can be to extract the image data of the target object-related part from the image data, and set different pixel values ​​for the pixel blocks of the target object and other parts. For example, the original image data of the lane line may contain background objects such as trees and the sky. After extracting the image data of the lane line-related part, different pixel values ​​are set for the pixel blocks of the lane line and the ground.

[0059] S13, based on the target binary image and the preset number of times, determining fuzzy parameters through a fuzzy parameter calculation formula, wherein the fuzzy parameters are used to determine the fuzzy processing intensity.

[0060] In applications, since the initial blur levels of different image data are very different, such as one image data is very clear and another image data is very blurry, if the same blur parameters are used to process the image data, it will result in an overly blurred or overly clear image. Therefore, different blur parameters can be determined according to different image data. The above-mentioned preset number of times can be a preset number of blur processing cycles, and the above-mentioned fuzzy parameter calculation formula can be a pre-constructed formula for calculating the fuzzy parameters. The above-mentioned determination of the fuzzy parameters by the fuzzy parameter calculation formula based on the target object binary image and the preset number of times can be based on the pixel values ​​of the pixel blocks in the above-mentioned target object binary image and the above-mentioned preset number of times, and the fuzzy parameters are calculated by the above-mentioned fuzzy parameter calculation formula.

[0061] S14, performing fuzzy processing on the target binary image for the preset number of times based on the fuzzy parameters to obtain fuzzy image data.

[0062] In the application, after determining the blur parameter, the above-mentioned target binary image can be blurred for a preset number of times based on the blur parameter. Image blur processing is a commonly used image processing technology, which reduces noise, details and unnecessary information in the image by blurring the details in the image. Specifically, Gaussian blur can be selected as the blur processing method. Gaussian blur simulates the blur effect of the human eye when viewing an object, so the image can still maintain a natural feeling after being blurred.

[0063] In applications, Gaussian blur can remove some noise in an image, making the image cleaner and clearer, because Gaussian blur smoothes the pixel values ​​in the image, thereby reducing the impact of noise. Gaussian blur can smooth the details in the image, but it does not change the overall features of the image, such as contours and edges. Therefore, using Gaussian blur can keep the original structure and shape of the image after blurring. Gaussian blur is relatively fast to calculate, especially for larger images, because Gaussian blur can be achieved through convolution operations, which can be efficiently calculated through algorithms such as fast Fourier transform.

[0064] S15. Perform target object detection on the image data using an image detection model trained based on the blurred image data.

[0065] In the application, after obtaining the above-mentioned blurred image data, the image detection model can be trained through the above-mentioned blurred image data, and the trained image detection model can be used to perform target object detection on the above-mentioned image data. For example, the lane line detection can be performed on the original image data of the lane line through the trained image detection model. If the lane line in the original image data of the lane line is relatively blurred, the image detection model can also detect it.

[0066] The image detection method provided in the embodiment of the present application obtains a binary image of the target object by performing target extraction on the acquired image data, determines the fuzzy parameters through a fuzzy parameter calculation formula based on the binary image of the target object and a preset number of times, and performs fuzzy processing on the binary image of the target object a preset number of times based on the fuzzy parameters to obtain fuzzy image data. The fuzzy image data can be generated based on the original image data, thereby improving the speed of collecting fuzzy image data and reducing the cost. The image detection model can be trained by using the generated fuzzy image data to improve the detection performance of the image detection model.

[0067] Embodiment 2

[0068] This embodiment is a further explanation of the first embodiment. For details of the same or similar parts as the first embodiment, please refer to the relevant description of the first embodiment, which will not be repeated here.

[0069] like Figure 2 As shown, in one embodiment, step S12 includes:

[0070] S21, performing semantic segmentation on the image data to obtain target object segmentation blocks.

[0071] In the application, the above-mentioned semantic segmentation of the image data to obtain the target object segmentation block can be performed by using a preset semantic segmentation model such as Mask2Former to semantically segment the above-mentioned image data, and the segmentation results are integrated to only retain the pixel segmentation block of the relevant part of the target object.

[0072] For example, semantic segmentation is performed on the original image data of lane lines, and only the results with lane line related labels ["LaneMarking-General", "Bike Lane"] are retained to obtain lane line segmentation blocks. Mask2Former is a Transformer-based semantic segmentation model used to solve the semantic segmentation problem in the field of computer vision. Compared with the traditional convolutional neural network semantic segmentation model, Mask2Former uses the Transformer's attention mechanism to better process long-distance contextual information and avoid the information loss that may be caused by the convolution operation in the convolutional neural network. It can achieve better performance than other semantic segmentation models and make the extraction of targets more accurate.

[0073] S22: If a pixel block in the target object segmentation block is a target object, the pixel block is set to a first pixel value; if the pixel block is a non-target object, the pixel block is set to a second pixel value.

[0074] In the application, after semantic segmentation is performed on the above image data and the target object segmentation block is obtained, it can be determined whether each pixel block in the above target object segmentation block is a target object. If it is a target object, the pixel block is set to the first pixel value, and if it is a non-target object, the pixel block is set to the second pixel value. For example, it is determined whether each pixel block in the lane line segmentation block is a lane line. If it is determined to be a lane line, the pixel block is set to 1, and if it is determined to be a non-lane line, the pixel block is set to 0.

[0075] S23, obtaining a binary image of the target object based on the pixel value of each pixel block in the target object segmentation block.

[0076] In the application, after determining whether each pixel block in the target object segmentation block is a target object and setting a first pixel value or a second pixel value for each pixel block, the target object segmentation block can be converted into a target object binary image according to the determination result. For example, the target object segmentation block can be converted into a target object binary image with a pixel value of 1 or 0.

[0077] like Figure 3 As shown, in one embodiment, after step S23, it also includes: S31, determining the color of each pixel block in the target object binary image; S32, if the color of the pixel block is less than a preset threshold, re-determining the pixel block as a non-target object.

[0078] In the application, when the target object is a lane line, the semantic segmentation model does not distinguish the color or shape of the lane line. Therefore, when the lane line is a dotted line, the lane line in the lane line segmentation block obtained after semantic segmentation may also be a solid line. Therefore, the virtual and solid lane lines can be distinguished by determining the color difference of the pixel blocks, so as to obtain the pixel block distribution of the real lane line more accurately, which is convenient for subsequent refined processing.

[0079] In the application, the preset threshold can be the average color of all pixel blocks identified as lane lines after obtaining the binary image of the target object through semantic segmentation, that is, the total color of lane line pixel blocks divided by the total number of lane line pixel blocks. For each pixel block identified as a lane line, if the color of the pixel block is greater than the average color, the pixel block is determined to be a real point; if the color of the pixel block is less than the average color, the pixel block is re-determined as a non-lane line, that is, it is determined to be a virtual point, and the virtual and real lines are determined in this way.

[0080] like Figure 4 As shown, in one embodiment, step S13 includes:

[0081] S41, performing a closing operation on the target binary image to obtain a target closed operation result image; S42, determining the degree of damage through a damage degree calculation formula based on the target binary image and the target closed operation result image, wherein the damage degree is used to characterize the degree of damage of the target in the image data; S43, determining the fuzzy parameter through a fuzzy parameter calculation formula based on the damage degree, the preset number of times and the preset fuzzy strength.

[0082] In the application, the degree of ambiguity can be used to measure the damage of the target object such as the lane line, and to guide the adaptive parameter adjustment of the image blur processing. According to the degree of damage of the image data, different degrees of blur processing are performed on the image data to make it more realistic. Taking the lane line as an example, the above-mentioned closing operation on the binary image of the target object can be a dilation expansion and then an erosion corrosion of the binary image of the target object after virtual and real processing. The purpose is to fill the original lane line break points without increasing the original width of the lane line, so as to obtain a more realistic lane line coverage and obtain the target object closing operation result image.

[0083] In application, the above damage calculation formula can be Among them, ΣM B Indicates the total number of pixel blocks that are determined to be the target object, i.e., the pixel value is 1, in the binary image of the target object after virtual-real processing. ΣM B Indicates the total number of pixel blocks that are determined to be targets, i.e., have a pixel value of 1, in the target object closed operation result graph.

[0084] In the application, when blurring the image data, the preset number of times and the preset blur strength can be adjusted. After determining the preset number of times and the preset blur strength, the blur parameter can be determined by the blur parameter calculation formula based on the damage degree.

[0085] In the application, the parameters for the first fuzzy process It can be expressed as:

[0086]

[0087] Increment parameter when repeating loop It can be expressed as:

[0088]

[0089] Finally, the fuzzy parameters at each cycle It can be expressed as:

[0090] Wherein, diff represents the difference between the above-mentioned preset fuzzy strength strength and the above-mentioned ambiguity, i represents the number of cycles, and iter represents the above-mentioned preset number of times.

[0091] In the application, after the above parameter settings are adjusted, the parameters can be adaptively adjusted according to the actual degree of damage. If the blurred image data generated is expected to have more levels and larger gradients, the above preset number of iter can be increased. If the blurred image data generated is expected to be more blurred, the above preset blur strength strength can be increased.

[0092] The image detection method provided in the embodiment of the present application determines the fuzzy parameters through a fuzzy parameter calculation formula based on the degree of damage, the preset number of times and the fuzzy intensity. It can adaptively adapt different fuzzy parameters to different image data according to the set fuzzy processing intensity, greatly reducing the cost of manual intervention, and can personalize the generation of more realistic and natural blurred image data for different image data.

[0093] In one embodiment, after step S43, the method further includes: determining a smoothing parameter by a smoothing parameter calculation formula based on the damage degree and the preset blur strength, wherein the smoothing parameter is used to determine the smoothing processing strength.

[0094] In the application, the above smoothing parameters include a first smoothing parameter diameter and a second smoothing parameter sigma.

[0095] In one embodiment, step S14 includes: performing the fuzzy processing and random resetting on the target binary image for the preset number of times based on the fuzzy parameters to obtain fuzzy image data.

[0096] In applications, Dropout is a regularization technique commonly used in neural network training. It can randomly reset the output of some neurons to zero during training to prevent overfitting of the neural network, thereby improving the generalization ability. By borrowing the idea of ​​Dropout, the pixel blocks in the above-mentioned target binary image are randomly Dropouted, i.e., randomly reset, so that the blurred image data does not rely too much on the effect of a certain blurring process, improves the authenticity of the blurred image data, and makes the generated blurred image data have texture features comparable to real image data.

[0097] In one embodiment, after step S14, the method further includes: smoothing the blurred image data based on a smoothing parameter to obtain smoothed image data.

[0098] In applications, the purpose of smoothing is to reduce image details. In some cases, too much image detail may affect subsequent processing steps. For example, image segmentation and edge detection usually need to be performed after denoising and smoothing because these steps are very sensitive to details. By applying a smoothing filter, the details in the image can be reduced, making subsequent processing easier.

[0099] In applications, bilateral filtering can be used for smoothing to obtain more natural blurred image data. Bilateral filtering can retain edge information in the image while smoothing the image, so it can effectively remove noise in the image. Compared with other filtering methods, bilateral filtering can better retain detail information in the image, especially for image processing tasks that need to retain texture information, the effect of bilateral filtering is more obvious.

[0100] In applications, the bilateral filtering algorithm is simple to understand and easy to implement, so it has been widely used in the field of image processing. There are two important parameters in bilateral filtering: the radius of the spatial filter and the standard deviation of the gray value filter. By adjusting these two parameters, the filtering results can be flexibly controlled to adapt to different image processing tasks. Although bilateral filtering requires calculations for each pixel in the image, since the filter is local, its calculation amount is much smaller than other global filters such as Gaussian filters, so the processing efficiency is higher.

[0101] The image detection method provided in the embodiment of the present application obtains smoothed image data by smoothing the blurred image data based on a smoothing parameter, so that the texture of the generated blurred image data is more natural and smooth.

[0102] The image detection device provided in the present application is exemplarily described below with reference to the accompanying drawings.

[0103] Embodiment 3

[0104] Corresponding to the image detection method described in the above embodiment, Figure 5 As shown, this embodiment provides an image detection device, and the image detection device 500 includes:

[0105] An image acquisition module 501 is used to acquire image data;

[0106] The target extraction module 502 is used to extract the target from the image data to obtain a binary image of the target object;

[0107] A parameter determination module 503 is used to determine a fuzzy parameter based on the target binary image and a preset number of times through a fuzzy parameter calculation formula, wherein the fuzzy parameter is used to determine the fuzzy processing intensity;

[0108] A fuzzy processing module 504 is used to perform fuzzy processing on the target binary image for the preset number of times based on the fuzzy parameters to obtain fuzzy image data;

[0109] The target detection module 505 is used to detect targets on the image data using an image detection model trained based on the blurred image data.

[0110] In one embodiment, the target extraction module 502 includes:

[0111] A semantic segmentation unit, used to perform semantic segmentation on the image data to obtain target object segmentation blocks;

[0112] a pixel value setting unit, configured to set a pixel block in the target object segmentation block to a first pixel value if the pixel block is a target object, and to set the pixel block to a second pixel value if the pixel block is a non-target object;

[0113] The binary image acquisition unit is used to obtain a binary image of the target object based on the pixel value of each pixel block in the target object segmentation block.

[0114] In one embodiment, the target extraction module 502 further includes:

[0115] A color density determination unit, used to determine the color density of each pixel block in the target binary image by a color density calculation formula;

[0116] The pixel block redefinition unit is used to redefine the pixel block as a non-target object if the color density of the pixel block is less than a preset threshold.

[0117] In one embodiment, the parameter determination module 503 includes:

[0118] A closing operation unit, used for performing a closing operation on the target object binary image to obtain a target object closing operation result image;

[0119] a damage degree determination unit, configured to determine the damage degree through a damage degree calculation formula based on the target object binary image and the target object closed operation result image, wherein the damage degree is used to characterize the damage degree of the target object in the image data;

[0120] The fuzzy parameter determination unit is used to determine the fuzzy parameter through a fuzzy parameter calculation formula based on the damage degree, the preset number of times and the preset fuzzy strength.

[0121] In one embodiment, the parameter determination module 503 further includes:

[0122] A smoothing parameter determination unit is used to determine a smoothing parameter through a smoothing parameter calculation formula based on the damage degree and the preset blur strength, wherein the smoothing parameter is used to determine a smoothing processing strength.

[0123] In one embodiment, the fuzzy processing module 504 includes:

[0124] The fuzzy processing unit is used to perform the fuzzy processing and random resetting on the target binary image for the preset number of times based on the fuzzy parameters to obtain fuzzy image data.

[0125] In one embodiment, the fuzzy processing module 504 further includes:

[0126] The smoothing processing unit is used to perform smoothing processing on the blurred image data based on a smoothing parameter to obtain smoothed image data.

[0127] It should be noted that the information interaction, execution process, etc. between the above-mentioned modules / units 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.

[0128] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0129] The present application embodiment also provides a terminal device 600, such as Figure 6 As shown, it includes a memory 601, a processor 602, and a computer program 603 stored in the memory 601 and executable on the processor 602. When the processor 602 executes the computer program 603, the steps of the image detection method provided in the first aspect are implemented.

[0130] In the application, the terminal device may include, but is not limited to, a processor and a memory. Figure 6 It is only an example of a terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown in the figure, or combine certain components, or different components, such as input and output devices, network access devices, etc. Input and output devices may include cameras, audio acquisition / playback devices, display screens, etc. The network access device may include a network module for wirelessly communicating with external devices.

[0131] In applications, the processor may 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. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.

[0132] In applications, the memory may be an internal storage unit of a terminal device in some embodiments, such as a hard disk or memory of the terminal device. In other embodiments, the memory may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device. The memory may also include both an internal storage unit and an external storage device of the terminal device. The memory is used to store operating systems, applications, boot loaders, data, and other programs, such as program codes of computer programs. The memory may also be used to temporarily store data that has been output or is to be output.

[0133] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0134] The present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. 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. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to a terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk.

[0135] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0136] Those of ordinary skill in the art will appreciate that the devices and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0137] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interface, indirect coupling or communication connection of devices, which can be electrical, mechanical or other forms.

[0138] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. An image detection method, characterized in that: include: Get image data; Performing target extraction on the image data to obtain a binary image of the target object; Based on the target binary image and the preset number of times, a fuzzy parameter is determined by a fuzzy parameter calculation formula, and the fuzzy parameter is used to determine the fuzzy processing intensity; Performing the fuzzy processing on the target binary image for the preset number of times based on the fuzzy parameter to obtain fuzzy image data; The image data is subjected to target object detection using an image detection model trained based on the blurred image data.

2. The image detection method according to claim 1, characterized in that: The step of extracting a target from the image data to obtain a binary image of the target object includes: Performing semantic segmentation on the image data to obtain target object segmentation blocks; If a pixel block in the target object segmentation block is a target object, the pixel block is set to a first pixel value; if the pixel block is a non-target object, the pixel block is set to a second pixel value; Based on the pixel values ​​of each pixel block in the target object segmentation block, a target object binary image is obtained.

3. The image detection method according to claim 1, characterized in that: After obtaining the target object binary image based on the pixel values ​​of each pixel block in the target object segmentation block, the method further includes: Determine the color of each pixel block in the target binary image; If the color of the pixel block is less than a preset threshold, the pixel block is re-determined as a non-target object.

4. The image detection method according to claim 1, characterized in that: The step of determining the fuzzy parameter by a fuzzy parameter calculation formula based on the target object binary image and the preset number of times includes: Performing a closing operation on the target object binary image to obtain a target object closing operation result image; Based on the target object binary image and the target object closed operation result image, determining the damage degree through a damage degree calculation formula, wherein the damage degree is used to characterize the damage degree of the target object in the image data; Based on the damage degree, the preset number of times and the preset blur strength, a blur parameter is determined by a blur parameter calculation formula.

5. The image detection method according to claim 4, characterized in that: After determining the fuzzy parameter by a fuzzy parameter calculation formula based on the damage degree, the preset number of times and the preset fuzzy strength, the method further includes: Based on the damage degree and the preset blur strength, a smoothing parameter is determined by a smoothing parameter calculation formula, and the smoothing parameter is used to determine the smoothing processing strength.

6. The image detection method according to claim 1, characterized in that: The step of performing the fuzzy processing on the target binary image for the preset number of times based on the fuzzy parameter to obtain fuzzy image data includes: The target binary image is subjected to the preset number of fuzzy processing and random resetting based on the fuzzy parameters to obtain fuzzy image data.

7. The image detection method according to claim 1, characterized in that: After the fuzzy processing is performed on the target binary image for the preset number of times based on the fuzzy parameter to obtain fuzzy image data, the method further includes: The blurred image data is smoothed based on a smoothing parameter to obtain smoothed image data.

8. An image detection device, characterized in that: include: An image acquisition module, used for acquiring image data; A target extraction module, used to extract the target from the image data to obtain a binary image of the target object; A parameter determination module, used to determine a fuzzy parameter through a fuzzy parameter calculation formula based on the target binary image and a preset number of times, wherein the fuzzy parameter is used to determine the fuzzy processing intensity; A fuzzy processing module, used for performing the fuzzy processing on the target binary image for the preset number of times based on the fuzzy parameters to obtain fuzzy image data; The target detection module is used to detect targets on the image data using an image detection model trained based on the blurred image data.

9. 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 image detection method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the image detection method according to any one of claims 1 to 7 is implemented.