Target detection method and device, equipment, readable storage medium and program product
By converting infrared images into hyperspectral HSI images, determining target pixel values and performing denoising processing, the problem of poor target detection in infrared images is solved and higher detection accuracy and effects are achieved.
Patent Information
- Application Number
- CN202410892864.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-10-01
AI Technical Summary
The contrast between the target to be measured and the background in the infrared image is low, resulting in blurred edges. It is difficult for the existing technology to effectively extract the contour information of the target, which affects the target detection effect.
The infrared image is converted into a hyperspectral HSI image, and by determining the pixel values of different pixels in the image area, denoising and gradient value analysis are performed to improve the accuracy of target detection.
It improves the accuracy and effect of target detection, overcomes the problems of edge blur and low contrast in infrared images, and enhances the ability to extract target contour information.
Smart Images

Figure CN118736202A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of edge extraction technology, and in particular to a target detection method, device, equipment, readable storage medium and program product. Background Art
[0002] Infrared images reflect the thermal radiation of the target and the background. Compared with visible light images, the contrast between the target and the background in infrared images is low and the edges are blurred, making it difficult to extract effective contour information of the target using conventional edge extraction methods.
[0003] Based on this, traditional technologies have emerged that convert infrared images into grayscale images and extract the edges of the target to be detected based on the grayscale images. However, grayscale images do not have color characteristics, and the target edges displayed in grayscale images are not obvious, which affects the target detection effect and needs to be solved urgently. Summary of the invention
[0004] Based on this, it is necessary to provide a target detection method, device, equipment, readable storage medium and program product to improve the target detection effect in response to the above technical problems.
[0005] In a first aspect, the present application provides a target detection method, comprising:
[0006] Acquire an image to be detected; the image to be detected is a hyperspectral HSI image; and the target to be detected is displayed in the image to be detected;
[0007] Determine a target pixel value corresponding to a corresponding image area according to pixel values of different pixel points in at least one image area in the image to be detected;
[0008] According to the target pixel value corresponding to at least one image area, denoising is performed on the image to be detected to obtain an intermediate image;
[0009] According to the gradient values of different pixel points in the intermediate image, target detection is performed on the target to be detected in the image to be detected.
[0010] In one embodiment, determining a target pixel value corresponding to a corresponding image area according to pixel values of different pixel points in at least one image area in the image to be detected includes:
[0011] For any image region, the pixel values of different pixels in the image region are sorted according to the positions of the pixels in the image region to obtain an initial sorting result;
[0012] Adjusting the initial sorting result according to the pixel value of at least one reference pixel in the image area to obtain a target sorting result;
[0013] Based on the target sorting result, the target pixel value corresponding to the image area is determined.
[0014] In one embodiment, according to the position of each pixel point in the image area, the pixel values of different pixels in the image area are sorted to obtain an initial sorting result, including:
[0015] The pixel values corresponding to each pixel point in the image area are spliced row by row, and the initial sorting result is generated according to the splicing order of each pixel point.
[0016] In one of the embodiments, adjusting the initial sorting result according to the pixel value of at least one reference pixel in the image area to obtain the target sorting result includes:
[0017] The pixel value of at least one reference pixel in the image area is added to a preset position in the initial sorting result to obtain a target sorting result.
[0018] In one embodiment, determining a target pixel value corresponding to an image region based on a target sorting result includes:
[0019] The median value of the target sorting result is used as the target pixel value of the image area;
[0020] Accordingly, the image to be detected is denoised according to the target pixel value corresponding to at least one image region to obtain an intermediate image, including:
[0021] For each image region, the pixel value of the center point of the image region is replaced with the target pixel value corresponding to the image region to perform denoising on the image to be detected and obtain an intermediate image.
[0022] In one embodiment, obtaining an image to be detected includes:
[0023] Acquire infrared images; infrared images are three-primary-color RGB images;
[0024] Convert the infrared image to the HSI image space to obtain the image to be detected.
[0025] In a second aspect, the present application also provides a target detection device, comprising:
[0026] The image acquisition module is used to acquire the image to be detected; the image to be detected is a hyperspectral HSI image; the target to be detected is displayed in the image to be detected;
[0027] A target pixel value determination module, used to determine a target pixel value corresponding to a corresponding image area according to pixel values of different pixel points in at least one image area in the image to be detected;
[0028] According to the target pixel value corresponding to at least one image area, denoising is performed on the image to be detected to obtain an intermediate image;
[0029] According to the gradient values of different pixel points in the intermediate image, target detection is performed on the target to be detected in the image to be detected.
[0030] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0031] Acquire an image to be detected; the image to be detected is a hyperspectral HSI image; and the target to be detected is displayed in the image to be detected;
[0032] Determine a target pixel value corresponding to a corresponding image area according to pixel values of different pixel points in at least one image area in the image to be detected;
[0033] According to the target pixel value corresponding to at least one image area, denoising is performed on the image to be detected to obtain an intermediate image;
[0034] According to the gradient values of different pixel points in the intermediate image, target detection is performed on the target to be detected in the image to be detected.
[0035] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
[0036] Acquire an image to be detected; the image to be detected is a hyperspectral HSI image; and the target to be detected is displayed in the image to be detected;
[0037] Determine a target pixel value corresponding to a corresponding image area according to pixel values of different pixel points in at least one image area in the image to be detected;
[0038] According to the target pixel value corresponding to at least one image area, denoising is performed on the image to be detected to obtain an intermediate image;
[0039] According to the gradient values of different pixel points in the intermediate image, target detection is performed on the target to be detected in the image to be detected.
[0040] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0041] Acquire an image to be detected; the image to be detected is a hyperspectral HSI image; and the target to be detected is displayed in the image to be detected;
[0042] Determine a target pixel value corresponding to a corresponding image area according to pixel values of different pixel points in at least one image area in the image to be detected;
[0043] According to the target pixel value corresponding to at least one image area, denoising is performed on the image to be detected to obtain an intermediate image;
[0044] According to the gradient values of different pixel points in the intermediate image, target detection is performed on the target to be detected in the image to be detected.
[0045] The above-mentioned target detection method, device, equipment, readable storage medium and program product obtain an image to be detected, and determine the target pixel value corresponding to each image area according to the pixel values of different pixel points in at least one image area in the image to be detected. Furthermore, according to the target pixel value corresponding to at least one image area, the image to be detected is denoised to obtain an intermediate image, and then according to the gradient values of different pixel points in the intermediate image, target detection is performed on the target to be detected in the image to be detected. In the above process, when performing target detection on the image to be detected, the image to be detected is not directly processed, but based on a special image denoising method, the image to be detected is denoised to obtain an intermediate image, and then the intermediate image is processed. The accuracy of target detection can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions 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 related drawings can be obtained based on these drawings without paying creative work.
[0047] Figure 1 Schematic diagram of a target detection method in one embodiment;
[0048] Figure 2 is a schematic diagram of a process for determining a target pixel value in one embodiment;
[0049] Figure 3 A schematic diagram of a process for determining an intermediate image in one embodiment;
[0050] Figure 4 A schematic diagram of a process for determining an image to be detected in one embodiment;
[0051] Figure 5 is a flow chart of a target detection method in another embodiment;
[0052] Figure 6 is a structural block diagram of a target detection device in one embodiment;
[0053] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0055] Before introducing the embodiments of the present application, it should be noted that, compared with grayscale images, color images have their own color characteristics and can be decomposed into different color spaces. However, there are certain limitations to the three primary colors (Red, Green, Blue, RGB) color space. On this basis, in order to better detect the target to be detected in the image, the present application proposes a method of converting the infrared image to the HSI space and performing target detection on the image to be detected in the hyperspectral (Hue, Saturation, Intensity, HSI) space. It has been verified that this method is more ideal than directly detecting the target in the infrared image (in the RGB space).
[0056] like Figure 1 As shown, a target detection method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0057] S110, obtaining an image to be detected.
[0058] The image to be detected is a hyperspectral HSI image; the image to be detected displays a target to be detected. The target to be detected may be a target that needs to be extracted, and illustratively, the target to be detected may be a weld area in the image to be detected.
[0059] Exemplarily, the image to be detected may be pre-stored in a preset location, and when there is a need for target detection, the image to be detected is acquired from the preset location.
[0060] Exemplarily, this embodiment may also send an image upload instruction to a technician when there is a demand for target detection. After the technician uploads an image in response to the image upload instruction, the image is used as an image to be detected.
[0061] S120, determining a target pixel value corresponding to a corresponding image area according to pixel values of different pixel points in at least one image area in the image to be detected.
[0062] The image region may be a region of any shape, for example, a square region, a rectangular region, or a circular region, which is not limited. Each image region corresponds to a target pixel value, and the target pixel value is used to perform denoising on the corresponding image region.
[0063] Exemplarily, this embodiment can randomly divide the image to be detected into at least one image region. Further, in an optional implementation, for any image region, according to the pixel values of different pixels in the image region, for example, the average of the pixel values of different pixels in the image region is used as the target pixel value corresponding to the image region.
[0064] In another optional implementation, for any image region, pixel values of different pixel points in the image region are input into a pre-trained pixel value determination model to obtain a target pixel value corresponding to the corresponding image region.
[0065] In another optional implementation, this embodiment may also consider the positions of different pixel points in the corresponding image area in the process of determining the target pixel values corresponding to different image areas, so as to improve the accuracy of the target pixel values.
[0066] S130, performing denoising processing on the image to be detected according to the target pixel value corresponding to at least one image region to obtain an intermediate image.
[0067] The intermediate image may be an image used for target detection, and the intermediate image is also an HSI image.
[0068] For example, for any image region, the pixel value of at least one pixel in the image region may be replaced with the target pixel value corresponding to the image region, wherein the at least one pixel may be randomly determined or selected based on manual experience, which is not limited.
[0069] S140, performing target detection on the target to be detected in the image to be detected according to the gradient values of different pixel points in the intermediate image.
[0070] In this embodiment, the purpose of performing target detection on the intermediate image may be to determine the target area in the intermediate image.
[0071] In an optional implementation, the gradient values of different pixels in the intermediate image can be determined based on a common gradient value determination method, and further, the target gradient value can be determined according to the magnitude of the gradient values of the different pixels, and then the target detection is performed on the target to be detected in the image to be detected according to the target gradient value. The target gradient value can be a gradient value that is significantly different from the surrounding gradient values. In this embodiment, the area composed of the target gradient value can be used as the target area.
[0072] In another optional implementation, the intermediate image and the gradient values of different pixels in the intermediate image may be input into a pre-trained target detection model to obtain a target detection result.
[0073] The process of determining the gradient values of different pixel points may be based on common gradient operators, such as the Sobel operator and the Scharr operator.
[0074] In the above target detection method, an image to be detected is obtained, and the target pixel value corresponding to each image area is determined based on the pixel values of different pixel points in at least one image area in the image to be detected. Furthermore, according to the target pixel value corresponding to at least one image area, the image to be detected is denoised to obtain an intermediate image, and then according to the gradient values of different pixel points in the intermediate image, target detection is performed on the target to be detected in the image to be detected. In the above process, when performing target detection on the image to be detected, the image to be detected is not directly processed, but based on a special image denoising method, the image to be detected is denoised to obtain an intermediate image, and then the intermediate image is processed. The accuracy of target detection can be improved.
[0075] On the basis of the above embodiments, further, this embodiment also provides a specific method for determining the target pixel values corresponding to different image areas. Figure 2 As shown, it includes the following steps:
[0076] S210, for any image region, sorting the pixel values of different pixels in the image region according to the positions of the pixels in the image region to obtain an initial sorting result.
[0077] In an optional embodiment, the pixel values corresponding to each pixel point in the image area can be spliced row by row, and an initial sorting result can be generated according to the splicing order of each pixel point. Exemplarily, the image area is a 4*3 rectangular area, and this embodiment can sort the pixel values of 4 rows of pixels from top to bottom to obtain a 1*12 sorting result, which is used as the initial sorting result.
[0078] S220, adjusting the initial sorting result according to the pixel value of at least one reference pixel in the image area to obtain a target sorting result.
[0079] Exemplarily, the pixel value of at least one reference pixel in the image region may be added to a preset position in the initial sorting result to obtain a target sorting result. For example, a pixel in a preset row (e.g., the first row) in the image region is used as a reference pixel, and the pixel value of the reference pixel is added to a preset position in the initial sorting result, e.g., the front, to adjust the initial sorting result to obtain a target sorting result.
[0080] S230: Determine a target pixel value corresponding to the image area based on the target sorting result.
[0081] It is understandable that in the initial sorting result and the target sorting result, each position corresponds to a pixel value rather than a pixel point.
[0082] Exemplarily, in this embodiment, the pixel values in a preset order in the target sorting result can be used as the target pixel values corresponding to the image area. For example, the median value of the target sorting result can be used as the target pixel value of the image area.
[0083] In another optional embodiment, an arbitrary square matrix template (image area) may be taken out from the image to be detected and the pixel value of each pixel therein may be defined as a matrix C;
[0084] ;
[0085] Where C is the matrix of the image area; is the pixel value of the first pixel in the first row of the image area matrix; is the pixel value of the nth pixel in the first row of the image area; is the pixel value of the nth pixel in the mth row of the image area.
[0086] Furthermore, the first row of the C matrix is taken out and defined as e, e and other rows in C are combined into a new row matrix b, and the median f of the b matrix is calculated, and the median f is used as the target pixel value corresponding to the image area.
[0087] ;
[0088] Where, e is the pixel value of the first row of pixels in matrix C; b is the target sorting result; is the pixel value of the first pixel in the first row of the image area matrix; is the pixel value of the nth pixel in the first row of the image area; f is the median value in the target sorting result.
[0089] The above embodiment provides a more accurate method for determining target pixels. Based on the above method for determining target pixels, the image to be detected can be subsequently denoised based on the target pixels while ensuring the edge information of the image to be detected, thereby achieving a better denoising effect.
[0090] On the basis of the above embodiments, after determining the target pixel value of each image region, the image to be detected is subjected to image denoising processing according to the target pixel value corresponding to at least one image region to obtain an intermediate image. Figure 3 As shown, this can be done in the following ways:
[0091] S310, for each image region, replacing the pixel value of the center point of the image region with the target pixel value corresponding to the image region, so as to perform denoising processing on the image to be detected and obtain an intermediate image.
[0092] Illustratively, in this embodiment, the center point of the image area may be determined according to the position of each pixel point in the image area, and then the pixel value of the center point may be replaced with the target pixel value corresponding to the image area.
[0093] In the above embodiment, the pixel value of the center point of the image area is replaced with the target pixel value, which can achieve the effect of denoising the image to be detected, making the noise of the intermediate image smaller and ensuring the subsequent processing.
[0094] On the basis of the above embodiments, it is further necessary to explain that, usually, the image is in RGB space. In this embodiment, the acquired image is also in RGB space. However, the target detection effect of RGB space image is poor. Taking the area with the highest temperature in the infrared image as the target, it is reflected as a black area in HSI space, that is, the brightest color infrared image area appears black in S space, which has a large color change with the surrounding area, which is conducive to the later target detection based on gradient method. Therefore, in this embodiment, if Figure 4 As shown, the RGB image is processed in the following way to obtain the image to be detected:
[0095] S410, acquiring an infrared image.
[0096] Among them, the infrared image is a three-primary color RGB image.
[0097] Illustratively, in this embodiment, the infrared image may be pre-stored at a preset location, and when there is a need for target detection, the infrared image is acquired from the preset location.
[0098] S420, converting the infrared image into the HSI image space to obtain an image to be detected.
[0099] In an optional implementation, the infrared image may be input into an image space conversion model to obtain an image to be detected in the HSI image space.
[0100] In another optional implementation, for any pixel point, image space transformation can be performed in the following manner:
[0101] Since the HSI color space and the RGB color space are just different representations of the same physical quantity, the value of the HSI space component can be obtained through the RGB space component. The conversion formula is:
[0102] ;
[0103] ;
[0104] ;
[0105] Wherein, H is the H component of the pixel in the HSI space; S is the S component of the pixel in the HSI space; I is the I component of the pixel in the HSI space; R is the R component of the pixel in the RGB space; G is the G component of the pixel in the RGB space; B component of the pixel in the RGB space.
[0106] In the formula, H, S, and I are HSI components respectively. According to the above formula, the RGB color space of the infrared image can be converted to the HSI space.
[0107] In order to facilitate those skilled in the art to understand the present solution, in one embodiment, the target detection method provided by the present application is described in detail, such as Figure 5 As shown, it includes the following steps:
[0108] S510, acquiring an infrared image.
[0109] S520: The infrared image is a three-primary-color RGB image.
[0110] S530, converting the infrared image into the HSI image space to obtain an image to be detected.
[0111] S540, for any image region, concatenate pixel values corresponding to each pixel point in the image region row by row, and generate an initial sorting result according to the concatenation order of each pixel point.
[0112] S550, adding the pixel value of at least one reference pixel in the image area to a preset position in the initial sorting result to obtain a target sorting result.
[0113] S560: Use the median value of the target sorting result as the target pixel value of the image area.
[0114] S570, for each image region, replacing the pixel value of the center point of the image region with the target pixel value corresponding to the image region, so as to perform denoising processing on the image to be detected and obtain an intermediate image.
[0115] S580, performing target detection on the target to be detected in the image to be detected according to the gradient values of different pixel points in the intermediate image.
[0116] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0117] Based on the same inventive concept, the embodiment of the present application also provides a target detection device for implementing the target detection method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more target detection device embodiments provided below can refer to the limitations on the target detection method above, and will not be repeated here.
[0118] In an exemplary embodiment, Figure 6 As shown, a target detection device is provided, including: an image acquisition module 610, a target pixel value determination module 620, a denoising module 630 and a target detection module 640, wherein:
[0119] The image acquisition module 610 is used to acquire the image to be detected.
[0120] The image to be detected is a hyperspectral HSI image; the image to be detected displays a target to be detected.
[0121] The target pixel value determination module 620 is used to determine the target pixel value corresponding to the corresponding image area according to the pixel values of different pixel points in at least one image area in the image to be detected.
[0122] The denoising module 630 is used to perform denoising processing on the image to be detected according to the target pixel value corresponding to at least one image area to obtain an intermediate image.
[0123] The target detection module 640 is used to perform target detection on the target to be detected in the image to be detected according to the gradient values of different pixel points in the intermediate image.
[0124] In one embodiment, the target pixel value determination module 620 includes a first determination unit, which is used to sort the pixel values of different pixels in any image area according to the positions of each pixel in the image area to obtain an initial sorting result; a second determination unit, which is used to adjust the initial sorting result according to the pixel value of at least one reference pixel in the image area to obtain a target sorting result; and a third determination unit, which is used to determine the target pixel value corresponding to the image area based on the target sorting result.
[0125] In one embodiment, the first determining unit is specifically configured to splice the pixel values corresponding to the pixels in the image area row by row, and generate an initial sorting result according to the splicing order of the pixels.
[0126] In one embodiment, the second determining unit is specifically configured to add the pixel value of at least one reference pixel in the image area to a preset position in the initial sorting result to obtain a target sorting result.
[0127] In one embodiment, the third determination unit is specifically used to use the median of the target sorting result as the target pixel value of the image area; accordingly, the denoising module 630 is specifically used to replace the pixel value of the center point of the image area with the target pixel value corresponding to the image area for each image area, so as to perform denoising on the image to be detected and obtain an intermediate image.
[0128] In one embodiment, the image acquisition module 610 includes an image acquisition unit for acquiring an infrared image; the infrared image is a three-primary-color RGB image; and an image processing unit for converting the infrared image into an HSI image space to obtain an image to be detected.
[0129] Each module in the above target detection device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0130] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 7As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, a near field communication (NFC) or other technologies. When the computer program is executed by the processor, a target detection method is implemented.
[0131] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0132] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0133] Acquire an image to be detected; the image to be detected is a hyperspectral HSI image; and the target to be detected is displayed in the image to be detected;
[0134] Determine a target pixel value corresponding to a corresponding image area according to pixel values of different pixel points in at least one image area in the image to be detected;
[0135] According to the target pixel value corresponding to at least one image area, denoising is performed on the image to be detected to obtain an intermediate image;
[0136] According to the gradient values of different pixel points in the intermediate image, target detection is performed on the target to be detected in the image to be detected.
[0137] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0138] For any image region, the pixel values of different pixels in the image region are sorted according to the positions of the pixels in the image region to obtain an initial sorting result;
[0139] Adjusting the initial sorting result according to the pixel value of at least one reference pixel in the image area to obtain a target sorting result;
[0140] Based on the target sorting result, the target pixel value corresponding to the image area is determined.
[0141] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0142] The pixel values corresponding to each pixel point in the image area are spliced row by row, and the initial sorting result is generated according to the splicing order of each pixel point.
[0143] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0144] The pixel value of at least one reference pixel in the image area is added to a preset position in the initial sorting result to obtain a target sorting result.
[0145] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0146] The median of the target sorting result is used as the target pixel value of the image area; for each image area, the pixel value of the center point of the image area is replaced with the target pixel value corresponding to the image area to denoise the image to be detected and obtain an intermediate image.
[0147] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0148] Acquire infrared images; infrared images are three-primary-color RGB images;
[0149] Convert the infrared image to the HSI image space to obtain the image to be detected.
[0150] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0151] Acquire an image to be detected; the image to be detected is a hyperspectral HSI image; and the target to be detected is displayed in the image to be detected;
[0152] Determine a target pixel value corresponding to a corresponding image area according to pixel values of different pixel points in at least one image area in the image to be detected;
[0153] According to the target pixel value corresponding to at least one image area, denoising is performed on the image to be detected to obtain an intermediate image;
[0154] According to the gradient values of different pixel points in the intermediate image, target detection is performed on the target to be detected in the image to be detected.
[0155] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0156] For any image region, the pixel values of different pixels in the image region are sorted according to the positions of the pixels in the image region to obtain an initial sorting result;
[0157] Adjusting the initial sorting result according to the pixel value of at least one reference pixel in the image area to obtain a target sorting result;
[0158] Based on the target sorting result, the target pixel value corresponding to the image area is determined.
[0159] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0160] The pixel values corresponding to each pixel point in the image area are spliced row by row, and the initial sorting result is generated according to the splicing order of each pixel point.
[0161] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0162] The pixel value of at least one reference pixel in the image area is added to a preset position in the initial sorting result to obtain a target sorting result.
[0163] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0164] The median of the target sorting result is used as the target pixel value of the image area; for each image area, the pixel value of the center point of the image area is replaced with the target pixel value corresponding to the image area to denoise the image to be detected and obtain an intermediate image.
[0165] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0166] Acquire infrared images; infrared images are three-primary-color RGB images;
[0167] Convert the infrared image to the HSI image space to obtain the image to be detected.
[0168] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0169] Acquire an image to be detected; the image to be detected is a hyperspectral HSI image; and the target to be detected is displayed in the image to be detected;
[0170] Determine a target pixel value corresponding to a corresponding image area according to pixel values of different pixel points in at least one image area in the image to be detected;
[0171] According to the target pixel value corresponding to at least one image area, denoising is performed on the image to be detected to obtain an intermediate image;
[0172] According to the gradient values of different pixel points in the intermediate image, target detection is performed on the target to be detected in the image to be detected.
[0173] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0174] For any image region, the pixel values of different pixels in the image region are sorted according to the positions of the pixels in the image region to obtain an initial sorting result;
[0175] Adjusting the initial sorting result according to the pixel value of at least one reference pixel in the image area to obtain a target sorting result;
[0176] Based on the target sorting result, the target pixel value corresponding to the image area is determined.
[0177] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0178] The pixel values corresponding to each pixel point in the image area are spliced row by row, and the initial sorting result is generated according to the splicing order of each pixel point.
[0179] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0180] The pixel value of at least one reference pixel in the image area is added to a preset position in the initial sorting result to obtain a target sorting result.
[0181] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0182] The median of the target sorting result is used as the target pixel value of the image area; for each image area, the pixel value of the center point of the image area is replaced with the target pixel value corresponding to the image area to denoise the image to be detected and obtain an intermediate image.
[0183] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0184] Acquire infrared images; infrared images are three-primary-color RGB images;
[0185] Convert the infrared image to the HSI image space to obtain the image to be detected.
[0186] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0187] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0188] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A target detection method, It is characterized in that The method comprises: Acquire an image to be detected; the image to be detected is a hyperspectral HSI image; the image to be detected displays a target to be detected; Determine a target pixel value corresponding to a corresponding image area according to pixel values of different pixel points in at least one image area in the image to be detected; According to the target pixel value corresponding to the at least one image area, denoising the image to be detected to obtain an intermediate image; According to the gradient values of different pixel points in the intermediate image, target detection is performed on the target to be detected in the image to be detected.
2. The method according to claim 1, It is characterized in that The step of determining a target pixel value corresponding to a corresponding image area according to pixel values of different pixel points in at least one image area in the image to be detected comprises: For any image region, according to the position of each pixel point in the image region, the pixel values of different pixel points in the image region are sorted to obtain an initial sorting result; Adjusting the initial sorting result according to a pixel value of at least one reference pixel in the image area to obtain a target sorting result; Based on the target sorting result, a target pixel value corresponding to the image area is determined.
3. The method according to claim 2, It is characterized in that The step of sorting pixel values of different pixel points in the image area according to the position of each pixel point in the image area to obtain an initial sorting result includes: The pixel values corresponding to each pixel point in the image area are spliced row by row, and the initial sorting result is generated according to the splicing order of each pixel point.
4. The method according to claim 2, It is characterized in that The adjusting the initial sorting result according to the pixel value of at least one reference pixel in the image area to obtain a target sorting result includes: The pixel value of at least one reference pixel in the image area is added to a preset position in the initial sorting result to obtain the target sorting result.
5. The method according to claim 2, It is characterized in that The determining, based on the target sorting result, a target pixel value corresponding to the image area includes: Using the median value of the target sorting result as the target pixel value of the image area; Correspondingly, the denoising process is performed on the image to be detected according to the target pixel value corresponding to the at least one image area to obtain an intermediate image, including: For each image region, the pixel value of the center point of the image region is replaced with the target pixel value corresponding to the image region, so as to perform denoising processing on the image to be detected and obtain an intermediate image.
6. The method according to any one of claims 1 to 5, It is characterized in that The step of acquiring the image to be detected comprises: Acquire an infrared image; the infrared image is a three-primary-color RGB image; The infrared image is converted into the HSI image space to obtain the image to be detected.
7. A target detection device, It is characterized in that The device comprises: An image acquisition module is used to acquire an image to be detected; the image to be detected is a hyperspectral HSI image; the image to be detected displays a target to be detected; A target pixel value determination module, used to determine a target pixel value corresponding to a corresponding image area according to pixel values of different pixel points in at least one image area in the image to be detected; A denoising module, configured to perform denoising processing on the image to be detected according to the target pixel value corresponding to the at least one image area to obtain an intermediate image; The target detection module is used to perform target detection on the target to be detected in the image to be detected according to the gradient values of different pixel points in the intermediate image.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, It is 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 6 are implemented.
10. A computer program product comprising a computer program, It is 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 6 are implemented.
Citation Information
Patent Citations
Pattern noise removal method and device based on median filter
CN101316321A
Infrared weak and small target detection method and device, storage medium and electronic equipment
CN116363390A
