WO2021143272A1 - 基于频谱分析的马赛克去除方法、系统、终端及存储介质 - Google Patents

基于频谱分析的马赛克去除方法、系统、终端及存储介质 Download PDF

Info

Publication number
WO2021143272A1
WO2021143272A1 PCT/CN2020/124814 CN2020124814W WO2021143272A1 WO 2021143272 A1 WO2021143272 A1 WO 2021143272A1 CN 2020124814 W CN2020124814 W CN 2020124814W WO 2021143272 A1 WO2021143272 A1 WO 2021143272A1
Authority
WO
WIPO (PCT)
Prior art keywords
mosaic
image
area
peak
positioning
Prior art date
Application number
PCT/CN2020/124814
Other languages
English (en)
French (fr)
Inventor
李葛
成冠举
曾婵
高鹏
谢国彤
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021143272A1 publication Critical patent/WO2021143272A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4015Image demosaicing, e.g. colour filter arrays [CFA] or Bayer patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/60Rotation of whole images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20048Transform domain processing
    • G06T2207/20056Discrete and fast Fourier transform, [DFT, FFT]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • G06T2207/20132Image cropping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Definitions

  • This application relates to the field of image processing technology, and in particular to a mosaic removal method, system, terminal and storage medium based on spectrum analysis.
  • This application provides a mosaic removal method, system, terminal, and storage medium based on spectrum analysis, which can solve the deficiencies in the prior art to a certain extent.
  • a mosaic removal method based on spectrum analysis including:
  • the mosaic area is clipped according to the positioning to obtain an image in which the mosaic area is removed.
  • a mosaic removal system based on spectrum analysis including:
  • Fourier transform module used to perform Fourier transform on the mosaic image to obtain the spectrogram of the mosaic image
  • Mosaic positioning module used to perform spectrum analysis on the spectrogram respectively, and use a peak detection method to perform peak point detection on the spectrum analysis result, filter out peak points that meet preset conditions, and select the peak points according to the filtered peak points. Coordinate positioning of the mosaic area in the mosaic image;
  • the preset condition is:
  • the vertical axis of the peak point is greater than a first preset value, and the abscissa interval value of the peak point is greater than a second preset value;
  • Mosaic cropping module used to crop the mosaic area according to the positioning to obtain an image from which the mosaic area is removed.
  • a terminal wherein the terminal includes a processor, a memory coupled to the processor, and is stored in the memory and can run on the processor
  • the processor executes the program instructions, the following steps are implemented:
  • the mosaic area is clipped according to the positioning to obtain an image in which the mosaic area is removed.
  • a storage medium in which a program file that can be run by a processor is stored, and when the program file is executed by the processor, the following steps are implemented:
  • the mosaic area is clipped according to the positioning to obtain an image in which the mosaic area is removed.
  • the beneficial effect of this application is that the embodiments of this application use Fourier transform to perform spectral analysis on the mosaic image, and detect the spectral difference between the mosaic area and other areas, so as to automatically, quickly and accurately locate the mosaic area in the image. And removal, avoiding the introduction of noise, is conducive to improving the accuracy of image analysis, and has been well embodied in terms of efficiency and practicability.
  • FIG. 1 is a schematic flowchart of a mosaic removal method based on spectrum analysis according to a first embodiment of the present application
  • FIG. 2 is a schematic flowchart of a mosaic removal method based on spectrum analysis according to a second embodiment of the present application
  • Figure 3 is a schematic diagram of a frame of face image intercepted from a video
  • FIG. 4 is a schematic flowchart of a mosaic removal method based on spectrum analysis according to a third embodiment of the present application.
  • FIG. 5 is a schematic diagram of a face boundary image detected by an embodiment of the application.
  • Fig. 6 is a spectrogram obtained after Fourier transform is performed on a face boundary image according to an embodiment of the application; where (a), (b), (c), and (d) are the 180th and 184th face boundary images, respectively , 200, 294 line of the spectrogram;
  • FIG. 7 is a high-low frequency ratio diagram calculated based on a spectrogram according to an embodiment of the application.
  • FIG. 8 is a high-low frequency ratio map obtained by detection based on the high-low frequency ratio map according to an embodiment of the application.
  • FIG. 9 is a face image after removing the mosaic area by using the third embodiment of the present application.
  • FIG. 10 is a schematic flowchart of a mosaic removal method based on spectrum analysis according to a fourth embodiment of the present application.
  • FIG. 11 is a face image after the mosaic area is removed by using the fourth embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a mosaic removal system based on spectrum analysis according to an embodiment of the present application.
  • FIG. 13 is a schematic diagram of a terminal structure according to an embodiment of the present application.
  • FIG. 14 is a schematic diagram of the structure of a storage medium according to an embodiment of the present application.
  • first”, “second”, and “third” in this application are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined with “first”, “second”, and “third” may explicitly or implicitly include at least one of the features.
  • "a plurality of” means at least two, such as two, three, etc., unless otherwise specifically defined. All directional indicators (such as up, down, left, right, front, back%) in the embodiments of this application are only used to explain the relative positional relationship between the components in a specific posture (as shown in the drawings) , Movement status, etc., if the specific posture changes, the directional indication will also change accordingly.
  • FIG. 1 is a schematic flowchart of a mosaic removal method based on spectrum analysis according to a first embodiment of the present application.
  • the mosaic removal method based on spectrum analysis in the first embodiment of the present application includes the following steps:
  • S10 Perform Fourier transform on the mosaic image to obtain a spectrogram of the mosaic image
  • the Fourier transform of the mosaic image is specifically:
  • the pixel values in the boundary image are grouped by rows, and the Fourier transform is performed on each group of pixel values to obtain a spectrogram corresponding to each group of pixel values.
  • S11 Perform spectrum analysis on the spectrogram respectively, and perform peak point detection on the spectrum analysis result using a peak detection method, and filter out peak points that meet preset conditions;
  • the preset condition is that the vertical axis of the peak point is greater than a first preset value, and the abscissa interval value of the peak point is greater than a second preset value.
  • the specific location of the mosaic area is:
  • Sort the abscissa of the peak points count the interval values of the abscissa of the peak points, filter out the peak points whose interval value is greater than the second preset value, record the ordinate of the peak points, and obtain the The coordinate position information of the mosaic area in the original mosaic image.
  • the first embodiment of the present application uses Fourier transform to perform spectrum analysis on the mosaic image, and detects the spectrum difference between the mosaic area and other areas, thereby automatically, quickly and accurately positioning the mosaic area in the image, and
  • the removal of the mosaic area obtained by positioning in the image avoids the introduction of noise, which is beneficial to improve the accuracy of image analysis, and has been well embodied in terms of efficiency and practicability.
  • FIG. 2 is a schematic flowchart of a mosaic removal method based on spectrum analysis according to a second embodiment of the present application.
  • the mosaic removal method based on spectrum analysis in the second embodiment of the present application includes the following steps:
  • S21 Use the sobel operator to detect edge pixels of the mosaic image to obtain the boundary image of the mosaic image
  • the sobel operator is a discrete difference operator, which is used to calculate the approximate gradient of the brightness value of the image pixel.
  • the specific edge detection algorithm is:
  • the boundary image obtained after edge detection of the mosaic image using the sobel operator is:
  • S22 Group the pixel values in the boundary image by row, and perform Fourier transform on each group of pixel values to obtain a spectrogram corresponding to each group of pixel values;
  • the pixel value grouping method is: grouping by the height value of the image, and taking the width value of the image as the pixel value data of each group.
  • S23 Perform spectrum analysis on each spectrogram separately, calculate the frequency ratio of the low frequency to the high frequency of each spectrogram according to the set high and low frequency critical point value, and obtain the high and low frequency ratio map of each spectrogram;
  • this application performs spectrum analysis based on this rule.
  • the critical point value of high and low frequency can be set according to empirical statistics.
  • S24 Use the peak detection method to detect the peak points of the high-low frequency ratio map of each spectrogram to obtain the peak point map, and then filter out all the peak points whose vertical axis is greater than the first preset value from the peak point map, and record The abscissa of the selected peak point;
  • the first preset value can be set according to the location and size of the mosaic area in the mosaic image.
  • S25 Sort the horizontal coordinates of the selected peak points, and filter out the peak points whose horizontal coordinate interval is greater than the second preset value, record the vertical coordinates of the selected peak points, and obtain the vertical coordinates of the mosaic area in the mosaic image. Coordinate location information;
  • the peak point filtering method is as follows: the abscissa interval value of the peak point filtered in each peak point graph is counted separately, if the abscissa interval value between one peak point and another peak point in a peak point graph If it is greater than the second preset value, the peak point is considered to be the starting position of the mosaic area in the mosaic image, and the ordinate corresponding to the peak point is the ordinate position information of the starting position of the mosaic area; and so on, until completion By filtering all peak point images, the ordinate position information of the entire mosaic area in the mosaic image can be obtained.
  • the second preset value can be set according to the length or size of the mosaic area.
  • the ordinate positioning result of the mosaic area obtained after the rotation is the abscissa of the mosaic area in the original mosaic image.
  • the second embodiment of the present application performs edge detection on the mosaic image, and then uses Fourier transform to perform spectrum analysis on the edge detection image to detect the spectral difference between the mosaic area and other areas, so as to perform the analysis on the mosaic area in the image.
  • Automatic, fast and accurate positioning, and remove the mosaic area obtained by positioning in the image avoid the introduction of noise, help improve the accuracy of image analysis, and have a good performance in efficiency and practicability.
  • the following embodiments specifically describe the application of the present application to the removal of eye mosaics in a face image.
  • Figure 3 it is a frame of face image taken from the video. It can be clearly seen that the eyes in the face image are covered by mosaic, and the color change of the mosaic area and the color change of key parts of the face Keep the same, so it is impossible to directly use the color difference of the mosaic in the image to remove it.
  • the mosaic area is a large rectangular block spliced by multiple small rectangular color blocks. Therefore, as long as the difference between the mosaic area and other areas in the face image is found, the positioning of the mosaic area can be realized. The mosaic area is removed.
  • FIG. 4 is a schematic flowchart of a mosaic removal method based on spectrum analysis according to a third embodiment of the present application.
  • the mosaic removal method based on spectrum analysis in the third embodiment of the present application includes the following steps:
  • S31 Use the sobel operator to perform edge pixel detection on the face image to obtain the face boundary image
  • the detected face boundary image is shown in FIG. 5.
  • S32 Group the pixel values in the face boundary image by row, and perform Fourier transform on each group of pixel values to obtain a spectrogram corresponding to each group of pixel values;
  • the face boundary image shown in Figure 5 is an image with a height of 473 and a width of 373
  • it is divided into 473 groups of pixel data.
  • Each group of pixel data includes 373 pixel values, and then each group of pixel data Perform Fourier transform, and the resulting spectrum is shown in Figure 6, (a), (b), (c), (d) are the spectrum of the 180th, 184, 200, and 294th line in Figure 5, respectively
  • the horizontal axis in the figure represents the frequency
  • the vertical axis represents the amplitude.
  • S33 Perform spectrum analysis on the spectrogram, calculate the frequency ratio between the low frequency and the high frequency of each spectrogram according to the set high and low frequency critical point values, and obtain the high and low frequency ratio map of each spectrogram;
  • the relatively smooth curve is in the Fourier transformed spectrogram, most of the information is concentrated in the low frequency part, as shown in Figure 6 (a) and (c) as shown in the 180th
  • the frequency distribution is wider in the section line where the mosaic is located, as shown in the 184th and 200th lines in Figure 6 (b) and (d).
  • the high-low frequency critical point value is set to 15 according to the empirical statistical value of the face image, and the high-low frequency ratio map calculated according to the high-low frequency critical point value is shown in FIG. 7.
  • S34 Use the peak detection method to detect the peak points of the high-low frequency ratio map of each spectrogram to obtain the peak point map, and then filter out all the peak points whose vertical axis is greater than the first preset value from the peak point map, and record The abscissa of the selected peak point;
  • the peak point map obtained by peak point detection is shown in Figure 8.
  • the embodiment of the present application first removes the peak points whose horizontal axis is less than 80 in the high-low frequency ratio graph, and then performs Selection of peak points.
  • the first preset value is set to 0.5.
  • S35 Sort the horizontal coordinates of the selected peak points, select the peak points whose horizontal coordinate interval is greater than the second preset value, record the vertical coordinates of the selected peak points, and obtain the vertical coordinates of the eye mosaic in the mosaic image. Coordinate location information;
  • the second preset value is preferably set to 25.
  • S36 Rotate the face image by 90°, and re-execute S31 to S35, and perform the ordinate positioning of the eye mosaic area on the rotated face image again;
  • the ordinate positioning result of the mosaic area of the eye obtained after the rotation is the abscissa of the mosaic area in the original face image.
  • the embodiments of the present application can be applied to multiple types of mosaic images, and can locate and remove multiple mosaic regions in an image.
  • the following embodiment takes the removal of eye mosaic and mouth mosaic in the face image shown in FIG. 2 as an example for specific description.
  • FIG. 10 is a schematic flowchart of a mosaic removal method based on spectrum analysis according to a fourth embodiment of the present application.
  • the method for removing mosaic based on spectrum analysis in the fourth embodiment of the present application includes the following steps:
  • S41 Use the sobel operator to detect the edge pixels of the face image to obtain the face boundary image
  • the detected face boundary image is shown in Figure 5.
  • S42 Group the pixel values in the face boundary image by row, and perform Fourier transform on each group of pixel values to obtain a spectrogram corresponding to each group of pixel values;
  • the face boundary image shown in Figure 5 is an image with a height of 473 and a width of 373
  • it is divided into 473 groups of pixel data.
  • Each group of pixel data includes 373 pixel values, and then each group of pixel data Perform Fourier transform, and the resulting spectrum is shown in Figure 6, (a), (b), (c), (d) are the spectrum of the 180th, 184, 200, and 294th line in Figure 5, respectively
  • the horizontal axis in the figure represents the frequency
  • the vertical axis represents the amplitude.
  • S33 Perform spectrum analysis on the spectrogram, calculate the frequency ratio between the low frequency and the high frequency of each spectrogram according to the set high and low frequency critical point values, and obtain the high and low frequency ratio map of each spectrogram;
  • the relatively smooth curve is in the Fourier transformed spectrogram, most of the information is concentrated in the low frequency part, as shown in Figure 6 (a) and (c) as shown in the 180th
  • the frequency distribution is wider in the section line where the mosaic is located, as shown in the 184th and 200th lines in Figure 6 (b) and (d).
  • the high-low frequency critical point value is set to 15 according to the empirical statistical value of the face image, and the high-low frequency ratio map calculated according to the high-low frequency critical point value is shown in FIG. 7.
  • S44 Use the peak detection method to detect the peak points of the high-low frequency ratio map of each spectrogram to obtain the peak point map, and then filter out all peak points whose vertical axis is greater than the first preset value from the peak point map, and record The abscissa of the selected peak point;
  • the peak point map obtained by peak point detection is shown in Figure 8.
  • the embodiment of the present application first removes the peak points whose horizontal axis is less than 80 in the high-low frequency ratio graph, and then performs Selection of peak points.
  • the first preset value is set to 0.5.
  • S45 Sort the horizontal coordinates of the selected peak points, select the peak points whose horizontal coordinate interval is greater than the second preset value, record the vertical coordinates of the selected peak points, and obtain two mosaics of the eye and the mouth respectively The ordinate position information of the area in the mosaic image;
  • the second preset value is preferably set to 25.
  • S46 Divide the two mosaic areas of the eye and mouth in the face image into two images, rotate the two images by 90°, and re-execute S41 to S45 to perform eye mosaics on the two rotated images. The ordinate positioning of the area and the mosaic area of the mouth;
  • the ordinate positioning results of the eye mosaic area and the mouth mosaic area obtained after rotation are the abscissas of the two mosaic areas in the original face image.
  • the corresponding summary information is obtained based on the result of the mosaic removal method based on spectrum analysis.
  • the summary information is obtained by hashing the result of the mosaic removal method based on spectrum analysis, for example, using sha256s
  • the algorithm is processed. Uploading summary information to the blockchain can ensure its security and fairness and transparency to users. The user can download the summary information from the blockchain to verify whether the result of the mosaic removal method based on spectrum analysis has been tampered with.
  • the blockchain referred to in this example is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information for verification. The validity of the information (anti-counterfeiting) and the generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • FIG. 12 is a schematic structural diagram of a mosaic removal system based on spectrum analysis in an embodiment of the present application.
  • the mosaic removal system 40 based on spectrum analysis in the embodiment of the present application includes:
  • Fourier transform module 41 used to perform Fourier transform on the original mosaic image to obtain a spectrogram of the mosaic image
  • Mosaic positioning module 42 used to perform spectrum analysis on the spectrogram respectively, and use a peak detection method to perform peak point detection on the spectrum analysis result, filter out peak points that meet preset conditions, and select peak points based on the selected peak points. To locate the mosaic area in the original mosaic image;
  • the preset condition is:
  • the vertical axis of the peak point is greater than a first preset value, and the abscissa interval value of the peak point is greater than a second preset value;
  • Mosaic cropping module 43 used to crop the mosaic area according to the positioning to obtain an image from which the mosaic area is removed.
  • FIG. 13 is a schematic diagram of a terminal structure according to an embodiment of the application.
  • the terminal 50 includes a processor 51 and a memory 52 coupled to the processor 51.
  • the memory 52 stores program instructions for implementing the above-mentioned mosaic removal method based on spectrum analysis.
  • the processor 51 is configured to execute program instructions stored in the memory 52 to perform a mosaic removal operation based on spectrum analysis.
  • the processor 51 may also be referred to as a CPU (Central Processing Unit, central processing unit).
  • the processor 51 may be an integrated circuit chip with signal processing capability.
  • the processor 51 may also be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component.
  • DSP digital signal processor
  • ASIC application specific integrated circuit
  • FPGA off-the-shelf programmable gate array
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • FIG. 14 is a schematic structural diagram of a storage medium according to an embodiment of the application.
  • the storage medium of the embodiment of the present application stores a program file 61 that can implement all the above methods.
  • the program file 61 can be stored in the above storage medium in the form of a software product, and includes a number of instructions to enable a computer device (which can It is a personal computer, a server, or a network device, etc.) or a processor (processor) that executes all or part of the steps of the methods in the various embodiments of this application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. , Or terminal devices such as computers, servers, mobile phones, and tablets.
  • the storage medium may be non-volatile or volatile.
  • the disclosed system, terminal, and method may be implemented in other ways.
  • the system embodiment described above is only illustrative, for example, the division of units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit. The above are only implementations of this application, and do not limit the scope of this application. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of this application, or directly or indirectly applied to other related technical fields, The same reasoning is included in the scope of patent protection of this application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)

Abstract

本申请公开了一种基于频谱分析的马赛克去除方法、系统、终端及存储介质。所述方法包括:对原始马赛克图像进行傅里叶变换,得到所述马赛克图像的频谱图;对所述频谱图分别进行频谱分析,并使用峰值检测方法对所述频谱分析结果进行峰值点检测,筛选出满足预设条件的峰值点,根据所述筛选的峰值点的坐标对所述原始马赛克图像中的马赛克区域进行定位;根据所述定位对所述马赛克区域进行剪裁,得到去除马赛克区域的图像。本申请实施例通过利用傅里叶变换对马赛克图像进行频谱分析,检测出马赛克区域与其他区域的频谱差异,从而对图像中的马赛克区域进行自动、快速、精确的定位及去除,避免了噪声的引入,有利于提高图像分析的准确性。

Description

基于频谱分析的马赛克去除方法、系统、终端及存储介质
本申请要求于2020年09月04日提交中国专利局、申请号为202010921922.1,发明名称为“一种基于频谱分析的马赛克去除方法、系统、终端及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及图像处理技术领域,特别是涉及一种基于频谱分析的马赛克去除方法、系统、终端及存储介质。
背景技术
互联网时代,为了图片或视频上展示信息的隐私性,需要在一些特定部位打上马赛克;然而大面积的马赛克也会带来噪声污染,影响图像分析等技术的准确性。以人脸视频心率估计为例,由于个人隐私问题,人脸图像中的眼镜和嘴巴部分通常都会被打上马赛克,但由于人脸视频心率估计需要基于人脸面部皮肤的微小变动进行信号检测,大面积的马赛克为人脸视频心率估计带来了重大的挑战。因此去除马赛克在图像分析任务中显得至关重要。
现有技术中大多数关于马赛克去除的研究都是利用生成对抗网络对图片中马赛克进行复原,例如PLUSE(Photo Upsampling via Latent Space Exploration,生成模型潜空间探索自监督照片上采样)方法。然而,发明人意识到这些方法都是利用欧美国家人脸数据集训练出来的模型,实际使用中存在很大的局限性,并且利用PLUSE方法进行复原的人脸不但不能提升模型精度,反而引入了更大的噪声。
发明内容
本申请提供了一种基于频谱分析的马赛克去除方法、系统、终端及存储介质,能够在一定程度上解决现有技术中存在的不足。
为解决上述技术问题,本申请采用的技术方案为:一种基于频谱分析的马赛克去除方法,包括:
对马赛克图像进行傅里叶变换,得到所述马赛克图像的频谱图;
对所述频谱图分别进行频谱分析,并使用峰值检测方法对所述频谱分析结果进行峰值点检测,筛选出满足预设条件的峰值点,其中,所述预设条件为:所述峰值点的纵轴大于第一预设值,且所述峰值点的横坐标间隔值大于第二预设值;
根据所述筛选的峰值点的坐标对所述马赛克图像中的马赛克区域进行定位;
根据所述定位对所述马赛克区域进行剪裁,得到去除马赛克区域的图像。
本申请实施例采取的另一技术方案为:一种基于频谱分析的马赛克去除系统,包括:
傅里叶变换模块:用于对马赛克图像进行傅里叶变换,得到所述马赛克图像的频谱图;
马赛克定位模块:用于对所述频谱图分别进行频谱分析,并使用峰值检测方法对所述频谱分析结果进行峰值点检测,筛选出满足预设条件的峰值点,根据所述筛选的峰值点的坐标对所述马赛克图像中的马赛克区域进行定位;
其中,所述预设条件为:
所述峰值点的纵轴大于第一预设值,且所述峰值点的横坐标间隔值大于第二预 设值;
马赛克剪裁模块:用于根据所述定位对所述马赛克区域进行剪裁,得到去除马赛克区域的图像。
本申请实施例采取的又一技术方案为:一种终端,其中,所述终端包括处理器、与所述处理器耦接的存储器以及存储在所述存储器上并可在所述处理器上运行的程序指令,所述处理器执行所述程序指令时实现以下步骤:
对马赛克图像进行傅里叶变换,得到所述马赛克图像的频谱图;
对所述频谱图分别进行频谱分析,并使用峰值检测方法对所述频谱分析结果进行峰值点检测,筛选出满足预设条件的峰值点,其中,所述预设条件为:所述峰值点的纵轴大于第一预设值,且所述峰值点的横坐标间隔值大于第二预设值;
根据所述筛选的峰值点的坐标对所述马赛克图像中的马赛克区域进行定位;
根据所述定位对所述马赛克区域进行剪裁,得到去除马赛克区域的图像。
本申请实施例采取的又一技术方案为:一种存储介质,其中,存储有处理器可运行的程序文件,所述程序文件被处理器执行时实现以下步骤:
对马赛克图像进行傅里叶变换,得到所述马赛克图像的频谱图;
对所述频谱图分别进行频谱分析,并使用峰值检测方法对所述频谱分析结果进行峰值点检测,筛选出满足预设条件的峰值点,其中,所述预设条件为:所述峰值点的纵轴大于第一预设值,且所述峰值点的横坐标间隔值大于第二预设值;
根据所述筛选的峰值点的坐标对所述马赛克图像中的马赛克区域进行定位;
根据所述定位对所述马赛克区域进行剪裁,得到去除马赛克区域的图像。
本申请的有益效果是:本申请实施例通过利用傅里叶变换对马赛克图像进行频谱分析,检测出马赛克区域与其他区域的频谱差异,从而对图像中的马赛克区域进行自动、快速、精确的定位及去除,避免了噪声的引入,有利于提高图像分析的准确性,在高效性和实用性上都得到了良好的体现。
附图说明
图1是本申请第一实施例的基于频谱分析的马赛克去除方法的流程示意图;
图2是本申请第二实施例的基于频谱分析的马赛克去除方法的流程示意图;
图3为从视频中截取的一帧人脸图像示意图;
图4是本申请第三实施例的基于频谱分析的马赛克去除方法的流程示意图;
图5为本申请实施例检测到的人脸边界图像示意图;
图6为本申请实施例对人脸边界图像进行傅里叶变换后得到的频谱图;其中,(a)、(b)、(c)、(d)分别为人脸边界图像中第180、184、200、294行剖行线的频谱图;
图7为本申请实施例基于频谱图计算得到的高低频率比值图;
图8为本申请实施例基于高低频率比值图检测得到的高低频率比值图;
图9为利用本申请第三实施例去除马赛克区域后的人脸图像;
图10是本申请第四实施例的基于频谱分析的马赛克去除方法的流程示意图;
图11为利用本申请第四实施例去除马赛克区域后的人脸图像;
图12是本申请实施例基于频谱分析的马赛克去除系统的结构示意图;
图13是本申请实施例的终端结构示意图;
图14是本申请实施例的存储介质结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请中的术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”、“第三”的特征可以明示或者隐含地包括至少一个该特征。本申请的描述中,“多个”的含义是至少两个,例如两个,三个等,除非另有明确具体的限定。本申请实施例中所有方向性指示(诸如上、下、左、右、前、后……)仅用于解释在某一特定姿态(如附图所示)下各部件之间的相对位置关系、运动情况等,如果该特定姿态发生改变时,则该方向性指示也相应地随之改变。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。
请参阅图1,是本申请第一实施例的基于频谱分析的马赛克去除方法的流程示意图。本申请第一实施例的基于频谱分析的马赛克去除方法包括以下步骤:
S10:对马赛克图像进行傅里叶变换,得到所述马赛克图像的频谱图;
其中,对马赛克图像进行傅里叶变换具体为:
利用sobel算子对所述马赛克图像进行边缘像素点检测,得到所述马赛克图像的边界图像;
按行对所述边界图像中的像素值进行分组,并分别对每组像素值进行傅里叶变换,得到每组像素值对应的频谱图。
S11:对所述频谱图分别进行频谱分析,并使用峰值检测方法对所述频谱分析结果进行峰值点检测,筛选出满足预设条件的峰值点;
其中,由于没有马赛克的区域频谱相对平滑,而马赛克区域的频谱相对震荡,本申请基于此规律进行频谱分析。所述预设条件为:所述峰值点的纵轴大于第一预设值,且所述峰值点的横坐标间隔值大于第二预设值。
S12:根据所述筛选的峰值点的坐标对所述马赛克图像中的马赛克区域进行定位;
其中,马赛克区域定位具体为:
根据设定的高低频率临界点值计算得到每个频谱图的低频与高频的频率比,得到每个频谱图的高低频率比值图;
使用峰值检测方法对所述高低频率比值图进行峰值点检测,得到峰值点图;
从所述峰值点图中筛选出纵轴大于第一预设值的所有峰值点,并记录所述峰值点所在的横坐标;
对所述峰值点横坐标进行排序,并统计所述峰值点横坐标的间隔值,筛选出所述间隔值大于第二预设值的峰值点,记录所述峰值点的纵坐标,得到所述马赛克区域在所述原始马赛克图像中的坐标位置信息。
S13:根据所述定位对所述马赛克区域进行剪裁,得到去除马赛克区域的图像。
基于上述,本申请第一实施例通过利用傅里叶变换对马赛克图像进行频谱分析,检测出马赛克区域与其他区域的频谱差异,从而对图像中的马赛克区域进行自动、快速、精确的定位,并去除图像中定位得到的马赛克区域,避免了噪声的引入,有利于提高图像分析的准确性,在高效性和实用性上都得到了良好的体现。
进一步地,请参阅图2,是本申请第二实施例的基于频谱分析的马赛克去除方法的流程示意图。本申请第二实施例的基于频谱分析的马赛克去除方法包括以下步骤:
S20:读取马赛克图像;
S21:利用sobel算子对马赛克图像进行边缘像素点检测,得到马赛克图像的边界图像;
本步骤中,sobel算子是一个离散差分算子,用于计算图像像素点亮度值的近似梯度。边缘检测算法具体为:
记马赛克图像为I,sobel算子沿水平和垂直方向的算子分别为:
Figure PCTCN2020124814-appb-000001
Figure PCTCN2020124814-appb-000002
利用sobel算子对马赛克图像进行边缘检测后得到的边界图像为:
Figure PCTCN2020124814-appb-000003
S22:按行对边界图像中的像素值进行分组,并分别对每组像素值进行傅里叶变换,得到每组像素值对应的频谱图;
本步骤中,像素值分组方式为:以图像的高度值进行分组,以图像的宽度值作为每组的像素值数据。
S23:对每个频谱图分别进行频谱分析,根据设定的高低频率临界点值计算得到每个频谱图的低频与高频的频率比,得到每个频谱图的高低频率比值图;
本步骤中,由于没有马赛克的区域频谱相对平滑,而马赛克区域的频谱相对震荡,本申请基于此规律进行频谱分析。高低频率临界点值可根据经验统计值进行设定。
S24:使用峰值检测方法分别对每个频谱图的高低频率比值图进行峰值点检测,得到峰值点图,然后从峰值点图中筛选出纵轴大于第一预设值的所有峰值点,并记录筛选的峰值点所在的横坐标;
本步骤中,第一预设值可根据马赛克图像中马赛克区域所在位置及大小进行设定。
S25:对筛选的峰值点横坐标进行排序,并筛选出横坐标间隔值大于第二预设值的峰值点,记录所述筛选出的峰值点的纵坐标,得到马赛克区域在马赛克图像中的纵坐标位置信息;
本步骤中,峰值点筛选方式为:分别对每个峰值点图中筛选得到的峰值点横坐标间隔值进行统计,如果一个峰值点图中的一个峰值点与另一个峰值点的横坐标间隔值大于第二预设值,则认为该峰值点为马赛克区域在马赛克图像中的起始位置,该峰值点对应的纵坐标即为马赛克区域起始位置的纵坐标位置信息;以此类推,直到完成所有峰值点图的筛选,即可得到整个马赛克区域在马赛克图像中的纵坐标位 置信息。其中,第二预设值可根据马赛克区域的长度或大小进行设定。
S26:将马赛克图像旋转90°,并重新执行S21至S25,再次对旋转后的马赛克图像进行马赛克区域的纵坐标定位;
本步骤中,可以理解,旋转后得到的马赛克区域纵坐标定位结果即为马赛克区域在原始马赛克图像中的横坐标。
S27:根据两次纵坐标定位结果对马赛克区域进行剪裁,得到去除马赛克区域的图像;
基于上述,本申请第二实施例对马赛克图像进行边缘检测,然后通过利用傅里叶变换对边缘检测图像进行频谱分析,检测出马赛克区域与其他区域的频谱差异,从而对图像中的马赛克区域进行自动、快速、精确的定位,并去除图像中定位得到的马赛克区域,避免了噪声的引入,有利于提高图像分析的准确性,在高效性和实用性上都得到了良好的体现。
为了更加清楚的说明本申请的实施过程,以下实施例通过将本申请应用于人脸图像中眼部马赛克的去除进行具体描述。如图3所示,为从视频中截取出的一帧人脸图像,可以清楚看到,人脸图像中的眼部被马赛克覆盖,且该马赛克区域的色彩变换与人脸关键部位的色彩变化保持一致,因此无法直接利用图像中马赛克的色彩差异对其进行去除。由图中可以直观的看出,马赛克区域是由多个小矩形色块拼接成的大矩形块,因此只要找到马赛克区域与人脸图像中其他区域的差异即可实现马赛克区域的定位,从而将马赛克区域进行去除。
具体的,请参阅图4,是本申请第三实施例的基于频谱分析的马赛克去除方法的流程示意图。本申请第三实施例的基于频谱分析的马赛克去除方法包括以下步骤:
S30:读取包含马赛克区域的人脸图像;
S31:利用sobel算子对人脸图像进行边缘像素点检测,得到人脸边界图像;
其中,以图2所示的人脸头像为例,检测到的人脸边界图像如图5所示。
S32:按行对人脸边界图像中的像素值进行分组,并分别对每组像素值进行傅里叶变换,得到每组像素值对应的频谱图;
其中,假设图5所示的人脸边界图像为高473、宽373的图像,则将其分为473组像素数据,每组像素数据中分别包括373个像素值,然后分别对每组像素数据进行傅里叶变换,得到的频谱图如图6所示,(a)、(b)、(c)、(d)分别为图5中第180、184、200、294行剖行线的频谱图,图中横轴代表频率,纵轴代表振幅。
S33:对频谱图进行频谱分析,根据设定的高低频率临界点值计算得到每个频谱图的低频与高频的频率比,得到每个频谱图的高低频率比值图;
其中,由图6可以看出,相对平滑的曲线在傅里叶变换后的频谱图中,大部分信息都集中在低频部分,如图6中的(a)和(c)所示的第180行和200行;而马赛克所在的剖行线中则频率分布更广,如图6中的(b)和(d)所示的第184行和200行。本申请实施例根据人脸图像的经验统计值将高低频率临界点值设定为15,根据高低频率的临界点值计算得到的高低频率比值图如图7所示。
S34:使用峰值检测方法分别对每个频谱图的高低频率比值图进行峰值点检测,得到峰值点图,然后从峰值点图中筛选出纵轴大于第一预设值的所有峰值点,并记录筛选的峰值点所在的横坐标;
其中,峰值点检测得到的峰值点图如图8所示。根据所有人脸图像数据集统计出的先验值,人脸图像中前80行不会出现马赛克,因此,本申请实施例首先去除高低频率比值图中横轴小于80的峰值点,然后再进行峰值点的筛选。优选地,第一预设值设定为0.5。
S35:对筛选的峰值点横坐标进行排序,筛选出横坐标间隔值大于第二预设值的峰值点,记录所述筛选出的峰值点的纵坐标,得到眼部马赛克在马赛克图像中的纵坐标位置信息;
其中,第二预设值优选设定为25。
S36:将人脸图像旋转90°,并重新执行S31至S35,再次对旋转后的人脸图像进行眼部马赛克区域的纵坐标定位;
其中,可以理解,旋转后得到的眼部马赛克区域的纵坐标定位结果即为该马赛克区域在原始人脸图像中的横坐标。
S37:根据两次纵坐标定位结果对眼部马赛克区域进行剪裁,得到去除眼部马赛克区域的人脸图像;
其中,去除马赛克区域后的人脸图像如图9所示。
可以理解,本申请实施例可以应用于多种类型的马赛克图像,并可对一幅图像中的多个马赛克区域进行定位及去除。以下实施例以图2所示的人脸图像中眼部马赛克和嘴部马赛克去除为例进行具体说明。
请一并参阅图10,是本申请第四实施例的基于频谱分析的马赛克去除方法的流程示意图。本申请第四实施例的基于频谱分析的马赛克去除方法包括以下步骤:
S40:读取包含马赛克区域的人脸图像;
S41:利用sobel算子对人脸图像进行边缘像素点检测,得到人脸边界图像;
其中,检测到的人脸边界图像如图5所示。
S42:按行对人脸边界图像中的像素值进行分组,并分别对每组像素值进行傅里叶变换,得到每组像素值对应的频谱图;
其中,假设图5所示的人脸边界图像为高473、宽373的图像,则将其分为473组像素数据,每组像素数据中分别包括373个像素值,然后分别对每组像素数据进行傅里叶变换,得到的频谱图如图6所示,(a)、(b)、(c)、(d)分别为图5中第180、184、200、294行剖行线的频谱图,图中横轴代表频率,纵轴代表振幅。
S33:对频谱图进行频谱分析,根据设定的高低频率临界点值计算得到每个频谱图的低频与高频的频率比,得到每个频谱图的高低频率比值图;
其中,由图6可以看出,相对平滑的曲线在傅里叶变换后的频谱图中,大部分信息都集中在低频部分,如图6中的(a)和(c)所示的第180行和200行;而马赛克所在的剖行线中则频率分布更广,如图6中的(b)和(d)所示的第184行和200行。本申请实施例根据人脸图像的经验统计值将高低频率临界点值设定为15,根据高低频率的临界点值计算得到的高低频率比值图如图7所示。
S44:使用峰值检测方法分别对每个频谱图的高低频率比值图进行峰值点检测,得到峰值点图,然后从峰值点图中筛选出纵轴大于第一预设值的所有峰值点,并记录筛选的峰值点所在的横坐标;
其中,峰值点检测得到的峰值点图如图8所示。根据所有人脸图像数据集统计出的先验值,人脸图像中前80行不会出现马赛克,因此,本申请实施例首先去除高低频率比值图中横轴小于80的峰值点,然后再进行峰值点的筛选。优选地,第一预设值设定为0.5。
S45:对筛选的峰值点横坐标进行排序,筛选出横坐标间隔值大于第二预设值的峰值点,记录所述筛选出的峰值点的纵坐标,分别得到眼部和嘴部两个马赛克区域在马赛克图像中的纵坐标位置信息;
其中,第二预设值优选设定为25。
S46:将人脸图像中眼部和嘴部两个马赛克区域分割为两幅图像,将两幅图像分 别旋转90°,并重新执行S41至S45,分别对旋转后的两幅图像进行眼部马赛克区域和嘴部马赛克区域的纵坐标定位;
其中,可以理解,旋转后得到的眼部马赛克区域和嘴部马赛克区域的纵坐标定位结果即为两个马赛克区域在原始人脸图像中的横坐标。
S47:根据两次纵坐标定位结果分别对眼部和嘴部马赛克区域进行剪裁,得到去除马赛克区域的人脸图像;
其中,去除马赛克区域后的人脸图像如图11所示。
在一个可选的实施方式中,还可以:将所述的基于频谱分析的马赛克去除方法的结果上传至区块链中。
具体地,基于所述的基于频谱分析的马赛克去除方法的结果得到对应的摘要信息,具体来说,摘要信息由所述的基于频谱分析的马赛克去除方法的结果进行散列处理得到,比如利用sha256s算法处理得到。将摘要信息上传至区块链可保证其安全性和对用户的公正透明性。用户可以从区块链中下载得该摘要信息,以便查证所述的基于频谱分析的马赛克去除方法的结果是否被篡改。本示例所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
请参阅图12,是本申请实施例基于频谱分析的马赛克去除系统的结构示意图。本申请实施例基于频谱分析的马赛克去除系统40包括:
傅里叶变换模块41:用于对原始马赛克图像进行傅里叶变换,得到所述马赛克图像的频谱图;
马赛克定位模块42:用于对所述频谱图分别进行频谱分析,并使用峰值检测方法对所述频谱分析结果进行峰值点检测,筛选出满足预设条件的峰值点,根据所述筛选的峰值点的坐标对所述原始马赛克图像中的马赛克区域进行定位;
其中,所述预设条件为:
所述峰值点的纵轴大于第一预设值,且所述峰值点的横坐标间隔值大于第二预设值;
马赛克剪裁模块43:用于根据所述定位对所述马赛克区域进行剪裁,得到去除马赛克区域的图像。
请参阅图13,为本申请实施例的终端结构示意图。该终端50包括处理器51、与处理器51耦接的存储器52。
存储器52存储有用于实现上述基于频谱分析的马赛克去除方法的程序指令。
处理器51用于执行存储器52存储的程序指令以执行基于频谱分析的马赛克去除操作。
其中,处理器51还可以称为CPU(Central Processing Unit,中央处理单元)。处理器51可能是一种集成电路芯片,具有信号的处理能力。处理器51还可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
请参阅图14,图14为本申请实施例的存储介质的结构示意图。本申请实施例的存储介质存储有能够实现上述所有方法的程序文件61,其中,该程序文件61可以以软件产品的形式存储在上述存储介质中,包括若干指令用以使得一台计算机设 备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施方式方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质,或者是计算机、服务器、手机、平板等终端设备。所述存储介质可以是非易失性,也可以是易失性。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,终端和方法,可以通过其它的方式实现。例如,以上所描述的系统实施例仅仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。以上仅为本申请的实施方式,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (22)

  1. 一种基于频谱分析的马赛克去除方法,其中,包括:
    对马赛克图像进行傅里叶变换,得到所述马赛克图像的频谱图;
    对所述频谱图分别进行频谱分析,并使用峰值检测方法对所述频谱分析结果进行峰值点检测,筛选出满足预设条件的峰值点,其中,所述预设条件为:所述峰值点的纵轴大于第一预设值,且所述峰值点的横坐标间隔值大于第二预设值;
    根据所述筛选的峰值点的坐标对所述马赛克图像中的马赛克区域进行定位;
    根据所述定位对所述马赛克区域进行剪裁,得到去除马赛克区域的图像。
  2. 根据权利要求1所述的基于频谱分析的马赛克去除方法,其中,所述对马赛克图像进行傅里叶变换前还包括:
    利用sobel算子对所述马赛克图像进行边缘像素点检测,得到所述马赛克图像的边界图像。
  3. 根据权利要求2所述的基于频谱分析的马赛克去除方法,其中,所述对马赛克图像进行傅里叶变换包括:
    按行对所述边界图像中的像素值进行分组,并分别对每组像素值进行傅里叶变换,得到每组像素值对应的频谱图。
  4. 根据权利要求3所述的基于频谱分析的马赛克去除方法,其中,所述根据所述筛选的峰值点的位置对所述马赛克图像中的马赛克区域进行定位包括:
    根据设定的高低频率临界点值计算得到每个频谱图的低频与高频的频率比,得到每个频谱图的高低频率比值图;
    使用峰值检测方法对所述高低频率比值图进行峰值点检测,得到峰值点图;
    从所述峰值点图中筛选出纵轴大于第一预设值的所有峰值点,并记录所述峰值点所在的横坐标;
    所述第一预设值根据所述马赛克区域所在的位置及大小进行设定;
    对所述峰值点横坐标进行排序,并统计所述峰值点横坐标的间隔值,筛选出所述间隔值大于第二预设值的峰值点,记录所述峰值点的纵坐标,得到所述马赛克区域在所述原始马赛克图像中的纵坐标位置信息;
    所述第二预设值根据所述马赛克区域的长度进行设定。
  5. 根据权利要求4所述的基于频谱分析的马赛克去除方法,其中,所述根据所述筛选的峰值点的坐标对所述马赛克图像中的马赛克区域进行定位还包括:
    将所述原始马赛克图像旋转90°,并重新对所述旋转后的马赛克图像进行所述马赛克区域的纵坐标定位,所述旋转后得到的纵坐标定位结果即为所述马赛克区域在所述马赛克图像中的横坐标。
  6. 根据权利要求1至5任一项所述的基于频谱分析的马赛克去除方法,其中,所述马赛克区域的数量为至少一个。
  7. 根据权利要求6所述的基于频谱分析的马赛克去除方法,其中,当所述马赛克区域的数量为两个或两个以上时,所述将所述马赛克图像旋转90°,并重新对所述旋转后的马赛克图像进行所述马赛克区域的纵坐标定位还包括:
    按照所述马赛克区域的部位将所述马赛克图像分割为两个或两个以上的图像,将所述分割后的两个或两个以上的图像分别进行旋转90°以及纵坐标定位操作。
  8. 一种基于频谱分析的马赛克去除系统,其中,包括:
    傅里叶变换模块:用于对马赛克图像进行傅里叶变换,得到所述马赛克图像的频谱图;
    马赛克定位模块:用于对所述频谱图分别进行频谱分析,并使用峰值检测方法对所述频谱分析结果进行峰值点检测,筛选出满足预设条件的峰值点,根据所述筛选的峰值点的坐标对所述马赛克图像中的马赛克区域进行定位;
    其中,所述预设条件为:
    所述峰值点的纵轴大于第一预设值,且所述峰值点的横坐标间隔值大于第二预设值;
    马赛克剪裁模块:用于根据所述定位对所述马赛克区域进行剪裁,得到去除马赛克区域的图像。
  9. 一种终端,其中,所述终端包括处理器、与所述处理器耦接的存储器以及存储在所述存储器上并可在所述处理器上运行的程序指令,所述处理器执行所述程序指令时实现以下步骤:
    对马赛克图像进行傅里叶变换,得到所述马赛克图像的频谱图;
    对所述频谱图分别进行频谱分析,并使用峰值检测方法对所述频谱分析结果进行峰值点检测,筛选出满足预设条件的峰值点,其中,所述预设条件为:所述峰值点的纵轴大于第一预设值,且所述峰值点的横坐标间隔值大于第二预设值;
    根据所述筛选的峰值点的坐标对所述马赛克图像中的马赛克区域进行定位;
    根据所述定位对所述马赛克区域进行剪裁,得到去除马赛克区域的图像。
  10. 根据权利要求9所述的终端,其中,所述对马赛克图像进行傅里叶变换前还包括:
    利用sobel算子对所述马赛克图像进行边缘像素点检测,得到所述马赛克图像的边界图像。
  11. 根据权利要求10所述的终端,其中,所述对马赛克图像进行傅里叶变换包括:
    按行对所述边界图像中的像素值进行分组,并分别对每组像素值进行傅里叶变换,得到每组像素值对应的频谱图。
  12. 根据权利要求11所述的终端,其中,所述根据所述筛选的峰值点的位置对所述马赛克图像中的马赛克区域进行定位包括:
    根据设定的高低频率临界点值计算得到每个频谱图的低频与高频的频率比,得到每个频谱图的高低频率比值图;
    使用峰值检测方法对所述高低频率比值图进行峰值点检测,得到峰值点图;
    从所述峰值点图中筛选出纵轴大于第一预设值的所有峰值点,并记录所述峰值点所在的横坐标;
    所述第一预设值根据所述马赛克区域所在的位置及大小进行设定;
    对所述峰值点横坐标进行排序,并统计所述峰值点横坐标的间隔值,筛选出所述间隔值大于第二预设值的峰值点,记录所述峰值点的纵坐标,得到所述马赛克区域在所述原始马赛克图像中的纵坐标位置信息;
    所述第二预设值根据所述马赛克区域的长度进行设定。
  13. 根据权利要求12所述的终端,其中,所述根据所述筛选的峰值点的坐标对所述马赛克图像中的马赛克区域进行定位还包括:
    将所述原始马赛克图像旋转90°,并重新对所述旋转后的马赛克图像进行所述马赛克区域的纵坐标定位,所述旋转后得到的纵坐标定位结果即为所述马赛克区域在所述马赛克图像中的横坐标。
  14. 根据权利要求9至13任一项所述的终端,其中,所述马赛克区域的数量为至少一个。
  15. 根据权利要求14所述的终端,其中,当所述马赛克区域的数量为两个或两个以上时,所述将所述马赛克图像旋转90°,并重新对所述旋转后的马赛克图像进行所述马赛克区域的纵坐标定位还包括:
    按照所述马赛克区域的部位将所述马赛克图像分割为两个或两个以上的图像,将所述分割后的两个或两个以上的图像分别进行旋转90°以及纵坐标定位操作。
  16. 一种存储介质,其中,存储有处理器可运行的程序文件,所述程序文件被处理器执行时实现以下步骤:
    对马赛克图像进行傅里叶变换,得到所述马赛克图像的频谱图;
    对所述频谱图分别进行频谱分析,并使用峰值检测方法对所述频谱分析结果进行峰值点检测,筛选出满足预设条件的峰值点,其中,所述预设条件为:所述峰值点的纵轴大于第一预设值,且所述峰值点的横坐标间隔值大于第二预设值;
    根据所述筛选的峰值点的坐标对所述马赛克图像中的马赛克区域进行定位;
    根据所述定位对所述马赛克区域进行剪裁,得到去除马赛克区域的图像。
  17. 根据权利要求16所述的存储介质,其中,所述对马赛克图像进行傅里叶变换前还包括:
    利用sobel算子对所述马赛克图像进行边缘像素点检测,得到所述马赛克图像的边界图像。
  18. 根据权利要求17所述的存储介质,其中,所述对马赛克图像进行傅里叶变换包括:
    按行对所述边界图像中的像素值进行分组,并分别对每组像素值进行傅里叶变换,得到每组像素值对应的频谱图。
  19. 根据权利要求18所述的存储介质,其中,所述根据所述筛选的峰值点的位置对所述马赛克图像中的马赛克区域进行定位包括:
    根据设定的高低频率临界点值计算得到每个频谱图的低频与高频的频率比,得到每个频谱图的高低频率比值图;
    使用峰值检测方法对所述高低频率比值图进行峰值点检测,得到峰值点图;
    从所述峰值点图中筛选出纵轴大于第一预设值的所有峰值点,并记录所述峰值点所在的横坐标;
    所述第一预设值根据所述马赛克区域所在的位置及大小进行设定;
    对所述峰值点横坐标进行排序,并统计所述峰值点横坐标的间隔值,筛选出所述间隔值大于第二预设值的峰值点,记录所述峰值点的纵坐标,得到所述马赛克区域在所述原始马赛克图像中的纵坐标位置信息;
    所述第二预设值根据所述马赛克区域的长度进行设定。
  20. 根据权利要求19所述的存储介质,其中,所述根据所述筛选的峰值点的坐标对所述马赛克图像中的马赛克区域进行定位还包括:
    将所述原始马赛克图像旋转90°,并重新对所述旋转后的马赛克图像进行所述马赛克区域的纵坐标定位,所述旋转后得到的纵坐标定位结果即为所述马赛克区域在所述马赛克图像中的横坐标。
  21. 根据权利要求16至20任一项所述的存储介质,其中,所述马赛克区域的数量为至少一个。
  22. 根据权利要求21所述的存储介质,其中,当所述马赛克区域的数量为两个或两个以上时,所述将所述马赛克图像旋转90°,并重新对所述旋转后的马赛克图像进行所述马赛克区域的纵坐标定位还包括:
    按照所述马赛克区域的部位将所述马赛克图像分割为两个或两个以上的图像, 将所述分割后的两个或两个以上的图像分别进行旋转90°以及纵坐标定位操作。
PCT/CN2020/124814 2020-09-04 2020-10-29 基于频谱分析的马赛克去除方法、系统、终端及存储介质 WO2021143272A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010921922.1A CN112070671B (zh) 2020-09-04 2020-09-04 一种基于频谱分析的马赛克去除方法、系统、终端及存储介质
CN202010921922.1 2020-09-04

Publications (1)

Publication Number Publication Date
WO2021143272A1 true WO2021143272A1 (zh) 2021-07-22

Family

ID=73665064

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/124814 WO2021143272A1 (zh) 2020-09-04 2020-10-29 基于频谱分析的马赛克去除方法、系统、终端及存储介质

Country Status (2)

Country Link
CN (1) CN112070671B (zh)
WO (1) WO2021143272A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116453173B (zh) * 2022-12-16 2023-09-08 南京奥看信息科技有限公司 一种基于图片区域分割技术的图片处理方法

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08286163A (ja) * 1995-04-14 1996-11-01 Sharp Corp 画像処理装置及び撮像装置
EP0772157A2 (en) * 1995-10-30 1997-05-07 Sony Corporation A projection based method for scratch and wire removal from digital images
CN1620144A (zh) * 2003-11-21 2005-05-25 松下电器产业株式会社 图像信号处理方法、处理装置、处理程序及集成电路装置
CN104517269A (zh) * 2014-12-25 2015-04-15 深圳市一体太赫兹科技有限公司 一种太赫兹图像条纹处理方法及系统
CN109410123A (zh) * 2018-10-15 2019-03-01 深圳市能信安科技股份有限公司 基于深度学习的去除马赛克的方法、装置及电子设备
CN110415175A (zh) * 2019-08-07 2019-11-05 杭州微帧信息科技有限公司 一种快速去除平坦区域编码马赛克的方法
CN110517206A (zh) * 2019-09-05 2019-11-29 昆山锐芯微电子有限公司 彩色摩尔纹消除方法及装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2774567B2 (ja) * 1989-05-10 1998-07-09 キヤノン株式会社 画像処理装置
CN106372584B (zh) * 2016-08-26 2019-06-11 浙江银江研究院有限公司 一种视频图像马赛克检测方法

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08286163A (ja) * 1995-04-14 1996-11-01 Sharp Corp 画像処理装置及び撮像装置
EP0772157A2 (en) * 1995-10-30 1997-05-07 Sony Corporation A projection based method for scratch and wire removal from digital images
CN1620144A (zh) * 2003-11-21 2005-05-25 松下电器产业株式会社 图像信号处理方法、处理装置、处理程序及集成电路装置
CN104517269A (zh) * 2014-12-25 2015-04-15 深圳市一体太赫兹科技有限公司 一种太赫兹图像条纹处理方法及系统
CN109410123A (zh) * 2018-10-15 2019-03-01 深圳市能信安科技股份有限公司 基于深度学习的去除马赛克的方法、装置及电子设备
CN110415175A (zh) * 2019-08-07 2019-11-05 杭州微帧信息科技有限公司 一种快速去除平坦区域编码马赛克的方法
CN110517206A (zh) * 2019-09-05 2019-11-29 昆山锐芯微电子有限公司 彩色摩尔纹消除方法及装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
DUBOIS, ERIC: "Frequency-Domain Methods for Demosaicking of Bayer-Sampled Color Images", IEEE SIGNAL PROCESSING LETTERS, vol. 12, no. 12, 31 December 2005 (2005-12-31), XP002518020, DOI: 10.1109/LSP.2005.859503 *

Also Published As

Publication number Publication date
CN112070671A (zh) 2020-12-11
CN112070671B (zh) 2024-07-19

Similar Documents

Publication Publication Date Title
WO2020207191A1 (zh) 虚拟物体被遮挡的区域确定方法、装置及终端设备
US20210201445A1 (en) Image cropping method
WO2020147257A1 (zh) 一种人脸识别方法和装置
US9208608B2 (en) Systems and methods for feature tracking
CN109840491B (zh) 视频流播放方法、系统、计算机装置及可读存储介质
CN110765799B (zh) 客户端扫码识别方法、装置、设备及存储介质
WO2017054442A1 (zh) 一种图像信息识别处理方法及装置、计算机存储介质
CN111667504B (zh) 一种人脸追踪方法、装置及设备
WO2021008205A1 (zh) 图像处理
WO2021143272A1 (zh) 基于频谱分析的马赛克去除方法、系统、终端及存储介质
WO2024040767A1 (zh) 一种图像数据增强方法及装置
CA3025312A1 (en) Shape detection
CN110248165B (zh) 标签显示方法、装置、设备及存储介质
WO2019184719A1 (zh) 一种拍照的方法和装置
JP2003141130A (ja) 画像検索装置
WO2019223066A1 (zh) 虹膜图像全局增强方法、装置、设备及存储介质
US8380006B2 (en) System and method for merging separated pixel blocks into an integral image of an object
US10740922B2 (en) Image data processing method, electronic device and storage medium
US11893675B1 (en) Processing updated sensor data for remote collaboration
US11954875B2 (en) Method for determining height of plant, electronic device, and storage medium
Gilani et al. Impact of image appeal on visual attention during photo triaging
WO2022178238A1 (en) Live updates in a networked remote collaboration session
JP2016045538A (ja) 情報処理装置、画像判定方法、及びプログラム
CN113628133A (zh) 一种基于视频图像的去雨雾方法及装置
CN112733565A (zh) 二维码粗定位方法、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20913781

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20913781

Country of ref document: EP

Kind code of ref document: A1