Mask-based filtering method

By performing layered encoding and filtering operations on the mask, the problem of low ROI edge filtering efficiency in the prior art is solved, efficient parallelization and hardware of image processing are realized, and image quality and transmission efficiency are improved.

CN119151819APending Publication Date: 2024-12-17SICHUAN NATIONAL INNOVATION VISION UHD VIDEO TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411225576.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

In the prior art, the ROI edge filtering method is inefficient, especially when there are many ROI regions and overlap, it requires repeated operations, making it difficult to process in parallel, affecting image visual quality and processing efficiency.

Method used

The mask-based filtering method is adopted, and boundary filtering is performed on the mask through layered encoding technology, and the degraded image and reconstruction mask are used for indiscriminate filtering operations, avoiding the cumbersome steps of extracting the ROI boundaries separately, and the whole picture is uniformly matched. The image is processed.

Benefits of technology

It improves the efficiency and quality of image processing, reduces judgment operations, is suitable for parallel processing and hardware, retains more image information, and improves video transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119151819A_ABST
    Figure CN119151819A_ABST
Patent Text Reader

Abstract

The invention relates to the field of image processing, in particular to a mask-based filtering method, which comprises the following steps of S100, acquiring a residual image; carrying out degradation processing on the original image to obtain a degraded image; subtracting the degraded image from the original image to obtain a residual image; s200, reconstructing a mask code; s201, a region of interest is selected from the original image, the region of interest is an IOR region, other non-regions of interest are background regions, and an original image mask is pre-generated; s202, carrying out filtering processing on the original image mask to obtain a reconstructed mask; s300, obtaining a final image; and multiplying the residual image by the reconstructed mask, adding the degraded image, and finally obtaining a final image. The method has the beneficial effects that the purpose of filtering and smoothing the edge of the ROI in the final image is directly achieved by filtering the original image mask containing the ROI, the algorithm is simple and unified, and parallelization processing is easy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image processing, and in particular to a mask-based filtering method. Background Art

[0002] In the prior art, the mask-based ROI (Region of Interest) edge filtering algorithm is a strategy for extracting the edge of the region of interest in image processing. The general steps are: 1. ROI definition: First, determine the image region to be analyzed; 2. Preprocessing: preprocess the ROI region, such as denoising to reduce image noise to improve the accuracy of subsequent edge detection; 3. Edge detection: apply edge detection algorithms such as Canny edge detection, Sobel, Prewitt or Harris corner detection to find the edges in the ROI; 4. Mask application: combine the results of edge detection with the original ROI mask. Only the edges detected in the mask are retained, and the edges of the non-ROI area are excluded, so as to obtain clean ROI edges; 5. Post-processing: further edge refinement or connection may be required to deal with broken edges or remove false positive edges; 6. Result output: Finally, the processed ROI edges are output, which can be used for subsequent analysis, recognition or other image processing tasks.

[0003] Generally speaking, the visual quality of the whole frame image depends largely on the image quality of the ROI part, while the image quality of the non-ROI is not easy to detect, and the visual quality of the whole frame image is small. However, if the boundary between the ROI area and the non-ROI area is too obvious, the overall subjective experience is also very bad. Therefore, an effective method is needed to smooth the ROI boundary part. In the process of traditional region of interest (ROI) edge filtering, it is often necessary to find the boundary of the ROI by some method, and then perform filtering operations near the boundary to make the transition between the ROI area and the non-ROI area smoother and improve the subjective experience. Since this method is generally divided into two steps: 1) find the ROI boundary; 2) filter. When there are many ROI areas, especially when there is overlap, such as pedestrians and vehicles on the road, there will be repeated operations, low efficiency, and difficult to process in parallel. Summary of the invention

[0004] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a mask-based filtering method, which utilizes layered coding technology to concentrate boundary filtering and actions on the mask (ROI map), unifies the algorithm, and performs indiscriminate filtering operations on the entire mask, thereby solving the problems of repeated operations and low efficiency in existing methods.

[0005] The purpose of the present invention is achieved through the following technical solutions:

[0006] In a first aspect, a mask-based filtering method comprises the following steps:

[0007] S100: Obtain a residual image;

[0008] The original image is degraded to obtain a degraded image; the degraded image is subtracted from the original image to obtain a residual image;

[0009] S200: reconstruct mask;

[0010] S201: Select an area of ​​interest in the original image, the area of ​​interest is the IOR area, and other non-interested areas are background areas, and pre-generate an original image mask; S202: Filter the original image mask to obtain a reconstructed mask;

[0011] S300: final image;

[0012] The residual image is multiplied by the reconstructed mask and then added to the degraded image to get the final image.

[0013] Furthermore, the S100 specifically refers to: S101: down-sampling the original image by s times to obtain a down-sampled image; S102: then up-sampling the down-sampled image by s times using an interpolation method to obtain a degraded image with a resolution consistent with the original image.

[0014] Furthermore, in the above S201, when pre-generating the original image mask, the IOR area is represented by binary "1" and the background area is represented by binary "0".

[0015] Furthermore, the S202 specifically refers to: smoothing the original image mask by using a mean filtering algorithm, that is, smoothing the edge of the corresponding IOR area in the original image mask by using the mean.

[0016] In a second aspect, a processing system for a mask-based filtering method is provided, wherein the processing system implements the mask-based filtering method as described in any one of the above items.

[0017] In a third aspect, a processing device for a mask-based filtering method comprises at least one storage medium and at least one processor, wherein the at least one storage medium is used to store computer instructions; and the at least one processor is used to execute the computer instructions to implement any one of the mask-based filtering methods described above.

[0018] The present invention has the following advantages:

[0019] No need to extract ROI boundaries separately; the algorithm is unified, and each link processes the entire image / mask indiscriminately, which is very suitable for parallel processing; the final restored image retains more useful information, effectively improving the transmission efficiency of images and videos;

[0020] Specifically, compared with the traditional ROI boundary filtering method, this method uses common filtering algorithms, such as mean filtering, Gaussian filtering, etc., to directly filter the mask (0 represents non-ROI, 1 represents ROI) of the ROI and non-ROI areas in the identification image. According to this method, a reconstructed image is finally obtained to achieve filtering and smoothing of the ROI boundary in the image. This method cleverly avoids the tediousness of the traditional method of constantly judging the ROI boundary and then filtering the pixels within a certain range of the boundary. In addition, the algorithm uniformly processes the entire image / mask without distinction, and there is no judgment operation (the traditional method has a large amount of processing that requires judging the boundary, which is not conducive to parallelization and hardwareization), which is very friendly to parallel acceleration and hardwareization. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a schematic diagram of the process of the present invention;

[0022] Figure 2 This is a schematic diagram of smoothing using mask mean filtering;

[0023] Figure 3 It is a schematic diagram of processing predefined masks in general mask-based ROI edge filtering;

[0024] Figure 4 Schematic diagram of the reconstruction mask;

[0025] Figure 5 This is a comparison diagram of the present invention before and after filtering. DETAILED DESCRIPTION

[0026] The present invention is further described below in conjunction with the accompanying drawings, but the protection scope of the present invention is not limited to the following description.

[0027] It should be noted that the directions or positional relationships indicated by "left", "right", etc. are based on the directions or positional relationships shown in the accompanying drawings, or are the directions or positional relationships in which the inventive product is usually placed when in use, or are the directions or positional relationships commonly understood by those skilled in the art. Such terms are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on the present invention.

[0028] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features and technical solutions in the embodiments may be combined with each other.

[0029] See also Figure 1 An embodiment of the present invention discloses a mask-based filtering method, comprising the following steps:

[0030] S100: Degrading the original image to obtain a degraded image; subtracting the degraded image from the original image to obtain a residual image;

[0031] S200: reconstruct mask;

[0032] S201: Select an area of ​​interest in the original image, the area of ​​interest is the IOR area, and other non-interested areas are background areas, and pre-generate an original image mask; S202: Filter the original image mask to obtain a reconstructed mask;

[0033] S300: final image;

[0034] The residual image is multiplied by the reconstructed mask and then added to the degraded image to get the final image.

[0035] The following further describes the step of obtaining a residual image in S100.

[0036] S101. Down-conversion: for the input original image P_ori, whose resolution is M*N; specify the down-sampling ratio s, and down-sample the original image P_ori by s times, that is, obtain a resolution image of (M / s)*(N / s) size, s is the common divisor of M and N, and the image obtained after downsampling is recorded as P_down;

[0037] S102. Up-conversion: The image P_down is up-sampled by a factor of s using an interpolation algorithm, preferably a bicubic interpolation algorithm, to obtain a reconstructed image having the same resolution as the original image, i.e., a degraded image, which is denoted as P_up;

[0038] S103. Residual image: Subtract the original image from the image after upsampling and downsampling to obtain a residual image P_res, that is, P_res = P_ori - P_up.

[0039] The following further describes the S200 reconstruction mask.

[0040] S201. Figure 3 As shown, in the original image P_ori, a region of interest is selected, which is the IOR region, and other non-interested regions are background regions. Binary "1" represents the ROI region, and binary "0" represents the background region, that is,

[0041] Finally, an original image mask is stretched out. Figure 3The last figure in the figure is a matrix represented by 1 and 0;

[0042] S202. Filter the original image mask to obtain a reconstructed mask;

[0043] The general method is: the original image mask is smoothed by a mean filtering algorithm, that is, the edge of the corresponding IOR area in the original image mask is smoothed by the mean;

[0044] The specific method is: calculate the average value of the pixels around each pixel as the value of the pixel after filtering. Usually, all the pixels in the rectangular window centered on the pixel are used to calculate the average value. The larger the window, the better the filtering effect, but the image becomes more blurred, so the size of the rectangular window needs to be set according to the actual situation; for example, Figure 2 In the example, the 3*3 window is mean filtered, and the filter value of the point (x, y) is obtained by calculating the average value of the 9 points around it (including itself), that is,

[0045] To solve the problem that the edge pixels of the image cannot obtain a complete rectangular window, the upper and lower boundaries of the image are usually expanded first, and the left and right boundaries are expanded similarly. In actual calculation, only the average value of the original pixels of the image is calculated; in this way, after processing by the smoothing algorithm, a reconstructed mask is obtained. For example, the reconstructed mask is as follows: Figure 4 shown.

[0046] It should be noted that when filtering is performed in S202, in the original image mask, if a certain position of the mask is 0, the operation at this position will not work; if a certain position of the mask is not 0, the operation at this position will work, that is, only the matrix point where the mask is 1 will not change, and the rest will be 0.

[0047] The final image of S300 is further described below.

[0048] According to the image degradation process, the residual image P_res is multiplied by the reconstructed mask, and then the degraded image P_up obtained after downsampling and upsampling of the original image is added to obtain the final image restore, that is,

[0049]

[0050] Compared with the traditional ROI boundary filtering method, this method uses common filtering algorithms, such as mean filtering, Gaussian filtering, etc., to directly filter the mask (0 represents non-ROI, 1 represents ROI) of the ROI and non-ROI areas in the identification image. According to this method, a reconstructed image is finally obtained to achieve filtering and smoothing of the ROI boundary in the image. This method cleverly avoids the tediousness of the traditional method of constantly judging the ROI boundary and then filtering the pixels within a certain range of the boundary. In addition, the algorithm uniformly processes the entire image / mask without distinction, and there is no judgment operation (the traditional method has a large amount of processing that requires judging the boundary, which is not conducive to parallelization and hardwareization), which is very friendly to parallel acceleration and hardwareization.

[0051] The above embodiments only express preferred implementation modes, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention.

Claims

1. A mask-based filtering method, characterized in that: The following steps are involved: S100: Obtain a residual image; The original image is degraded to obtain a degraded image; the degraded image is subtracted from the original image to obtain a residual image; S200: reconstruct mask; S201: Select an area of ​​interest in the original image, the area of ​​interest is the IOR area, and other non-interested areas are background areas, and pre-generate an original image mask; S202: Filter the original image mask to obtain a reconstructed mask; S300: final image; The residual image is multiplied by the reconstructed mask and then added to the degraded image to get the final image.

2. The mask-based filtering method according to claim 1, characterized in that: The S100 specifically refers to: S101: down-sampling the original image by s times to obtain a down-sampled image; S102: then up-sampling the down-sampled image by s times using an interpolation method to obtain a degraded image with a resolution consistent with the original image.

3. The mask-based filtering method according to claim 1, characterized in that: In the above-mentioned S201, when pre-generating the original image mask, the IOR area is represented by binary "1" and the background area is represented by binary "0".

4. The mask-based filtering method according to claim 2, characterized in that: The above-mentioned S202 specifically refers to: smoothing the original image mask by using a mean filtering algorithm, that is, smoothing the edge of the corresponding IOR area in the original image mask by using the mean.

5. A processing system for a mask-based filtering method, characterized in that: The processing system implements the mask-based filtering method described in any one of claims 1 to 3.

6. A processing device for a mask-based filtering method, comprising at least one storage medium and at least one processor, wherein the at least one storage medium is used to store computer instructions; and the at least one processor is used to execute the computer instructions to implement the mask-based filtering method as described in any one of claims 1 to 3.