+

CN113129389B - Method for judging moire, method for inhibiting moire and circuit system - Google Patents

Method for judging moire, method for inhibiting moire and circuit system Download PDF

Info

Publication number
CN113129389B
CN113129389B CN201911389012.7A CN201911389012A CN113129389B CN 113129389 B CN113129389 B CN 113129389B CN 201911389012 A CN201911389012 A CN 201911389012A CN 113129389 B CN113129389 B CN 113129389B
Authority
CN
China
Prior art keywords
moire
pixels
pixel
moiré
image
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201911389012.7A
Other languages
Chinese (zh)
Other versions
CN113129389A (en
Inventor
萧晶如
黄文聪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Realtek Semiconductor Corp
Original Assignee
Realtek Semiconductor Corp
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 Realtek Semiconductor Corp filed Critical Realtek Semiconductor Corp
Priority to CN201911389012.7A priority Critical patent/CN113129389B/en
Publication of CN113129389A publication Critical patent/CN113129389A/en
Application granted granted Critical
Publication of CN113129389B publication Critical patent/CN113129389B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Color Television Image Signal Generators (AREA)

Abstract

In the method, brightness values of a plurality of pixels in an image are obtained, a plurality of key pixels for judging the moire type can be selected from a detection window, a moire response value of the plurality of key pixels and a plurality of adjacent pixels corresponding to the key pixels respectively is calculated for each pixel through the detection window, brightness values of the key pixels and the adjacent pixels are compared through the detection window, the comparison result is counted to judge brightness characteristics of each pixel, and then the moire position and the moire type in the image can be confirmed according to the moire response value and the counted result. Then, color noise reduction is performed on the plurality of pixels determined to be moire.

Description

判断摩尔纹的方法、抑制摩尔纹的方法与电路系统Method for determining moiré, method for suppressing moiré and circuit system

技术领域Technical Field

本发明涉及判断摩尔纹的技术,特别涉及一种侦测出不同方向的摩尔纹、统计摩尔纹特征比较值而判断摩尔纹的方法、以及抑制所判断的摩尔纹的方法与实现所述方法的电路系统。The present invention relates to a technology for determining moiré patterns, and more particularly to a method for detecting moiré patterns in different directions, determining moiré patterns by comparing moiré feature statistics, and a method for suppressing the determined moiré patterns and a circuit system for implementing the method.

背景技术Background technique

在数字图像中常见的成像缺陷中,摩尔纹(Moiré Pattern)就是一种,摩尔纹形成的一般原因是因为图像传感器中的感光组件(如CCD或CMOS)在取得图像数据时,如利用数码相机拍摄照片、数码摄影机拍摄影片或是利用扫描仪取得图像时,处理的图像受到高频干扰,而在图像上出现了彩色和形状不规律的条纹,称为摩尔纹。Moiré Pattern is one of the common imaging defects in digital images. The general reason for the formation of moiré patterns is that when the photosensitive components in the image sensor (such as CCD or CMOS) obtain image data, such as taking photos with a digital camera, shooting videos with a digital video camera, or obtaining images with a scanner, the processed image is subject to high-frequency interference, and irregularly colored and shaped stripes appear on the image, which are called moiré patterns.

另外,当拍摄具有密集纹路的物体(如纺织物、重复性高的线条、显示屏幕等),若感光组件的像素取样频率与物体上纹路的空间频率接近,会在图像上产生低频的纹理,同时又由于使用拜耳滤色镜(Bayer Filter),在红绿蓝色可见光的取样率不同,摩尔纹上常伴随着色彩噪声,不符合人眼实际看到的结果。In addition, when shooting objects with dense patterns (such as textiles, highly repetitive lines, display screens, etc.), if the pixel sampling frequency of the photosensitive component is close to the spatial frequency of the patterns on the object, low-frequency texture will be generated on the image. At the same time, due to the use of Bayer filters, the sampling rates of red, green and blue visible light are different, and the moiré patterns are often accompanied by color noise, which is inconsistent with the actual results seen by the human eye.

为了解决摩尔纹现象,在制造相机时,或在镜头上加入一片光学低通滤波器(Low-Pass Filter),虽然有助于减少摩尔纹的现象,但会损失部分图像细节。另有解决方案是在图像信号处理器(Image Signal Processor,ISP)中进行后处理,可将像素亮度变化较低而色彩变化较高的地方判断为发生摩尔纹的位置,可根据邻近像素做色彩补偿,但因此可能会有饱和度(saturation)降低的问题。In order to solve the moiré phenomenon, an optical low-pass filter is added to the lens when manufacturing the camera. Although it helps to reduce the moiré phenomenon, it will lose some image details. Another solution is to perform post-processing in the image signal processor (ISP). The location where the pixel brightness change is low and the color change is high can be judged as the location where the moiré occurs. Color compensation can be made based on the adjacent pixels, but this may cause the problem of reduced saturation.

如此,现有技术所揭露的方法未必能准确侦测出摩尔纹,若有误判,则会降低图像的色彩质量,且色彩补偿的机制也可能受限于硬件限制而无法完全消除摩尔纹。Thus, the methods disclosed in the prior art may not be able to accurately detect moiré patterns. If there is a misjudgment, the color quality of the image will be reduced, and the color compensation mechanism may also be limited by hardware limitations and cannot completely eliminate the moiré patterns.

发明内容Summary of the invention

说发明公开了一种判断摩尔纹的方法、抑制摩尔纹的方法与实现此方法的电路系统,其中目的之一是利用图像处理技术处理数字图像中的摩尔纹(Moiré Pattern),包括侦测摩尔纹的位置,其目的之一是要能减少发生摩尔纹的位置的色彩噪声,使成像结果更符合人眼视觉感受。The invention discloses a method for determining moiré patterns, a method for suppressing moiré patterns and a circuit system for implementing the method. One of the purposes is to use image processing technology to process moiré patterns in digital images, including detecting the position of moiré patterns. One of the purposes is to reduce the color noise at the position where the moiré patterns occur, so that the imaging result is more in line with the visual perception of the human eye.

根据判断摩尔纹的方法的实施例,先取得图像中多个像素的亮度信息,例如在一YUV(亮度-色度-浓度)色彩空间中的亮度值,或一RGB(红-绿-蓝)色彩空间中三色通道值的平均值,接着,设有一检测窗口,在此检测窗口中选取用以判断摩尔纹类型的多个关键像素,再逐一对各像素计算在检测窗口中多个关键像素与分别对应的多个邻近像素的一摩尔纹响应值,这可用以判断图像是否具备摩尔纹特征。According to an embodiment of the method for determining moiré, brightness information of multiple pixels in an image is first obtained, such as a brightness value in a YUV (brightness-chroma-intensity) color space, or an average value of three color channel values in an RGB (red-green-blue) color space. Next, a detection window is set, and multiple key pixels for determining the type of moiré are selected in this detection window. A moiré response value of the multiple key pixels in the detection window and the corresponding multiple adjacent pixels is then calculated for each pixel one by one. This can be used to determine whether the image has moiré features.

之后,再针对各像素,利用检测窗口比对其中多个关键像素与分别对应的多个邻近像素的亮度值,对比对结果进行统计,用以判断各像素的亮度特性,因此,可以根据摩尔纹响应值与统计的结果确认图像中的摩尔纹位置与类型。Afterwards, for each pixel, the detection window is used to compare the brightness values of multiple key pixels and the corresponding multiple adjacent pixels, and the comparison results are statistically analyzed to determine the brightness characteristics of each pixel. Therefore, the position and type of moiré in the image can be confirmed based on the moiré response value and the statistical results.

优选地,其中,在计算摩尔纹响应值的步骤中,在检测窗口中设有一权重掩码,可以根据所要判断的摩尔纹类型设计此权重掩码,包括赋予多个关键像素较高的权重值,对多个邻近像素赋予较低的权重值,再由多个关键像素与对应的多个邻近像素分别乘以权重值以计算摩尔纹响应值。Preferably, in the step of calculating the moiré response value, a weight mask is provided in the detection window, and this weight mask can be designed according to the type of moiré to be determined, including assigning higher weight values to multiple key pixels and assigning lower weight values to multiple neighboring pixels, and then multiplying the multiple key pixels and the corresponding multiple neighboring pixels by the weight values to calculate the moiré response value.

进一步地,可对各像素计算得出的摩尔纹响应值比对第一阈值,以得出像素与其邻近像素的亮度变化,再进一步判断图像是否具备摩尔纹特征。并且,可在比对多个关键像素与分别对应的多个邻近像素的亮度信息时,引入第二阈值,以确认各像素的亮度特性。Furthermore, the moiré response value calculated for each pixel can be compared with the first threshold to obtain the brightness change of the pixel and its neighboring pixels, and then further determine whether the image has moiré characteristics. In addition, when comparing the brightness information of multiple key pixels and the corresponding multiple neighboring pixels, a second threshold can be introduced to confirm the brightness characteristics of each pixel.

所述摩尔纹的类型为水平与垂直方向的摩尔纹、主对角线方向的摩尔纹或次对角线方向的摩尔纹。The moiré pattern is a type of moiré pattern in horizontal and vertical directions, moiré pattern in a main diagonal direction, or moiré pattern in a sub-diagonal direction.

进一步地,可以针对判断出为摩尔纹的相关像素进行色彩摩尔纹抑制,包括可将判断为摩尔纹的多个像素映射于亮度-色度-浓度色彩空间的一色度-浓度平面,再对色度-浓度平面中一色彩抑制范围内的像素色彩抑制成灰阶,进一步地,色度-浓度平面更区别一色彩抑制渐进范围,色彩抑制渐进范围内的像素色彩与色度-浓度平面的一坐标中心的距离设定一抑制倍率,在此色彩抑制渐进范围内,可根据抑制倍率执行色彩抑制。Furthermore, color moiré suppression can be performed on relevant pixels judged to be moiré, including mapping multiple pixels judged to be moiré to a chromaticity-density plane in the brightness-chromaticity-density color space, and then suppressing the pixel colors within a color suppression range in the chromaticity-density plane to grayscale. Furthermore, the chromaticity-density plane is further distinguished into a color suppression progressive range, and a suppression factor is set for the distance between the pixel color within the color suppression progressive range and a coordinate center of the chromaticity-density plane. Within this color suppression progressive range, color suppression can be performed according to the suppression factor.

根据电路系统的实施例,可为一数字图像处理器,其中执行了所述的判断摩尔纹方法,以及抑制摩尔纹的方法。According to an embodiment of the circuit system, it may be a digital image processor, in which the method for determining moiré and the method for suppressing moiré are executed.

为能更进一步了解本发明的特征及技术内容,请参考以下有关本发明的详细说明与附图,然而所提供的附图仅用于提供参考与说明,并非用来对本发明加以限制。To further understand the features and technical contents of the present invention, please refer to the following detailed description and drawings of the present invention. However, the drawings provided are only for reference and description and are not intended to limit the present invention.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是示出了实现判断与抑制摩尔纹方法的电路系统实施例的功能方块图;FIG1 is a functional block diagram showing an embodiment of a circuit system for implementing a method for determining and suppressing moiré;

图2是示出了判断与抑制摩尔纹的方法实施例的流程图;FIG2 is a flow chart showing an embodiment of a method for determining and suppressing moiré;

图3是示出了在判断摩尔纹的方法中判断摩尔纹方向的实施例的示意图;FIG3 is a schematic diagram showing an embodiment of determining the direction of moiré in a method for determining moiré;

图4A与图4B是分别示出了水平与垂直摩尔纹的示意图;4A and 4B are schematic diagrams showing horizontal and vertical moiré patterns, respectively;

图5A至图5C是示出了判断水平与垂直方向摩尔纹的方法的示意图;5A to 5C are schematic diagrams showing a method for determining horizontal and vertical moiré patterns;

图6A至图6C是示出了判断主对角线方向摩尔纹的方法的示意图;6A to 6C are schematic diagrams showing a method for determining moiré in the main diagonal direction;

图7A至图7C是示出了判断次对角线方向摩尔纹的方法的示意图;7A to 7C are schematic diagrams showing a method for determining moiré in a sub-diagonal direction;

图8是示出了执行抑制摩尔纹的方法的色彩空间的实施例的示意图;以及FIG8 is a schematic diagram showing an embodiment of a color space in which a method of suppressing moiré is performed; and

图9是示出了抑制摩尔纹的方法的实施例的流程图。FIG. 9 is a flow chart illustrating an embodiment of a method of suppressing moiré.

具体实施方式Detailed ways

以下是通过特定的具体实施例来说明本发明的实施方式,本领域技术人员可由本说明书所公开的内容了解本发明的优点与效果。本发明可通过其他不同的具体实施例加以施行或应用,本说明书中的各项细节也可基于不同观点与应用,在不背离本发明的构思下进行各种修改与变更。另外,本发明的附图仅为简单示意说明,并非依实际尺寸的描绘。以下的实施方式将进一步详细说明本发明的相关技术内容,但所公开的内容并非用以限制本发明的保护范围。The following is an explanation of the embodiments of the present invention through specific embodiments. Those skilled in the art can understand the advantages and effects of the present invention from the contents disclosed in this specification. The present invention can be implemented or applied through other different specific embodiments, and the details in this specification can also be modified and changed in various ways based on different viewpoints and applications without departing from the concept of the present invention. In addition, the drawings of the present invention are only simple schematic illustrations and are not depicted according to actual sizes. The following embodiments will further explain the relevant technical contents of the present invention in detail, but the disclosed contents are not intended to limit the scope of protection of the present invention.

应当可以理解的是,虽然本文中可能会使用到“第一”、“第二”、“第三”等术语来描述各种组件或者信号,但这些组件或者信号不应受这些术语的限制。这些术语主要是用以区分一组件与另一组件,或者一信号与另一信号。另外,本文中所使用的术语“或”,应视实际情况可能包括相关联的列出项目中的任一个或者多个的组合。It should be understood that, although the terms "first", "second", "third", etc. may be used herein to describe various components or signals, these components or signals should not be limited by these terms. These terms are mainly used to distinguish one component from another component, or one signal from another signal. In addition, the term "or" used herein may include any one or more combinations of the associated listed items depending on the actual situation.

根据说明书所公开的判断摩尔纹的方法、抑制摩尔纹的方法与电路系统的实施例,在判断摩尔纹方法实施例中,主要是先依据摩尔纹响应值侦测出不同方向的摩尔纹,也就是利用图像中像素的分布特性得出摩尔纹发生的地方,并接着统计摩尔纹特征比较值,确定类型,最后在抑制摩尔纹的方法中对判断为摩尔纹的像素上进行色彩降噪。According to the embodiments of the method for determining moiré, the method for suppressing moiré and the circuit system disclosed in the specification, in the embodiment of the method for determining moiré, moiré in different directions is mainly detected based on the moiré response value, that is, the distribution characteristics of pixels in the image are used to obtain the location where the moiré occurs, and then the moiré feature comparison value is statistically calculated to determine the type, and finally, in the method for suppressing moiré, color noise reduction is performed on the pixels determined to be moiré.

摩尔纹的类型大致上可以区分为水平与垂直方向的摩尔纹、主对角线与次对角线方向的摩尔纹等。举例来说,电路系统可逐一对图像中的每个像素(或针对取样的像素)通道进行分析,以判断其中像素是否具有水平、垂直或正/次对角线方向的摩尔纹,再进一步执行抑制。在此一提的是,因为摩尔纹的特征是为重复且密集度高的线条,因此可以利用水平、垂直、对角线等亮度特征作为判断摩尔纹的条件。The types of moiré can be roughly divided into horizontal and vertical moiré, main diagonal and sub-diagonal moiré, etc. For example, the circuit system can analyze each pixel (or sampled pixel) channel in the image one by one to determine whether the pixel has horizontal, vertical or positive/sub-diagonal moiré, and then further suppress it. It is mentioned here that because the characteristics of moiré are repeated and dense lines, the brightness characteristics such as horizontal, vertical, and diagonal can be used as the conditions for judging moiré.

首先参考图1,其是示出了实现判断与抑制摩尔纹方法的电路系统实施例的功能方块图,电路系统可为一数字图像处理器(digital image processor)或是以一计算机系统实现,电路系统的主要电路包括处理器与内存,其中以处理器运行判断与抑制摩尔纹方法,根据功能可以包括以软件或配合硬件实现的色彩空间转换单元102、摩尔纹响应值计算单元103、摩尔纹特征统计单元104、摩尔纹判断单元105以及摩尔纹抑制单元106,以下将描述电路系统运行判断摩尔纹的方法以及抑制摩尔纹的方法的流程,可参考图2示出的方法实施例流程,以及各单元功能。First, refer to Figure 1, which is a functional block diagram of an embodiment of a circuit system for implementing a method for determining and suppressing moiré. The circuit system may be a digital image processor or implemented by a computer system. The main circuits of the circuit system include a processor and a memory, wherein the processor executes the method for determining and suppressing moiré. According to the function, the method may include a color space conversion unit 102, a moiré response value calculation unit 103, a moiré feature statistics unit 104, a moiré determination unit 105, and a moiré suppression unit 106 implemented by software or hardware. The following will describe the process of the circuit system executing the method for determining moiré and the method for suppressing moiré. Please refer to the method embodiment process shown in Figure 2, as well as the function of each unit.

经图1示出的电路系统接收原始图像101后(步骤S201,图2),可以为一原始图像文件(RAW)或是某色彩空间(color space)的像素值,以一色彩空间转换单元102将图像转换为可以执行判断与抑制色彩摩尔纹的一特定色彩空间(步骤S203),如YUV(亮度-色度-浓度)色彩空间、RGB(红-绿-蓝)色彩空间等,特别是可以取得像素亮度信息的任一色彩空间。其中YUV色彩空间中各像素的Y值表示亮度值,RGB色彩空间可以为各像素经色彩还原后的三色通道值的平均值作为判断亮度的依据。After the circuit system shown in FIG. 1 receives the original image 101 (step S201, FIG. 2), which may be a raw image file (RAW) or a pixel value of a color space, a color space conversion unit 102 converts the image into a specific color space that can perform determination and suppression of color moiré (step S203), such as a YUV (brightness-chroma-density) color space, an RGB (red-green-blue) color space, etc., in particular, any color space that can obtain pixel brightness information. The Y value of each pixel in the YUV color space represents the brightness value, and the RGB color space can be the average value of the three color channel values of each pixel after color restoration as the basis for determining the brightness.

接着电路系统可根据硬件运算能力决定一个检测窗口,逐像素地判断各像素是否为发生摩尔纹的位置,其中方法是可先于检测窗口中选取用以判断摩尔纹类型的多个关键像素,通过检测窗口逐一对各像素演算,得出图像中每个区域(对应检测窗口大小)中关键像素与其邻近像素的分布特性得出摩尔纹的位置。实施例可以电路系统中的摩尔纹响应值计算单元103,应用检测窗口中设定的各像素权重值,利用像素的亮度值,逐一计算水平、垂直或对角线方向的摩尔纹响应值(步骤S205),各方向摩尔纹响应值可以判断出各像素是否属于符合摩尔纹特征的边缘像素(edge pixel)。之后,再以电路系统中的摩尔纹特征统计单元104取得各检测窗口中几个用以判断摩尔纹方向的关键像素与邻近像素的摩尔纹特征关系,这可以是比较像素的亮度值,针对相邻像素的摩尔纹特征比较值进行统计(步骤S207)。Then the circuit system can determine a detection window according to the hardware computing capability, and determine pixel by pixel whether each pixel is the location where moiré occurs. The method is to select multiple key pixels for determining the type of moiré in the detection window first, and calculate each pixel one by one through the detection window to obtain the distribution characteristics of the key pixels and their neighboring pixels in each area (corresponding to the detection window size) in the image to obtain the location of the moiré. In the embodiment, the moiré response value calculation unit 103 in the circuit system can apply the weight values of each pixel set in the detection window, and use the brightness value of the pixel to calculate the moiré response value in the horizontal, vertical or diagonal direction one by one (step S205). The moiré response value in each direction can determine whether each pixel belongs to an edge pixel (edge pixel) that meets the moiré feature. Afterwards, the moiré feature statistics unit 104 in the circuit system obtains the moiré feature relationship between several key pixels for determining the direction of moiré and neighboring pixels in each detection window, which can be the brightness value of the comparison pixel, and the moiré feature comparison value of the adjacent pixels is counted (step S207).

接着,通过电路系统的摩尔纹判断单元105,根据系统设定的阈值可以检验上述步骤得出的摩尔纹响应值与摩尔纹特征比较值,以确定当下像素是否属于摩尔纹的一部分(步骤S209),再以摩尔纹抑制单元106对断定为摩尔纹一部分的像素进行色彩抑制,其中可抑制摩尔纹范围中的像素色彩为灰阶,或是依照程度不同而设定不同的抑制倍率,再抑制像素的色彩为灰阶(步骤S211),最后输出结果,也就是输出经过摩尔纹抑制的输出图像107(步骤S213)。Next, the moiré judgment unit 105 of the circuit system can check the moiré response value and the moiré feature comparison value obtained in the above steps according to the threshold value set by the system to determine whether the current pixel is part of the moiré (step S209), and then the moiré suppression unit 106 performs color suppression on the pixel determined to be part of the moiré, wherein the color of the pixel in the moiré range can be suppressed to grayscale, or different suppression ratios can be set according to different degrees, and then the color of the pixel is suppressed to grayscale (step S211), and finally the result is output, that is, the output image 107 after moiré suppression is output (step S213).

可参考图3所示出的判断摩尔纹的方法中判断摩尔纹方向的实施例示意图。Reference may be made to FIG. 3 for a schematic diagram of an embodiment of determining the direction of moiré in a method for determining moiré.

图3示出图像中一个5x5像素数组的区域,实际实施可依照硬件资源选取适当的像素数组,此实施例以YUV色彩空间中像素的Y值(亮度值)为计算依据。5x5的像素数组中当下执行判断的像素为Y(i,j),以此为区域原点以标注邻近的像素,例如,当下像素Y(i,j)的水平像素包括:Y(i,j-2)、Y(i,j-1)、Y(i,j)、Y(i,j+1)以及Y(i,j+2);垂直像素包括:Y(i-2,j)、Y(i-1,j)、Y(i,j)、Y(i+1,j)以及Y(i+2,j);主对角线(左上右下)像素包括:Y(i-2,j-2)、Y(i-1,j-1)、Y(i,j)、Y(i+1,j+1)以及Y(i+2,j+2)。FIG3 shows a region of a 5x5 pixel array in an image. In actual implementation, an appropriate pixel array may be selected according to hardware resources. In this embodiment, the Y value (brightness value) of the pixel in the YUV color space is used as the calculation basis. The pixel currently performing the judgment in the 5x5 pixel array is Y(i,j), which is used as the origin of the region to mark the adjacent pixels. For example, the horizontal pixels of the current pixel Y(i,j) include: Y(i,j-2), Y(i,j-1), Y(i,j), Y(i,j+1) and Y(i,j+2); the vertical pixels include: Y(i-2,j), Y(i-1,j), Y(i,j), Y(i+1,j) and Y(i+2,j); the main diagonal (upper left and lower right) pixels include: Y(i-2,j-2), Y(i-1,j-1), Y(i,j), Y(i+1,j+1) and Y(i+2,j+2).

图4A是示出了一个具有垂直摩尔纹的像素数组示意图,在一检测窗口中,中央像素为当下像素40,依照垂直摩尔纹的特性可知,垂直摩尔纹的特征是垂直方向像素的亮度值相较于其他方向是比较接近的(可设有阈值来判断接近的程度),除了垂直方向的像素外,当下像素40与其他邻近像素(左、右、左上、左下、右上、右下)的亮度值差值应该比较大(可设有阈值决定差值大小),因此这个特征可以用来寻找垂直摩尔纹。FIG4A is a schematic diagram showing a pixel array with vertical moiré. In a detection window, the central pixel is the current pixel 40. According to the characteristics of the vertical moiré, the characteristic of the vertical moiré is that the brightness values of the pixels in the vertical direction are closer than those in other directions (a threshold value can be set to determine the degree of proximity). In addition to the pixels in the vertical direction, the brightness value difference between the current pixel 40 and other adjacent pixels (left, right, upper left, lower left, upper right, lower right) should be relatively large (a threshold value can be set to determine the difference size). Therefore, this feature can be used to find vertical moiré.

图4B为具有水平摩尔纹的像素数组示意图,中央像素为当下像素40’,同理,在图4B中,水平摩尔纹的特征则是在水平方向的像素亮度值比较接近,而除了水平方向的像素外,当下像素40’与其他邻近像素(上、下、左上、左下、右上、右下)的亮度值差值比较大,因此,也可利用这个特征寻找水平摩尔纹。FIG4B is a schematic diagram of a pixel array with horizontal moiré, in which the central pixel is the current pixel 40′. Similarly, in FIG4B , the characteristic of the horizontal moiré is that the pixel brightness values in the horizontal direction are relatively close, and except for the pixels in the horizontal direction, the brightness value difference between the current pixel 40′ and other adjacent pixels (upper, lower, upper left, lower left, upper right, lower right) is relatively large. Therefore, this feature can also be used to find horizontal moiré.

实施例一:水平与垂直方向摩尔纹。Embodiment 1: Horizontal and vertical moiré patterns.

综合上述水平与垂直方向摩尔纹的特征,如图5A至5C所示,判断摩尔纹的方法是通过计算当下像素50与邻近斜向(对角线方向)像素(称关键像素)的亮度值(如Y值)差值判断是否具有水平或垂直方向的摩尔纹。图5A以中央像素作为当下像素50,与斜向像素(以箭头表示)之间的亮度值差值作为判断水平或垂直摩尔纹的根据。图5B则是另一表示方式,要求得5x5像素数组中几个关键像素与其斜向像素(如箭头表示)之间亮度值差值,作为判断水平或垂直摩尔纹的依据。图5C示出了一个对检测窗口中的关键像素与其邻近像素设定的权重掩码(mask)示例,根据所要判断的类型设计权重掩码,以及,可于计算摩尔纹响应值时赋予其中关键像素较高权重值,此实施例为4与1,当下像素50可设有最高的权重值4,其余关键像素设为权重值1,来作为演算公式的系数;反之赋予关键像素斜向邻近像素为较低权重值(此实施例为-2),由此强调出图像的空间分布特性。Based on the above-mentioned characteristics of horizontal and vertical moiré, as shown in FIGS. 5A to 5C , the method for determining moiré is to determine whether there is horizontal or vertical moiré by calculating the difference in brightness (such as Y value) between the current pixel 50 and the adjacent oblique (diagonal) pixels (called key pixels). FIG. 5A uses the central pixel as the current pixel 50, and the brightness difference between the central pixel and the oblique pixels (indicated by arrows) as the basis for determining horizontal or vertical moiré. FIG. 5B is another representation method, which requires obtaining the brightness difference between several key pixels in the 5x5 pixel array and their oblique pixels (indicated by arrows) as the basis for determining horizontal or vertical moiré. FIG5C shows an example of a weight mask set for a key pixel and its neighboring pixels in a detection window. The weight mask is designed according to the type to be determined, and a higher weight value can be assigned to the key pixel when calculating the moiré response value. In this embodiment, the weight values are 4 and 1. The lower pixel 50 can be set with the highest weight value 4, and the remaining key pixels are set with a weight value of 1 as coefficients of the calculation formula. Conversely, the diagonal neighboring pixels of the key pixel are assigned a lower weight value (-2 in this embodiment), thereby emphasizing the spatial distribution characteristics of the image.

参考图3标示的像素以及图5A至5C,公式A表示以检测窗口对图像中每个像素计算检测窗口所对应的特定区域的水平或垂直摩尔纹响应值,公式A示出前半段算式「(4*Y(i,j)+Y(i-2,j)+Y(i,j+2)+Y(i+2,j)+Y(i,j-2))」为计算某图像区域中几个关键像素的亮度值和,特别是可以乘以图5C示出的权重值;公式A的后半段算式「(2*Y(i-1,j-1)+2*Y(i-1,j+1)+2*Y(i+1,j+1)+2*Y(i+1,j-1))」为计算关键像素的斜向邻近像素的亮度值和(可乘以图5C示出的权重值)。公式A的前后算式相减并取绝对值则得出这个像素区域内的亮度值梯度(gradient),当整个图像的亮度值梯度都计算出来,这个差值(绝对值)越大,越是凸显出图像中的水平或垂直摩尔纹,反之,则表示没有明显的摩尔纹,这个差值表示为水平垂直方向的摩尔纹响应值(Moire_HVEdge),也就是取得像素的边缘特性,用以判断其中是否具备摩尔纹特征,也是证实当像素的取样频率与纹路的空间频率一致或接近时会产生摩尔纹的现象。Referring to the pixels marked in Figure 3 and Figures 5A to 5C, Formula A represents the calculation of the horizontal or vertical moiré response value of the specific area corresponding to the detection window for each pixel in the image using the detection window. Formula A shows that the first half of the formula "(4*Y(i,j)+Y(i-2,j)+Y(i,j+2)+Y(i+2,j)+Y(i,j-2))" is used to calculate the sum of the brightness values of several key pixels in a certain image area, and in particular, it can be multiplied by the weight value shown in Figure 5C; the second half of Formula A "(2*Y(i-1,j-1)+2*Y(i-1,j+1)+2*Y(i+1,j+1)+2*Y(i+1,j-1))" is used to calculate the sum of the brightness values of the obliquely adjacent pixels of the key pixel (which can be multiplied by the weight value shown in Figure 5C). Subtracting the previous and next formulas of formula A and taking the absolute value will give the brightness gradient in this pixel area. When the brightness gradient of the entire image is calculated, the larger the difference (absolute value), the more prominent the horizontal or vertical moiré in the image. Otherwise, it means there is no obvious moiré. This difference is expressed as the moiré response value in the horizontal and vertical directions (Moire_HVEdge), which is to obtain the edge characteristics of the pixel to determine whether it has moiré characteristics. It also confirms that moiré will occur when the sampling frequency of the pixel is consistent with or close to the spatial frequency of the pattern.

Moire_HVEdge=|(4*Y(i,j)+Y(i-2,j)+Y(i,j+2)+Y(i+2,j)+Y(i,j-2))-(2*Y(i-1,j-1)+2*Y(i-1,j+1)+2*Y(i+1,j+1)+2*Y(i+1,j-1))|(公式A)Moire_HVEdge=|(4*Y(i,j)+Y(i-2,j)+Y(i,j+2)+Y(i+2,j)+Y(i,j-2))-(2*Y(i-1,j-1)+2*Y(i-1,j+1)+2*Y(i+1,j+1)+2*Y(i+1,j-1))|(Formula A)

接着,利用检测窗口,逐一对各像素比对所在的像素区域中多个关键像素与分别对应的邻近像素的亮度值大小,并进行统计,用以侦测出边缘而判断为摩尔纹。公式B与公式C表示统计水平或垂直摩尔纹特征比较值。根据图1标示的像素亮度值,若当下像素亮度值Y(i,j)为相对高的亮度值,如公式B所示,其中KHV代表使用者设定的像素值的差,依照实际环境光源而定,作为确认水平与垂直方向上关键像素(Y(i,j)、Y(i-2,j)、Y(i,j+2)、Y(i+2,j)、Y(i,j-2))与其邻近关键像素的亮度值差值大于(亮度值至少大于KHV)可以判断为摩尔纹的阈值。其中,可以仅针对通过摩尔值响应值确认为摩尔纹一部分的像素执行亮度值比对与统计。Next, using the detection window, the brightness values of multiple key pixels and the corresponding adjacent pixels in the pixel area where each pixel is located are compared one by one, and statistics are performed to detect the edge and determine it as a moire. Formula B and Formula C represent the statistical horizontal or vertical moire feature comparison value. According to the pixel brightness value indicated in Figure 1, if the current pixel brightness value Y(i,j) is a relatively high brightness value, as shown in Formula B, where KHV represents the difference in pixel values set by the user, it is determined according to the actual ambient light source as a threshold for confirming that the brightness value difference between the key pixels (Y(i,j), Y(i-2,j), Y(i,j+2), Y(i+2,j), Y(i,j-2)) in the horizontal and vertical directions and their adjacent key pixels is greater than (the brightness value is at least greater than KHV) and can be judged as a moire. Among them, the brightness value comparison and statistics can be performed only for the pixels confirmed as part of the moire through the moire value response value.

公式B:Formula B:

Moire_HVCMP1=(Y(i,j)>Y(i-1,j-1)+KHV)Moire_HVCMP1=(Y(i,j)>Y(i-1,j-1)+KHV)

Moire_HVCMP2=(Y(i,j)>Y(i-1,j+1)+KHV)Moire_HVCMP2=(Y(i,j)>Y(i-1,j+1)+KHV)

Moire_HVCMP3=(Y(i,j)>Y(i+1,j+1)+KHV)Moire_HVCMP3=(Y(i,j)>Y(i+1,j+1)+KHV)

Moire_HVCMP4=(Y(i,j)>Y(i+1,j-1)+KHV)Moire_HVCMP4=(Y(i,j)>Y(i+1,j-1)+KHV)

Moire_HVCMP5=(Y(i-2,j)>Y(i-1,j-1)+KHV)Moire_HVCMP5=(Y(i-2,j)>Y(i-1,j-1)+KHV)

Moire_HVCMP6=(Y(i-2,j)>Y(i-1,j+1)+KHV)Moire_HVCMP6=(Y(i-2,j)>Y(i-1,j+1)+KHV)

Moire_HVCMP7=(Y(i,j+2)>Y(i-1,j+1)+KHV)Moire_HVCMP7=(Y(i,j+2)>Y(i-1,j+1)+KHV)

Moire_HVCMP8=(Y(i,j+2)>Y(i+1,j+1)+KHV)Moire_HVCMP8=(Y(i,j+2)>Y(i+1,j+1)+KHV)

Moire_HVCMP9=(Y(i+2,j)>Y(i+1,j+1)+KHV)Moire_HVCMP9=(Y(i+2,j)>Y(i+1,j+1)+KHV)

Moire_HVCMP10=(Y(i+2,j)>Y(i+1,j-1)+KHV)Moire_HVCMP10=(Y(i+2,j)>Y(i+1,j-1)+KHV)

Moire_HVCMP11=(Y(i,j-2)>Y(i-1,j-1)+KHV)Moire_HVCMP11=(Y(i,j-2)>Y(i-1,j-1)+KHV)

Moire_HVCMP12=(Y(i,j-2)>Y(i+1,j-1)+KHV)Moire_HVCMP12=(Y(i,j-2)>Y(i+1,j-1)+KHV)

若当下像素亮度值Y(i,j)为相对低的亮度值,如公式C所示,同样KHV作为确认水平与垂直方向上关键像素(Y(i,j)、Y(i-2,j)、Y(i,j+2)、Y(i+2,j)、Y(i,j-2))与其邻近像素的亮度值差值大于(用KHV加大亮度差值阈值)可以判断为摩尔纹的阈值。If the current pixel brightness value Y(i,j) is a relatively low brightness value, as shown in Formula C, KHV is also used as the threshold to confirm that the difference in brightness between the key pixels (Y(i,j), Y(i-2,j), Y(i,j+2), Y(i+2,j), Y(i,j-2)) in the horizontal and vertical directions and their adjacent pixels is greater than (using KHV to increase the brightness difference threshold) to be judged as moiré.

公式C:Formula C:

Moire_HV’CMP1=(Y(i,j)<Y(i-1,j-1)-KHV)Moire_HV’CMP1=(Y(i,j)<Y(i-1,j-1)-KHV)

Moire_HV’CMP2=(Y(i,j)<Y(i-1,j+1)-KHV)Moire_HV’CMP2=(Y(i,j)<Y(i-1,j+1)-KHV)

Moire_HV’CMP3=(Y(i,j)<Y(i+1,j+1)-KHV)Moire_HV’CMP3=(Y(i,j)<Y(i+1,j+1)-KHV)

Moire_HV’CMP4=(Y(i,j)<Y(i+1,j-1)-KHV)Moire_HV’CMP4=(Y(i,j)<Y(i+1,j-1)-KHV)

Moire_HV’CMP5=(Y(i-2,j)<Y(i-1,j-1)-KHV)Moire_HV’CMP5=(Y(i-2,j)<Y(i-1,j-1)-KHV)

Moire_HV’CMP6=(Y(i-2,j)<Y(i-1,j+1)-KHV)Moire_HV’CMP6=(Y(i-2,j)<Y(i-1,j+1)-KHV)

Moire_HV’CMP7=(Y(i,j+2)<Y(i-1,j+1)-KHV)Moire_HV’CMP7=(Y(i,j+2)<Y(i-1,j+1)-KHV)

Moire_HV’CMP8=(Y(i,j+2)<Y(i+1,j+1)-KHV)Moire_HV’CMP8=(Y(i,j+2)<Y(i+1,j+1)-KHV)

Moire_HV’CMP9=(Y(i+2,j)<Y(i+1,j+1)-KHV)Moire_HV’CMP9=(Y(i+2,j)<Y(i+1,j+1)-KHV)

Moire_HV’CMP10=(Y(i+2,j)<Y(i+1,j-1)-KHV)Moire_HV’CMP10=(Y(i+2,j)<Y(i+1,j-1)-KHV)

Moire_HV’CMP11=(Y(i,j-2)<Y(i-1,j-1)-KHV)Moire_HV’CMP11=(Y(i,j-2)<Y(i-1,j-1)-KHV)

Moire_HV’CMP12=(Y(i,j-2)<Y(i+1,j-1)-KHV)Moire_HV’CMP12=(Y(i,j-2)<Y(i+1,j-1)-KHV)

之后,利用公式B与公式C得出的水平与垂直摩尔纹特征的统计结果进行比对,如公式D,比对当下像素亮度值Y(i,j)为相对高与低的统计结果,以判断出当下像素相对邻近像素为相对亮度高或是低。Afterwards, the statistical results of the horizontal and vertical moiré features obtained by formula B and formula C are compared, such as formula D, to compare the statistical results of the current pixel brightness value Y(i,j) being relatively high and low, so as to determine whether the current pixel is relatively high or low in brightness relative to the adjacent pixels.

公式D:Formula D:

实施例二:主对角线方向摩尔纹。Embodiment 2: Moiré in the main diagonal direction.

针对主对角线方向类型,综合上述对角线方向摩尔纹的特征,如图6A至6C所示,图中同样以5x5像素数组为例,如图6A,中央像素为当下像素60,判断摩尔纹的方法通过计算当下像素60与水平与垂直邻近像素的亮度值(如Y值)差值判断是否具有主对角线方向的摩尔纹,如图中箭头所示,当下像素60与水平与垂直像素之间的亮度值差值作为判断主对角线摩尔纹的根据。图6B同样是另一个表示方式,5x5像素数组中几个关键像素与其水平与垂直邻近像素(如箭头表示)之间亮度值差值作为判断主对角线摩尔纹的依据。图6C示出了一个权重掩码(mask)示例,其中示出了在计算时摩尔纹响应值时赋予关键像素较高权重值,此实施例为4与1,当下像素60可设有最高的权重值4,其余关键像素设为权重值1;反之赋予关键像素水平与垂直方向的像素为较低权重值(此实施例为-2),由此可以强调出图像的空间分布特性。For the main diagonal direction type, the above-mentioned moiré features of the diagonal direction are summarized, as shown in Figures 6A to 6C. The figure also takes a 5x5 pixel array as an example. In Figure 6A, the central pixel is the current pixel 60. The method for judging the moiré is to judge whether there is moiré in the main diagonal direction by calculating the difference in brightness value (such as Y value) between the current pixel 60 and the horizontal and vertical adjacent pixels. As shown by the arrows in the figure, the brightness value difference between the current pixel 60 and the horizontal and vertical pixels is used as the basis for judging the main diagonal moiré. Figure 6B is also another representation method. The brightness value difference between several key pixels in the 5x5 pixel array and their horizontal and vertical adjacent pixels (as indicated by arrows) is used as the basis for judging the main diagonal moiré. FIG6C shows an example of a weight mask, which shows that when calculating the moiré response value, higher weight values are assigned to key pixels, which are 4 and 1 in this embodiment. The bottom pixel 60 can be set to the highest weight value 4, and the remaining key pixels are set to a weight value of 1; conversely, the pixels in the horizontal and vertical directions of the key pixels are assigned lower weight values (-2 in this embodiment), thereby emphasizing the spatial distribution characteristics of the image.

参考图3标示的像素以及图6A至6C,公式E为以检测窗口对图像中每个像素计算检测窗口所对应的特定区域的主对角线摩尔纹响应值,同理,公式E示出绝对值内的前半段算式「(4*Y(i,j)+Y(i-1,j+1)+Y(i-2,j+2)+Y(i+1,j-1)+Y(i+2,j-2))」为计算某图像区域中关键几个像素的亮度值和,特别是可以乘以图6C示出的权重值;公式E的后半段算式「(2*Y(i-2,j)+2*Y(i,j+2)+2*Y(i+2,j)+2*Y(i,j-2))」为计算关键像素(如当下像素Y(i,j))水平与垂直方向邻近像素的亮度值和(可乘以图6C示出的权重值)。公式E的前后算式相减并取绝对值则得出这个像素区域内的亮度值梯度,一旦整个图像的亮度值梯度都计算出来,当这个差值(绝对值)越大,越是凸显出图像中的主对角线摩尔纹;反之,则表示没有明显的摩尔纹。这个差值为主对角线方向的摩尔纹响应值(Moire_DIAG_POSEdge),通过取得像素的边缘特性以判断其中是否具备摩尔纹特征。Referring to the pixels marked in Figure 3 and Figures 6A to 6C, Formula E calculates the main diagonal moiré response value of the specific area corresponding to the detection window for each pixel in the image using the detection window. Similarly, Formula E shows that the first half of the formula "(4*Y(i,j)+Y(i-1,j+1)+Y(i-2,j+2)+Y(i+1,j-1)+Y(i+2,j-2))" in the absolute value is used to calculate the sum of the brightness values of several key pixels in a certain image area, especially it can be multiplied by the weight value shown in Figure 6C; the second half of Formula E "(2*Y(i-2,j)+2*Y(i,j+2)+2*Y(i+2,j)+2*Y(i,j-2))" is used to calculate the sum of the brightness values of the key pixels (such as the current pixel Y(i,j)) in the horizontal and vertical directions (which can be multiplied by the weight value shown in Figure 6C). Subtracting the previous and next formulas of formula E and taking the absolute value will give the brightness gradient in this pixel area. Once the brightness gradient of the entire image is calculated, the larger the difference (absolute value), the more prominent the main diagonal moiré in the image; otherwise, it means there is no obvious moiré. This difference is the moiré response value in the main diagonal direction (Moire_DIAG_POSEdge), and the edge characteristics of the pixel are obtained to determine whether it has moiré characteristics.

公式E:Formula E:

Moire_DIAG_POSEdge=Moire_DIAG_POSEdge=

|(4*Y(i,j)+Y(i-1,j+1)+Y(i-2,j+2)+Y(i+1,j-1)+Y(i+2,j-2))-(2*Y(i-2,j)+2*Y(i,j+2)+2*Y(i+2,j)+2*Y(i,j-2))||(4*Y(i,j)+Y(i-1,j+1)+Y(i-2,j+2)+Y(i+1,j-1)+Y(i+2,j-2))-(2*Y(i-2,j)+2*Y(i,j+2)+2*Y(i+2,j)+2*Y(i,j-2))|

同样地,利用检测窗口,逐一对各像素比对所在的像素区域中多个关键像素与分别对应的邻近像素的亮度值大小,并进行统计,目的是侦测出边缘特性而判断为摩尔纹。公式F与公式G表示统计主对角线摩尔纹特征比较值。根据图1标示的像素亮度值,若当下像素亮度值Y(i,j)为相对高的亮度值,如公式F所示,其中KD代表使用者设定的像素值差值,依照实际环境光源而定,作为确认主对角线方向上关键像素(Y(i,j)、Y(i-2,j-1)、Y(i-1,j-2)、Y(i+1,j+2)、Y(i+2,j+1))与其邻近像素的亮度值差值大于(亮度值至少大于KD)可以判断为摩尔纹的阈值。其中,可以仅针对通过摩尔值响应值确认为摩尔纹一部分的像素执行亮度值比对与统计。Similarly, using the detection window, the brightness values of multiple key pixels and the corresponding adjacent pixels in the pixel area where each pixel is located are compared one by one, and statistics are performed, in order to detect edge characteristics and determine whether it is moiré. Formulas F and G represent the statistical main diagonal moiré feature comparison values. According to the pixel brightness values indicated in FIG1, if the current pixel brightness value Y(i,j) is a relatively high brightness value, as shown in Formula F, where KD represents the pixel value difference set by the user, which is determined according to the actual ambient light source as a threshold for confirming that the brightness value difference between the key pixels (Y(i,j), Y(i-2,j-1), Y(i-1,j-2), Y(i+1,j+2), Y(i+2,j+1)) in the main diagonal direction and its adjacent pixels is greater than (the brightness value is at least greater than KD) and can be determined as moiré. Among them, the brightness value comparison and statistics can be performed only for pixels that are confirmed as part of the moiré through the moiré value response value.

公式F:Formula F:

Moire_DIAG_POS CMP1=(Y(i,j)>Y(i-2,j)+KD)Moire_DIAG_POS CMP1=(Y(i,j)>Y(i-2,j)+KD)

Moire_DIAG_POS CMP2=(Y(i,j)>Y(i,j+2)+KD)Moire_DIAG_POS CMP2=(Y(i,j)>Y(i,j+2)+KD)

Moire_DIAG_POS CMP3=(Y(i,j)>Y(i+2,j)+KD)Moire_DIAG_POS CMP3=(Y(i,j)>Y(i+2,j)+KD)

Moire_DIAG_POS CMP4=(Y(i,j)>Y(i,j-2)+KD)Moire_DIAG_POS CMP4=(Y(i,j)>Y(i,j-2)+KD)

Moire_DIAG_POS CMP5=(Y(i-2,j-1)>Y(i-2,j)+KD)Moire_DIAG_POS CMP5=(Y(i-2,j-1)>Y(i-2,j)+KD)

Moire_DIAG_POS CMP6=(Y(i-2,j-1)>Y(i-1,j-1)+KD)Moire_DIAG_POS CMP6=(Y(i-2,j-1)>Y(i-1,j-1)+KD)

Moire_DIAG_POS CMP7=(Y(i-1,j-2)>Y(i-1,j-1)+KD)Moire_DIAG_POS CMP7=(Y(i-1,j-2)>Y(i-1,j-1)+KD)

Moire_DIAG_POS CMP8=(Y(i-1,j-2)>Y(i,j-2)+KD)Moire_DIAG_POS CMP8=(Y(i-1,j-2)>Y(i,j-2)+KD)

Moire_DIAG_POS CMP9=(Y(i+1,j+2)>Y(i,j+2)+KD)Moire_DIAG_POS CMP9=(Y(i+1,j+2)>Y(i,j+2)+KD)

Moire_DIAG_POS CMP10=(Y(i+1,j+2)>Y(i+1,j+1)+KD)Moire_DIAG_POS CMP10=(Y(i+1,j+2)>Y(i+1,j+1)+KD)

Moire_DIAG_POS CMP11=(Y(i+2,j+1)>Y(i+2,j)+KD)Moire_DIAG_POS CMP11=(Y(i+2,j+1)>Y(i+2,j)+KD)

Moire_DIAG_POS CMP12=(Y(i+2,j+1)>Y(i+1,j+1)+KD)Moire_DIAG_POS CMP12=(Y(i+2,j+1)>Y(i+1,j+1)+KD)

若当下像素亮度值Y(i,j)为相对低的亮度值,如公式G所示,同样KD作为确认主对角线方向上关键像素与其邻近像素的亮度值差值大于(用KD加大亮度差值阈值)可以判断为摩尔纹的阈值。If the current pixel brightness value Y(i,j) is a relatively low brightness value, as shown in Formula G, KD is also used as a threshold to confirm that the brightness difference between the key pixel and its neighboring pixels in the main diagonal direction is greater than (using KD to increase the brightness difference threshold) and can be judged as moiré.

公式G:Formula G:

Moire_DIAG_POS’CMP1=(Y(i,j)<Y(i-2,j)-KD)Moire_DIAG_POS’CMP1=(Y(i,j)<Y(i-2,j)-KD)

Moire_DIAG_POS’CMP2=(Y(i,j)<Y(i,j+2)-KD)Moire_DIAG_POS’CMP2=(Y(i,j)<Y(i,j+2)-KD)

Moire_DIAG_POS’CMP3=(Y(i,j)<Y(i+2,j)-KD)Moire_DIAG_POS’CMP3=(Y(i,j)<Y(i+2,j)-KD)

Moire_DIAG_POS’CMP4=(Y(i,j)<Y(i,j-2)-KD)Moire_DIAG_POS’CMP4=(Y(i,j)<Y(i,j-2)-KD)

Moire_DIAG_POS’CMP5=(Y(i-2,j-1)<Y(i-2,j)-KD)Moire_DIAG_POS’CMP5=(Y(i-2,j-1)<Y(i-2,j)-KD)

Moire_DIAG_POS’CMP6=(Y(i-2,j-1)<Y(i-1,j-1)-KD)Moire_DIAG_POS’CMP6=(Y(i-2,j-1)<Y(i-1,j-1)-KD)

Moire_DIAG_POS’CMP7=(Y(i-1,j-2)<Y(i-1,j-1)-KD)Moire_DIAG_POS’CMP7=(Y(i-1,j-2)<Y(i-1,j-1)-KD)

Moire_DIAG_POS’CMP8=(Y(i-1,j-2)<Y(i,j-2)-KD)Moire_DIAG_POS’CMP8=(Y(i-1,j-2)<Y(i,j-2)-KD)

Moire_DIAG_POS’CMP9=(Y(i+1,j+2)<Y(i,j+2)-KD)Moire_DIAG_POS’CMP9=(Y(i+1,j+2)<Y(i,j+2)-KD)

Moire_DIAG_POS’CMP10=(Y(i+1,j+2)<Y(i+1,j+1)-KD)Moire_DIAG_POS’CMP10=(Y(i+1,j+2)<Y(i+1,j+1)-KD)

Moire_DIAG_POS’CMP11=(Y(i+2,j+1)<Y(i+2,j)-KD)Moire_DIAG_POS’CMP11=(Y(i+2,j+1)<Y(i+2,j)-KD)

Moire_DIAG_POS’CMP12=(Y(i+2,j+1)<Y(i+1,j+1)-KD)Moire_DIAG_POS’CMP12=(Y(i+2,j+1)<Y(i+1,j+1)-KD)

之后,利用公式F与公式G得出的主对角线摩尔纹特征的统计结果进行比对,如公式H,比对当下像素亮度值Y(i,j)为相对高与低的统计结果,目的是判断当下像素为相对亮度高或低的像素。Afterwards, the statistical results of the main diagonal moiré features obtained by formula F and formula G are compared, such as formula H, to compare the statistical results of the current pixel brightness value Y(i,j) being relatively high and low, in order to determine whether the current pixel is a pixel with relatively high or low brightness.

公式H:Formula H:

实施例三:次对角线方向摩尔纹。Embodiment 3: Moiré in the sub-diagonal direction.

针对次对角线方向类型,如图7A至7C所示,以5x5像素数组为例,如图7A,中央像素为当下像素70,判断摩尔纹的方法通过计算当下像素70与水平与垂直邻近像素的亮度值(如Y值)差值判断是否具有次对角线方向的摩尔纹,如图中箭头所示。图7B是另一表示方式,5x5像素数组中几个关键像素与其水平与垂直邻近像素(如箭头表示)之间亮度值差值,作为判断次对角线摩尔纹的依据。图7C示出针对判断次对角线摩尔纹提出的权重掩码(mask)示例,其中示出了在计算时摩尔纹响应值时赋予关键像素较高权重值,此实施例为4与1,当下像素70可设有最高的权重值4,其余关键像素设为权重值1;反之赋予关键像素水平与垂直方向的像素为较低权重值(此实施例为-2),由此可以强调出图像的空间分布特性。For the sub-diagonal direction type, as shown in Figures 7A to 7C, taking a 5x5 pixel array as an example, as shown in Figure 7A, the central pixel is the current pixel 70, and the method for judging moiré is to judge whether there is moiré in the sub-diagonal direction by calculating the difference in brightness value (such as Y value) between the current pixel 70 and the horizontal and vertical adjacent pixels, as shown by the arrows in the figure. Figure 7B is another representation method, where the brightness value difference between several key pixels in the 5x5 pixel array and their horizontal and vertical adjacent pixels (as shown by the arrows) is used as the basis for judging sub-diagonal moiré. Figure 7C shows an example of a weight mask proposed for judging sub-diagonal moiré, which shows that when calculating the moiré response value, a higher weight value is given to the key pixel, which is 4 and 1 in this embodiment. The current pixel 70 can be set to the highest weight value 4, and the remaining key pixels are set to a weight value of 1; on the contrary, the pixels in the horizontal and vertical directions of the key pixel are given a lower weight value (-2 in this embodiment), thereby emphasizing the spatial distribution characteristics of the image.

参考图3标示的像素以及图7A至7C,公式I为以检测窗口对图像中每个像素计算检测窗口所对应的特定区域的次对角线摩尔纹响应值,同理,公式I示出绝对值内的前半段算式「(4*Y(i,j)+Y(i-1,j-1)+Y(i-2,j-2)+Y(i+1,j+1)+Y(i+2,j+2))」为计算某图像区域中关键几个像素的亮度值和,特别是可以乘以图7C示出的权重值;公式I的后半段算式「(2*Y(i-2,j)+2*Y(i,j+2)+2*Y(i+2,j)+2*Y(i,j-2))」为计算关键像素(如当下像素Y(i,j))水平与垂直方向邻近像素的亮度值和(可乘以图7C示出的权重值)。公式I的前后算式相减并取绝对值则得出这个像素区域内的亮度值梯度,一旦整个图像的亮度值梯度都计算出来,当这个差值(绝对值)越大,越是凸显出图像中的次对角线摩尔纹;反之,则表示没有明显的摩尔纹。这个差值为次对角线方向的摩尔纹响应值(Moire_DIAG_POSEdge),通过取得像素的边缘特性以判断其中是否具备摩尔纹特征。Referring to the pixels marked in Figure 3 and Figures 7A to 7C, Formula I calculates the sub-diagonal moiré response value of the specific area corresponding to the detection window for each pixel in the image using the detection window. Similarly, Formula I shows that the first half of the absolute value formula "(4*Y(i,j)+Y(i-1,j-1)+Y(i-2,j-2)+Y(i+1,j+1)+Y(i+2,j+2))" is used to calculate the sum of the brightness values of several key pixels in a certain image area, especially it can be multiplied by the weight value shown in Figure 7C; the second half of Formula I "(2*Y(i-2,j)+2*Y(i,j+2)+2*Y(i+2,j)+2*Y(i,j-2))" is used to calculate the sum of the brightness values of the key pixels (such as the current pixel Y(i,j)) in the horizontal and vertical directions (which can be multiplied by the weight value shown in Figure 7C). Subtracting the previous and next formulas of formula I and taking the absolute value will give the brightness gradient in this pixel area. Once the brightness gradient of the entire image is calculated, the larger the difference (absolute value), the more prominent the sub-diagonal moiré in the image; otherwise, it means there is no obvious moiré. This difference is the moiré response value in the sub-diagonal direction (Moire_DIAG_POSEdge), and the edge characteristics of the pixel are obtained to determine whether it has moiré characteristics.

公式I:Formula I:

Moire_DIAG_NEGEdge=Moire_DIAG_NEGEdge=

|(4*Y(i,j)+Y(i-1,j-1)+Y(i-2,j-2)+Y(i+1,j+1)+Y(i+2,j+2))-(2*Y(i-2,j)+2*Y(i,j+2)+2*Y(i+2,j)+2*Y(i,j-2))||(4*Y(i,j)+Y(i-1,j-1)+Y(i-2,j-2)+Y(i+1,j+1)+Y(i+2,j+2))-(2*Y(i-2,j)+2*Y(i,j+2)+2*Y(i+2,j)+2*Y(i,j-2))|

同样地,利用检测窗口,逐一对各像素比对所在的像素区域中多个关键像素与分别对应的邻近像素的亮度值大小,并进行统计,目的是侦测出边缘特性而判断为摩尔纹。公式J与公式K表示统计次对角线摩尔纹特征比较值。根据图1标示的像素亮度值,若当下像素亮度值Y(i,j)为相对高的亮度值,如公式J所示,其中KD代表使用者设定的像素值差值,依照实际环境光源而定,作为确认次对角线方向上关键像素与其邻近像素的亮度值差值大于可以判断为摩尔纹的阈值。其中,可以仅针对通过摩尔值响应值确认为摩尔纹一部分的像素执行亮度值比对与统计。Similarly, using the detection window, the brightness values of multiple key pixels and the corresponding adjacent pixels in the pixel area where each pixel is located are compared one by one, and statistics are performed, in order to detect edge characteristics and determine them as moiré. Formula J and Formula K represent statistical sub-diagonal moiré feature comparison values. According to the pixel brightness values indicated in Figure 1, if the current pixel brightness value Y(i,j) is a relatively high brightness value, as shown in Formula J, KD represents the pixel value difference set by the user, which is determined according to the actual ambient light source, as a threshold for confirming that the brightness value difference between the key pixel and its adjacent pixels in the sub-diagonal direction is greater than the threshold value that can be judged as moiré. Among them, brightness value comparison and statistics can be performed only for pixels that are confirmed as part of the moiré through the moiré value response value.

公式J:Formula J:

Moire_DIAG_NEGCMP1=(Y(i,j)>Y(i-2,j)+KD)Moire_DIAG_NEGCMP1=(Y(i,j)>Y(i-2,j)+KD)

Moire_DIAG_NEGCMP2=(Y(i,j)>Y(i,j+2)+KD)Moire_DIAG_NEGCMP2=(Y(i,j)>Y(i,j+2)+KD)

Moire_DIAG_NEGCMP3=(Y(i,j)>Y(i+2,j)+KD)Moire_DIAG_NEGCMP3=(Y(i,j)>Y(i+2,j)+KD)

Moire_DIAG_NEGCMP4=(Y(i,j)>Y(i,j-2)+KD)Moire_DIAG_NEGCMP4=(Y(i,j)>Y(i,j-2)+KD)

Moire_DIAG_NEGCMP5=(Y(i-2,j+1)>Y(i-2,j)+KD)Moire_DIAG_NEGCMP5=(Y(i-2,j+1)>Y(i-2,j)+KD)

Moire_DIAG_NEGCMP6=(Y(i-2,j+1)>Y(i-1,j+1)+KD)Moire_DIAG_NEGCMP6=(Y(i-2,j+1)>Y(i-1,j+1)+KD)

Moire_DIAG_NEGCMP7=(Y(i-1,j+2)>Y(i-1,j+1)+KD)Moire_DIAG_NEGCMP7=(Y(i-1,j+2)>Y(i-1,j+1)+KD)

Moire_DIAG_NEGCMP8=(Y(i-1,j+2)>Y(i,j+2)+KD)Moire_DIAG_NEGCMP8=(Y(i-1,j+2)>Y(i,j+2)+KD)

Moire_DIAG_NEGCMP9=(Y(i+1,j-2)>Y(i,j-2)+KD)Moire_DIAG_NEGCMP9=(Y(i+1,j-2)>Y(i,j-2)+KD)

Moire_DIAG_NEGCMP10=(Y(i+1,j-2)>Y(i+1,j-1)+KD)Moire_DIAG_NEGCMP10=(Y(i+1,j-2)>Y(i+1,j-1)+KD)

Moire_DIAG_NEGCMP11=(Y(i+2,j-1)>Y(i+1,j-1)+KD)Moire_DIAG_NEGCMP11=(Y(i+2,j-1)>Y(i+1,j-1)+KD)

Moire_DIAG_NEGCMP12=(Y(i+2,j-1)>Y(i+2,j)+KD)Moire_DIAG_NEGCMP12=(Y(i+2,j-1)>Y(i+2,j)+KD)

若当下像素亮度值Y(i,j)为相对低的亮度值,如公式K所示,同样KD作为确认次对角线方向上关键像素与其邻近像素的亮度值差值大于(用KD加大亮度差值阈值)可以判断为摩尔纹的阈值。If the current pixel brightness value Y(i,j) is a relatively low brightness value, as shown in formula K, KD is also used as a threshold to confirm that the brightness difference between the key pixel and its neighboring pixels in the sub-diagonal direction is greater than (using KD to increase the brightness difference threshold) and can be judged as moiré.

公式K:Formula K:

Moire_DIAG_NEG’CMP1=(Y(i,j)<Y(i-2,j)-KD)Moire_DIAG_NEG’CMP1=(Y(i,j)<Y(i-2,j)-KD)

Moire_DIAG_NEG’CMP2=(Y(i,j)<Y(i,j+2)-KD)Moire_DIAG_NEG’CMP2=(Y(i,j)<Y(i,j+2)-KD)

Moire_DIAG_NEG’CMP3=(Y(i,j)<Y(i+2,j)-KD)Moire_DIAG_NEG’CMP3=(Y(i,j)<Y(i+2,j)-KD)

Moire_DIAG_NEG’CMP4=(Y(i,j)<Y(i,j-2)-KD)Moire_DIAG_NEG’CMP4=(Y(i,j)<Y(i,j-2)-KD)

Moire_DIAG_NEG’CMP5=(Y(i-2,j+1)<Y(i-2,j)-KD)Moire_DIAG_NEG’CMP5=(Y(i-2,j+1)<Y(i-2,j)-KD)

Moire_DIAG_NEG’CMP6=(Y(i-2,j+1)<Y(i-1,j+1)-KD)Moire_DIAG_NEG’CMP6=(Y(i-2,j+1)<Y(i-1,j+1)-KD)

Moire_DIAG_NEG’CMP7=(Y(i-1,j+2)<Y(i-1,j+1)-KD)Moire_DIAG_NEG’CMP7=(Y(i-1,j+2)<Y(i-1,j+1)-KD)

Moire_DIAG_NEG’CMP8=(Y(i-1,j+2)<Y(i,j+2)-KD)Moire_DIAG_NEG’CMP8=(Y(i-1,j+2)<Y(i,j+2)-KD)

Moire_DIAG_NEG’CMP9=(Y(i+1,j-2)<Y(i,j-2)-KD)Moire_DIAG_NEG’CMP9=(Y(i+1,j-2)<Y(i,j-2)-KD)

Moire_DIAG_NEG’CMP10=(Y(i+1,j-2)<Y(i+1,j-1)-KD)Moire_DIAG_NEG’CMP10=(Y(i+1,j-2)<Y(i+1,j-1)-KD)

Moire_DIAG_NEG’CMP11=(Y(i+2,j-1)<Y(i+1,j-1)-KD)Moire_DIAG_NEG’CMP11=(Y(i+2,j-1)<Y(i+1,j-1)-KD)

Moire_DIAG_NEG’CMP12=(Y(i+2,j-1)<Y(i+2,j)-KD)Moire_DIAG_NEG’CMP12=(Y(i+2,j-1)<Y(i+2,j)-KD)

之后,利用公式J与公式K得出的次对角线摩尔纹特征的统计结果进行比对,如公式L,比对当下像素亮度值Y(i,j)为相对高与低的统计结果,目的是判断当下像素为相对亮度高或低的像素。Afterwards, the statistical results of the sub-diagonal moiré features obtained by formula J and formula K are compared, such as formula L, to compare the statistical results of the current pixel brightness value Y(i,j) being relatively high and low, in order to determine whether the current pixel is a pixel with relatively high or low brightness.

公式L:Formula L:

根据上述实施方式,在判断摩尔纹的方法中,先计算出水平垂直、正/次对角线摩尔纹响应值,接着对当下像素与其水平垂直、正/次对角线方向的邻近像素的亮度信息进行比对,对比对结果进行统计,可判断出当下像素相较邻近像素的亮度特性。其中,可以根据系统设定的阈值,以摩尔纹响应值与统计结果确定当下像素是否为摩尔纹,包括确定图像中摩尔纹的位置与类型。According to the above embodiment, in the method for determining moiré, the horizontal and vertical, positive/sub-diagonal moiré response values are first calculated, and then the brightness information of the current pixel is compared with the adjacent pixels in the horizontal and vertical, positive/sub-diagonal directions, and the comparison results are statistically analyzed to determine the brightness characteristics of the current pixel compared with the adjacent pixels. Among them, the moiré response value and the statistical results can be used to determine whether the current pixel is a moiré according to the threshold set by the system, including determining the position and type of the moiré in the image.

根据一个实施例,当摩尔纹响应值大于第一阈值,就可以判断当下像素与其邻近像素有明确的亮度变化,因此可以判断为图像的边缘像素,也就是在此像素附近有如摩尔纹的明暗间隔的特征;反之,若摩尔纹响应值不大于第一阈值,就不能断定当下像素具有摩尔纹的特征。当摩尔纹特征比较值大于第二阈值时,判断出当下像素为相对亮或是相对暗的特性,配合摩尔纹响应值大于第一阈值的判断,则可以确定当下像素为摩尔纹的一部分。According to one embodiment, when the moiré response value is greater than the first threshold, it can be determined that the current pixel and its neighboring pixels have a clear brightness change, and thus can be determined to be an edge pixel of the image, that is, there is a moiré-like light and dark interval feature near this pixel; conversely, if the moiré response value is not greater than the first threshold, it cannot be determined that the current pixel has the moiré feature. When the moiré feature comparison value is greater than the second threshold, it is determined that the current pixel is relatively bright or relatively dark, and combined with the determination that the moiré response value is greater than the first threshold, it can be determined that the current pixel is part of the moiré.

当判断出图像中的摩尔纹后,电路系统可在判断为摩尔纹的像素上进行色彩降噪,举例而言,对判断为摩尔纹的像素在YUV色彩空间中进行色彩抑制,如图8所示为YUV色彩空间下在Y=128时的UV(色度-浓度)平面。将判断为摩尔纹的像素映射在此YUV色彩空间下的色度-浓度平面中,越靠近坐标中心80表示色彩饱和度越低,越接近灰阶,而远离坐标中心80表示色彩饱和度越高,并依据不同象限分别代表不同颜色。After the moiré pattern in the image is determined, the circuit system can perform color noise reduction on the pixel determined to be the moiré pattern. For example, the pixel determined to be the moiré pattern is subjected to color suppression in the YUV color space. FIG8 shows the UV (chroma-density) plane in the YUV color space when Y=128. The pixel determined to be the moiré pattern is mapped in the chroma-density plane in the YUV color space. The closer to the coordinate center 80, the lower the color saturation, the closer to the grayscale, and the farther away from the coordinate center 80, the higher the color saturation, and different quadrants represent different colors.

根据摩尔纹像素的色彩U/V值位于色彩空间的坐标位置,可将色度-浓度平面分为两种或三种区域各自进行不同的色彩处理,如图8所示,中央区域表示一个色彩抑制范围801,落于此色彩抑制范围801内的像素色彩都会被抑制成灰阶,之后输出经过抑制色彩摩尔纹的图像。According to the coordinate position of the color U/V value of the moiré pixel in the color space, the chromaticity-concentration plane can be divided into two or three areas, each of which undergoes different color processing. As shown in FIG8 , the central area represents a color suppression range 801, and the pixel colors falling within this color suppression range 801 are suppressed to grayscale, and then an image with suppressed color moiré is output.

根据一个实施例,色彩-浓度平面可以具有三个区域,图中虚线框住的区域到色彩抑制范围801之间表示一个色彩抑制渐进范围803,使介于色彩抑制范围801到虚线框之间的色彩抑制渐进范围803之内的像素色彩根据与坐标中心80的距离调整设定一抑制倍率,以根据此抑制倍率进行色彩抑制,如施以不同的灰阶程度。此抑制倍率可以为线性或非线性变化,而在色彩抑制渐进范围803的虚线外之色彩则不受影响,维持原有的U/V值。According to one embodiment, the color-concentration plane may have three regions. The region between the dotted line frame and the color suppression range 801 in the figure represents a color suppression progressive range 803, so that the pixel colors within the color suppression progressive range 803 between the color suppression range 801 and the dotted line frame are adjusted to set a suppression magnification according to the distance from the coordinate center 80, so as to perform color suppression according to the suppression magnification, such as applying different grayscale levels. The suppression magnification may change linearly or nonlinearly, and the colors outside the dotted line of the color suppression progressive range 803 are not affected and maintain the original U/V value.

根据一个实施例,上述色彩抑制范围801是一个可移动的矩形区域,但仍须确保覆盖坐标中心80位置,并且,在不同场景的应用或依据用户的喜好,可弹性地移动此矩形区域使其覆盖欲抑制之色彩。色彩抑制公式如公式M:According to one embodiment, the color suppression range 801 is a movable rectangular area, but it must still ensure that the coordinate center 80 is covered, and in different application scenarios or according to user preferences, the rectangular area can be flexibly moved to cover the color to be suppressed. The color suppression formula is as shown in Formula M:

Cout=(Cin-128)*(1-supp_rate)+128(公式M)Cout = (Cin - 128) * (1 - supp_rate) + 128 (Formula M)

其中,Cin为输入U或V值,Cout为对应输出的U或V值,supp_rate为介于0至1之间的抑制率。在所述色彩抑制渐进范围803内会以距离坐标中心80的距离来计算抑制率,离中心越远,抑制率会逐渐递减,0至1的抑制率的计算方式可用内插(Interpolation)、滤波(Filter)等方法得出,公式M中的数值128为根据此例中YUV色彩空间下U与V值的范围在0至255之间,转换到坐标平面上需要位移128,实际实施可依照实际需求修正,且抑制率的计算并不限于所列举的方法。Wherein, Cin is the input U or V value, Cout is the corresponding output U or V value, and supp_rate is the suppression rate between 0 and 1. In the color suppression progressive range 803, the suppression rate is calculated based on the distance from the coordinate center 80. The farther from the center, the gradually decreasing suppression rate. The calculation method of the suppression rate from 0 to 1 can be obtained by interpolation, filtering, etc. The value 128 in formula M is based on the range of U and V values in the YUV color space in this example between 0 and 255. The conversion to the coordinate plane requires a displacement of 128. The actual implementation can be modified according to actual needs, and the calculation of the suppression rate is not limited to the listed methods.

根据以上实施例可知,运行于电路系统中的判断摩尔纹方法以及抑制摩尔纹方法的流程,先取得接收的图像中各画素在一色彩空间中的亮度信息,可以选定一个侦测范围,根据像素彼此的亮度关系得出空间分布特性,得到像素的边缘特性,进而判断是否有摩尔纹,以及摩尔纹为水平、垂直或是正/次对角线的类型,再对特定类型的摩尔纹的特征比较值进行统计,可以确定像素是否为摩尔纹的部分,之后针对断定为摩尔纹的像素执行色彩摩尔纹抑制。According to the above embodiments, the process of the method for determining moiré and the method for suppressing moiré running in the circuit system first obtains the brightness information of each pixel in the received image in a color space, and then selects a detection range. The spatial distribution characteristics are obtained according to the brightness relationship between the pixels, and the edge characteristics of the pixels are obtained to determine whether there is moiré and whether the moiré is horizontal, vertical, or positive/sub-diagonal. Then, the feature comparison values of the specific type of moiré are statistically analyzed to determine whether the pixel is part of the moiré, and then color moiré suppression is performed on the pixels determined to be moiré.

在电路系统中,在摩尔纹判断与抑制的流程可以参考图9,在步骤S901中,电路系统接收到图像后,逐一做出对像素处理摩尔纹的判断,根据一个检测窗口得出当下像素与其邻近像素值(特别如亮度值)的关系以得出图像空间分布的特性。根据上述实施例,设定为水平或垂直方向摩尔纹时,选择一个检测窗口内的关键像素,赋予权重值,计算水平与垂直摩尔纹响应值,也就是利用关键像素与其邻近像素之间的亮度差值,经比对第一阈值后,作为判断摩尔纹方向的依据。In the circuit system, the process of judging and suppressing moiré can refer to FIG9. In step S901, after receiving the image, the circuit system judges the moiré of pixel processing one by one, and obtains the relationship between the current pixel and its neighboring pixel values (especially the brightness value) according to a detection window to obtain the characteristics of the image space distribution. According to the above embodiment, when the horizontal or vertical moiré is set, a key pixel in a detection window is selected, a weight value is assigned, and the horizontal and vertical moiré response values are calculated, that is, the brightness difference between the key pixel and its neighboring pixels is used as the basis for judging the direction of the moiré after comparing the first threshold.

在步骤S903中,经逐一处理各像素后,据此判断图像中是否具有水平或垂直方向的摩尔纹,若判断图像具有水平或垂直摩尔纹,则针对判断有摩尔纹位置的像素执行色彩抑制(步骤S907),完成后输出图像(步骤S909);反之,流程继续步骤S905,判断图像中是否具有正或次对角线方向的摩尔纹,同样地,若判断图像中具有对角线方向的摩尔纹,则如步骤S907,针对其中摩尔纹位置执行色彩抑制,完成后输出图像(步骤S909);反之,若图像中也没有得出对角线方向的摩尔纹,表示图像中并没有发觉明确的摩尔纹,则直接输出图像(步骤S909)。如此实现说明书揭露的判断与抑制摩尔纹的方法以及电路系统。In step S903, after processing each pixel one by one, it is determined whether the image has horizontal or vertical moiré. If it is determined that the image has horizontal or vertical moiré, color suppression is performed on the pixels at the positions where the moiré is determined to be present (step S907), and the image is output after completion (step S909); otherwise, the process continues to step S905 to determine whether the image has positive or sub-diagonal moiré. Similarly, if it is determined that the image has diagonal moiré, color suppression is performed on the moiré positions as in step S907, and the image is output after completion (step S909); otherwise, if no diagonal moiré is obtained in the image, it means that no clear moiré is found in the image, and the image is directly output (step S909). In this way, the method and circuit system for determining and suppressing moiré disclosed in the specification are implemented.

以上所公开的内容仅为本发明的优选可行实施例,并非因此局限本发明的申请专利范围,所以凡是运用本发明说明书及附图内容所做的等效技术变化,均被包含于本发明的申请专利范围内。The contents disclosed above are only preferred feasible embodiments of the present invention, and are not intended to limit the scope of the present invention. Therefore, all equivalent technical changes made using the contents of the present invention's specification and drawings are included in the scope of the present invention.

【符号说明】【Symbol Description】

原始图像101Raw Images 101

色彩空间转换单元102Color space conversion unit 102

摩尔纹响应值计算单元103Moire response value calculation unit 103

摩尔纹特征统计单元104Moiré feature statistics unit 104

摩尔纹判断单元105Moire pattern determination unit 105

摩尔纹抑制单元106Moire suppression unit 106

输出图像107Output image 107

当下像素40,40’,50,60,70Current pixels 40,40’,50,60,70

坐标中心80Coordinate center 80

色彩抑制范围801Color suppression range 801

色彩抑制渐进范围803Color suppression progressive range 803

步骤S201~S213判断与抑制摩尔纹方法流程Steps S201 to S213: Flow of the method for judging and suppressing moiré

步骤S901~S909判断与抑制摩尔纹方法流程Steps S901 to S909: Method flow for judging and suppressing moiré

Claims (9)

1. A method of determining moire comprising:
Obtaining brightness information of a plurality of pixels in an image;
a detection window is arranged, and a plurality of key pixels for judging the mole pattern type are selected from the detection window;
for each pixel, calculating a moire response value of the plurality of key pixels and a plurality of adjacent pixels corresponding to the key pixels respectively through the detection window, wherein the moire response value is used for judging whether the image has moire characteristics or not;
Comparing brightness information of the plurality of key pixels and a plurality of corresponding adjacent pixels by using the detection window for each pixel, and counting comparison results to judge brightness characteristics of each pixel; and
Confirming the position and type of the moire in the image according to the moire response value and the statistical result,
In the step of calculating the moire response value, a weight mask is set in the detection window, and the plurality of key pixels and the corresponding plurality of adjacent pixels are multiplied by weight values respectively to calculate the moire response value.
2. The method according to claim 1, wherein the luminance information of the plurality of pixels is a luminance value in a luminance-chrominance-density color space or an average value of three color channel values in a red-green-blue color space.
3. The method of claim 2, wherein a color space conversion is performed on the image to convert to the luminance-chrominance-density color space or the red-green-blue color space when the image is acquired.
4. The method according to claim 1, wherein in the step of calculating the moire response value, the weight mask is designed according to the type of moire to be judged, higher weight values are given to the plurality of key pixels, and lower weight values are given to the plurality of adjacent pixels.
5. The method according to claim 4, wherein the moire response value calculated for each pixel is compared with a first threshold value to obtain a brightness change between the pixel and its neighboring pixels, and further determining whether the image has moire features.
6. The method of claim 1, wherein a second threshold is introduced to verify the brightness characteristics of each pixel when comparing the brightness information of the plurality of key pixels with the brightness information of the plurality of neighboring pixels respectively corresponding to the plurality of key pixels.
7. The method according to any one of claims 1 to 6, wherein the type of moire is a moire in a horizontal and vertical direction, a moire in a main diagonal direction, or a moire in a sub diagonal direction.
8. A method of inhibiting moire comprising:
obtaining an image, converting the image into a brightness-chromaticity-concentration color space, and obtaining brightness values of a plurality of pixels in the image;
A detection window is arranged, and a plurality of key pixels used for judging the mole pattern type are selected from the detection window;
calculating a moire response value of the plurality of key pixels and a plurality of adjacent pixels corresponding to each pixel through the detection window, wherein the moire response value is used for judging whether the image has moire characteristics or not;
In the step of calculating the moire response value, a weight mask is set in the detection window, and the plurality of key pixels and the corresponding plurality of adjacent pixels are multiplied by weight values respectively to calculate the moire response value;
comparing brightness values of the plurality of key pixels and a plurality of corresponding adjacent pixels by using the detection window for each pixel, and counting comparison results to judge brightness characteristics of each pixel;
confirming the positions and types of the moire patterns in the image according to the moire response values and the statistical results;
Color noise reduction is performed on a plurality of pixels judged to be moire, wherein:
mapping a plurality of pixels determined as moire on a chrominance-density plane of the luminance-chrominance-density color space; and
And suppressing the pixel color in a color suppression range in the chromaticity-concentration plane to gray level.
9. A circuit system, comprising:
A processor and a memory, wherein the processor performs a moire determining method comprising:
obtaining an image, converting the image into a brightness-chromaticity-concentration color space, and obtaining brightness values of a plurality of pixels in the image;
A detection window is arranged, and a plurality of key pixels used for judging the mole pattern type are selected from the detection window;
calculating a moire response value of the plurality of key pixels and a plurality of adjacent pixels corresponding to each pixel through the detection window, wherein the moire response value is used for judging whether the image has moire characteristics or not;
In the step of calculating the moire response value, a weight mask is set in the detection window, and the plurality of key pixels and the corresponding plurality of adjacent pixels are multiplied by weight values respectively to calculate the moire response value;
Comparing brightness values of the plurality of key pixels and a plurality of corresponding adjacent pixels by using the detection window for each pixel, and counting comparison results to judge brightness characteristics of each pixel; and
And confirming the positions and types of the moire in the image according to the moire response value and the statistical result so as to perform color noise reduction on the pixels judged to be the moire.
CN201911389012.7A 2019-12-30 2019-12-30 Method for judging moire, method for inhibiting moire and circuit system Active CN113129389B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911389012.7A CN113129389B (en) 2019-12-30 2019-12-30 Method for judging moire, method for inhibiting moire and circuit system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911389012.7A CN113129389B (en) 2019-12-30 2019-12-30 Method for judging moire, method for inhibiting moire and circuit system

Publications (2)

Publication Number Publication Date
CN113129389A CN113129389A (en) 2021-07-16
CN113129389B true CN113129389B (en) 2024-07-05

Family

ID=76767394

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911389012.7A Active CN113129389B (en) 2019-12-30 2019-12-30 Method for judging moire, method for inhibiting moire and circuit system

Country Status (1)

Country Link
CN (1) CN113129389B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI733286B (en) * 2019-12-25 2021-07-11 瑞昱半導體股份有限公司 Method for determining moire pattern, method for suppressing moire pattern and circuit system thereof
CN114862706B (en) * 2022-04-25 2022-10-14 哈尔滨理工大学 Tone mapping method for keeping gradient direction of image

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103645036A (en) * 2013-12-30 2014-03-19 京东方科技集团股份有限公司 Moire pattern evaluation method and device
CN108418997A (en) * 2018-01-31 2018-08-17 深圳市商巨视觉技术有限公司 The method for removing image moire fringes

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6850651B2 (en) * 2001-07-02 2005-02-01 Corel Corporation Moiré correction in images
JP2012215425A (en) * 2011-03-31 2012-11-08 Sony Corp Device, method, and display unit for detecting luminance unevenness
JP6626272B2 (en) * 2015-05-26 2019-12-25 ハンファテクウィン株式会社 Image processing apparatus, image processing method, and imaging apparatus
CN108615227B (en) * 2018-05-08 2021-02-26 浙江大华技术股份有限公司 Image moire inhibition method and device
CN108921823B (en) * 2018-06-08 2020-12-01 Oppo广东移动通信有限公司 Image processing method, apparatus, computer-readable storage medium and electronic device
CN108846818B (en) * 2018-06-25 2021-03-02 Oppo(重庆)智能科技有限公司 Moire pattern removing method, device, terminal and computer readable storage medium
CN109146855B (en) * 2018-08-01 2021-03-26 Oppo广东移动通信有限公司 Image moire detection method, terminal device and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103645036A (en) * 2013-12-30 2014-03-19 京东方科技集团股份有限公司 Moire pattern evaluation method and device
CN108418997A (en) * 2018-01-31 2018-08-17 深圳市商巨视觉技术有限公司 The method for removing image moire fringes

Also Published As

Publication number Publication date
CN113129389A (en) 2021-07-16

Similar Documents

Publication Publication Date Title
JP5454075B2 (en) Image processing apparatus, image processing method, and program
RU2537038C2 (en) Automatic white balance processing with flexible colour space selection
JP5724185B2 (en) Image processing apparatus, image processing method, and program
RU2527198C2 (en) Image processing device and image processing device control method
KR101327789B1 (en) Method and apparatus for reducing various noises of image simultaneously
JP4668185B2 (en) Image processing method
CN110730336A (en) Demosaicing method and device
KR20070121440A (en) Noise reduction method and device
CN104717474B (en) Image processing method and module and electronic equipment comprising same
JP2010045588A (en) Image processor and image processing method
TW201742001A (en) Method and device for image noise estimation and image capture apparatus
KR101812341B1 (en) A method for edge enhancement of image
KR20070078463A (en) Image sensor noise reduction device and method
KR100735561B1 (en) Method and apparatus for reducing noise generated from image sensor
CN113129389B (en) Method for judging moire, method for inhibiting moire and circuit system
JP5076186B2 (en) Image enlargement method
TWI437872B (en) Image processing system
CN115471571A (en) Calibration method, image processing method, device, storage medium and electronic equipment
JP2010268426A (en) Image processing apparatus, image processing method, and program
TWI733286B (en) Method for determining moire pattern, method for suppressing moire pattern and circuit system thereof
TW201431382A (en) Image processing apparatus and image processing method
US8836824B2 (en) Systems and methods for threshold-based luma channel noise reduction
CN101778297B (en) Interference elimination method of image sequence
JP2009200635A (en) Image processor, and processing method and program
JP2005354585A (en) Device, method and program of image processing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载