An image processing method and apparatus
By evaluating and classifying luminance and chrominance components using the difference method, and recovering the chrominance components of the current pixel using surrounding pixels, the problem of color distortion and color cast at the edges of Chinese characters during YUV444 to YUV422 conversion is solved, thus improving the image quality.
Patent Information
- Application Number
- CN202110491467.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-06
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2041-05-06
AI Technical Summary
In video transmission, existing technologies can easily cause color distortion and color shift at the edges of text when reducing image bandwidth, especially during the conversion from YUV444 to YUV422.
By obtaining the luminance and chrominance components of the current pixel position, and using the difference method to evaluate the differences of surrounding pixels, the luminance and chrominance components are classified. The second chrominance component of the current pixel is recovered using the second chrominance component of the surrounding pixels, avoiding direct interpolation.
Without changing the system bandwidth, the video stream image quality was improved, and color distortion and color cast at the edges of text were reduced.
Smart Images

Figure CN113194317B_ABST
Abstract
Description
Technical Field
[0001] This article relates to image processing technology, and more particularly to an image processing method and apparatus. Background Technology
[0002] YUV is a common color encoding method, where Y refers to the luminance component and UV refers to the two chrominance components. Due to its luminance-chrominance separation characteristic, it is widely used in video transmission. Common YUV encoding methods include YUV444, YUV422, and YUV420.
[0003] YUV444 means that every 4 pixels have 4 luma components, 4 U-type chroma components, and 4 V-type chroma components, which means that each pixel has 1 luma component and 1 chroma component.
[0004] YUV422 means that every 4 pixels have 4 luminance components, 2 U-type chrominance components, and 2 V-type chrominance components. In other words, every 2 pixels have 2 luminance components, 1 U-type chrominance component, and 1 V-type chrominance component. Only by combining two pixels can a complete color be recovered.
[0005] YUV420 means that every 4 pixels have 4 luminance components, 1 U-type chrominance component, and 1 V-type chrominance component. In other words, every 4 pixels have 4 luminance components, 1 U-type chrominance component, and 1 V-type chrominance component. It takes the combination of four pixels to recover a complete color.
[0006] like Figure 1 As shown, each pixel of YUV444 has three individual components. Figure 2 As shown, YUV422 has 3 components when every two pixels are joined together, and the two pixels share the chroma component. For example... Figure 3 As shown, YUV420 requires four pixels to be stitched together to have three components, and the four pixels share the chroma component.
[0007] YUV444 offers the best image quality but requires the most bandwidth; YUV422 offers slightly lower image quality but reduces bandwidth by one-third; while YUV420 offers the worst image quality with half the bandwidth. In most video transmission scenarios, due to limitations in external data cable width or transmission bandwidth, YUV422 and YUV420 systems remain very common.
[0008] After RGB video is directly converted to YUV video, it becomes YUV444 format. Then, it is converted from YUV444 to YUV422 and sent out. The receiving end needs to restore the YUV422 image to RGB image.
[0009] Traditional image processing methods involve directly extracting values from the YUV444 image to reduce the data volume, and then interpolating to restore the original image. During the interpolation process, due to multiple shared chromaticity components, color casts and false colors may occur, which is particularly noticeable for images with sharp edges, such as text. Summary of the Invention
[0010] This application provides an image processing method and apparatus that can improve the image quality of video streams and reduce color distortion and other issues at the edges of text caused by interpolation without changing the system bandwidth.
[0011] This application provides an image processing method, which may include:
[0012] Obtain the current pixel component corresponding to the current pixel position; the current pixel component includes: the current pixel luminance component and the current pixel first chrominance component;
[0013] Obtain the surrounding pixel region of the current pixel position, and the surrounding pixel components corresponding to the surrounding pixel region; the surrounding pixel components include: the surrounding pixel luminance component, the surrounding pixel first chrominance component, and the surrounding pixel second chrominance component;
[0014] The luminance component of the current pixel position is classified according to the current pixel luminance component and the luminance components of the surrounding pixels, and the chrominance component of the current pixel position is classified according to the first chrominance component of the current pixel and the first chrominance component of the surrounding pixels.
[0015] Based on the classification results of the luminance component and the chrominance component at the current pixel position, the second chrominance component at the current pixel position is recovered using the second chrominance component of the surrounding pixels.
[0016] In an exemplary embodiment of this application, obtaining the current pixel component corresponding to the current pixel position may include: determining the current pixel luminance component Y of the current pixel position according to the YUV422 color encoding, and the first chromaticity component U or V of the current pixel.
[0017] The step of obtaining the surrounding pixel region of the current pixel position may include:
[0018] The current pixel position is taken as the center pixel position;
[0019] Multiple sub-pixel positions are determined around the central pixel position, and these multiple sub-pixel positions constitute an N*M pixel region, which serves as the surrounding pixel region; N and M are positive integers.
[0020] In an exemplary embodiment of this application, before classifying the luminance and chrominance components at the current pixel location, the method may further include:
[0021] Based on the relative positional relationship between the current pixel position and the surrounding pixel region, the position of each sub-pixel within the surrounding pixel region is encoded.
[0022] In an exemplary embodiment of this application, classifying the luminance component at the current pixel position based on the current pixel luminance component and the luminance components of the surrounding pixel regions may include:
[0023] The difference between the current pixel luminance component and the luminance components of each of the surrounding pixels is evaluated using a preset difference method, and the luminance components at the current pixel position are classified according to the evaluation results.
[0024] In an exemplary embodiment of this application, the step of evaluating the difference between the current pixel luminance component and the luminance components of each of the surrounding pixels using a preset difference method, and classifying the luminance component at the current pixel position based on the evaluation result, may include:
[0025] Calculate the absolute value of the difference between the current pixel luminance component and the luminance components of each of the surrounding pixels;
[0026] Obtain the positions of a sub-pixels corresponding to the a absolute values of the smallest absolute values of all calculated luminance component differences, and record the codes of the a sub-pixel positions as luminance position markers; a is a positive integer;
[0027] The positions of the a sub-pixels are identified as belonging to the same type of brightness component as the current pixel position.
[0028] In an exemplary embodiment of this application, classifying the chromaticity component at the current pixel position based on the first chromaticity component of the current pixel at the current pixel position and the first chromaticity components of the surrounding pixels in the surrounding pixel region may include:
[0029] The difference between the first chromaticity component of the current pixel and the first chromaticity component of each of the surrounding pixels is evaluated using a preset difference method, and the chromaticity components at the current pixel position are classified according to the evaluation results.
[0030] In an exemplary embodiment of this application, the step of evaluating the difference between the first chromaticity component of the current pixel and the first chromaticity component of each of the surrounding pixels using a preset difference method, and classifying the chromaticity component at the current pixel position based on the evaluation result, may include:
[0031] Calculate the absolute value of the chromaticity component difference between the first chromaticity component of the current pixel and the first chromaticity component of each of the surrounding pixels;
[0032] Obtain the positions of b sub-pixels corresponding to the b absolute values of the chromaticity component differences with the smallest values among all the calculated absolute values of the chromaticity component differences, and record the codes of the b sub-pixel positions as chromaticity position markers; b is a positive integer;
[0033] The positions of the b sub-pixels are identified as belonging to the same type of first chromaticity component as the current pixel position.
[0034] In an exemplary embodiment of this application, the step of recovering the second chromaticity component of the current pixel position using the second chromaticity component of the surrounding pixels based on the luminance component classification result and the chromaticity component classification result of the current pixel position may include:
[0035] Obtain the luminance position markers from the luminance component classification results and the chrominance position markers from the chrominance component classification results;
[0036] When multiple sub-pixel positions are determined to belong to both the same type of luminance component and the same type of first chrominance component as the current pixel position based on the luminance position marker and the chrominance position marker, the second chrominance components of the surrounding pixels contained in the multiple sub-pixel positions are obtained as the second chrominance component of the current pixel position; or, the sub-pixel position that is closest to the multiple sub-pixel positions and contains the second chrominance components of the surrounding pixels is determined, and the second chrominance components of the surrounding pixels contained in the determined sub-pixel position are obtained as the second chrominance component of the current pixel position.
[0037] In an exemplary embodiment of this application, the step of recovering the second chromaticity component of the current pixel position using the second chromaticity component of the surrounding pixels based on the luminance component classification result and the chromaticity component classification result of the current pixel position may include:
[0038] Obtain the luminance position markers from the luminance component classification results and the chrominance position markers from the chrominance component classification results;
[0039] When it is determined, based on the luminance position marker and the chrominance position marker, that multiple sub-pixel positions are different from the current pixel position and belong to the same type of luminance component and the same type of first chrominance component, the sub-pixel positions among the multiple sub-pixel positions that belong to the same type of chrominance component as the current pixel position are obtained. The second chrominance component of the surrounding pixels corresponding to the sub-pixel position that has the smallest distance from the current pixel position among the sub-pixel positions that belong to the same type of chrominance component as the current pixel position is taken as the second chrominance component of the current pixel position.
[0040] This application also provides a video image processing apparatus, which may include a processor and a computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when executed by the processor, implement the video image processing method described in any of the above embodiments.
[0041] Compared with related technologies, the embodiments of this application may include: obtaining the current pixel component corresponding to the current pixel position; the current pixel component may include: the current pixel luminance component and the current pixel first chrominance component; obtaining the surrounding pixel region of the current pixel position, and the surrounding pixel component corresponding to the surrounding pixel region; the surrounding pixel component may include: the surrounding pixel luminance component, the surrounding pixel first chrominance component, and the surrounding pixel second chrominance component; classifying the luminance component of the current pixel position according to the current pixel luminance component and the surrounding pixel luminance component, and classifying the chrominance component of the current pixel position according to the current pixel first chrominance component and the surrounding pixel first chrominance component; and recovering the second chrominance component of the current pixel position using the surrounding pixel second chrominance component based on the classification results of the luminance component and the chrominance component of the current pixel position. Through this embodiment, without changing the system bandwidth, the video stream image quality is improved, and the color distortion and color cast at text edges caused by interpolation are reduced.
[0042] Other features and advantages of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the application. Other advantages of this application can be realized and obtained by means of the solutions described in the description and the accompanying drawings. Attached Figure Description
[0043] The accompanying drawings are used to provide an understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0044] Figure 1 This is a schematic diagram of the pixel components of each pixel in YUV444 in related technologies;
[0045] Figure 2 This is a schematic diagram of the pixel components of each pixel in YUV422 in related technologies;
[0046] Figure 3 This is a schematic diagram of the pixel components of each pixel in YUV420 in related technologies;
[0047] Figure 4 This is a flowchart of an image processing method according to an embodiment of this application;
[0048] Figure 5 A schematic diagram of the pixel component arrangement of the YUV422 image of the image to be processed in this embodiment of the application;
[0049] Figure 6 This application embodiment includes a schematic diagram of an image pixel region containing 8 identical components;
[0050] Figure 7 A schematic diagram of the sub-pixel position encoding of the eight-neighborhood in an embodiment of this application;
[0051] Figure 8 This is a block diagram of the image processing apparatus according to an embodiment of this application. Detailed Implementation
[0052] This application describes several embodiments, but these descriptions are exemplary and not restrictive, and it will be apparent to those skilled in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with, or may replace, any feature or element of any other embodiment.
[0053] This application includes and contemplates combinations of features and elements known to those skilled in the art. The embodiments, features, and elements disclosed in this application may also be combined with any conventional features or elements to form a unique inventive scheme as defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other inventive schemes to form another unique inventive scheme as defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in this application may be implemented individually or in any suitable combination. Therefore, the embodiments are not limited except by the limitations imposed by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.
[0054] Furthermore, in describing representative embodiments, the specification may have presented methods and / or processes as a specific sequence of steps. However, the method or process should not be limited to the specific order of steps described herein, to the extent that it does not depend on such a specific order. As will be understood by those skilled in the art, other sequences of steps are also possible. Therefore, the specific order of steps set forth in the specification should not be construed as a limitation of the claims. Moreover, the claims concerning the method and / or process should not be limited to the steps performed in the written order, and those skilled in the art will readily understand that these orders can be varied and still remain within the spirit and scope of the embodiments of this application.
[0055] This application provides an image processing method, such as... Figure 4 As shown, the method may include steps S101-S104:
[0056] S101. Obtain the current pixel component corresponding to the current pixel position in the image to be processed; the current pixel component includes: the current pixel luminance component and the current pixel first chrominance component.
[0057] S102. Obtain the surrounding pixel region of the current pixel position, and the surrounding pixel components corresponding to the surrounding pixel region; the surrounding pixel components include: the surrounding pixel luminance component, the surrounding pixel first chromaticity component, and the surrounding pixel second chromaticity component.
[0058] S103. Classify the luminance component of the current pixel position according to the current pixel luminance component and the luminance component of the surrounding pixels, and classify the chrominance component of the current pixel position according to the first chrominance component of the current pixel and the first chrominance component of the surrounding pixels.
[0059] S104. Based on the classification results of the luminance component and the chrominance component of the current pixel position, the second chrominance component of the current pixel position is recovered using the second chrominance component of the surrounding pixels.
[0060] In an exemplary embodiment of this application, the current pixel luminance component refers to the luminance component corresponding to the current pixel position; the current pixel first chrominance component refers to the first chrominance component corresponding to the current pixel position, such as U; and the current pixel second chrominance component refers to the second chrominance component corresponding to the current pixel position, such as V.
[0061] In an exemplary embodiment of this application, the peripheral pixel luminance component refers to the luminance component corresponding to the sub-pixel position in the peripheral pixel region; the peripheral pixel first chromaticity component refers to the first chromaticity component corresponding to the sub-pixel position in the peripheral pixel region, such as U; and the peripheral pixel second chromaticity component refers to the second chromaticity component corresponding to the sub-pixel position in the peripheral pixel region, such as V.
[0062] In an exemplary embodiment of this application, all pixels in the surrounding pixel region include a luminance component; however, not all pixels in the surrounding pixel region include a first chromaticity component, nor do all pixels include a second chromaticity component. Figure 6 , Figure 7 As shown, some pixels in the surrounding pixel region contain a luminance component Y, some pixels contain a first chromaticity component U, and some pixels contain a second chromaticity component V. In the embodiments of this application, the second chromaticity component of the current pixel is recovered only through the second chromaticity component contained in the pixels containing the second chromaticity component.
[0063] In an exemplary embodiment of this application, obtaining the current pixel component corresponding to the current pixel position may include: determining the current pixel luminance component Y of the current pixel position according to the YUV422 color encoding, and the first chromaticity component U or V of the current pixel.
[0064] In the exemplary embodiments of this application, whether it is YUV422 or YUV420, the component information of each pixel position is fixed. Taking a YUV422 image as an example, the color components of a pixel are Y and U, or Y and V; then the luminance component corresponding to the pixel is Y, and the first chromaticity component can be U or V.
[0065] In exemplary embodiments of this application, as Figure 5 The image shown is a schematic diagram of the pixel component arrangement of the YUV422 image to be processed in an embodiment of this application.
[0066] In an exemplary embodiment of this application, obtaining the surrounding pixel region of the current pixel position may include:
[0067] The current pixel position is taken as the center pixel position;
[0068] Multiple sub-pixel positions are determined around the central pixel position, and these multiple sub-pixel positions constitute an N*M pixel region, which serves as the surrounding pixel region; N and M are positive integers.
[0069] In an exemplary embodiment of this application, the N*M pixel region can be an N*N pixel region. Multiple N*N pixel regions surrounding the current pixel position can be obtained, where each N*N pixel region can contain at least eight luminance components and a first chrominance component. Again, taking YUV422 as an example, a minimum image size region of 3*5 is required to meet this requirement.
[0070] In an exemplary embodiment of this application, a schematic diagram of an image pixel region comprising eight identical components can be shown as follows: Figure 6As shown.
[0071] In an exemplary embodiment of this application, before classifying the luminance and chrominance components at the current pixel location, the method may further include:
[0072] Based on the relative positional relationship between the current pixel position and the surrounding pixel region, the position of each sub-pixel within the surrounding pixel region is encoded.
[0073] In an exemplary embodiment of this application, the sub-pixel position encoding (or position marking) of the eight-neighborhood can be as follows: Figure 7 As shown. Among them, according to Figure 6 The pixel components in the pixel region shown can be identified as follows: Figure 7 The V component does not have 2-bit and 8-bit position encoding.
[0074] In an exemplary embodiment of this application, classifying the luminance component at the current pixel position based on the current pixel luminance component at the current pixel position and the current pixel luminance components of the surrounding pixel region may include:
[0075] The difference between the current pixel luminance component and the luminance components of each of the surrounding pixels is evaluated using a preset difference method, and the luminance components at the current pixel position are classified according to the evaluation results.
[0076] In an exemplary embodiment of this application, the step of evaluating the difference between the current pixel luminance component and the luminance components of each of the surrounding pixels using a preset difference method, and classifying the luminance component at the current pixel position based on the evaluation result, may include:
[0077] Calculate the absolute value of the difference between the current pixel luminance component and the luminance components of each of the surrounding pixels;
[0078] Obtain the positions of a sub-pixels corresponding to the a absolute values of the differences between the a luminance components with the smallest values among all the calculated absolute values of the differences between the luminance components, and record the codes of the a sub-pixel positions as luminance position markers;
[0079] The positions of the a sub-pixels are identified as belonging to the same type of brightness component as the current pixel position.
[0080] In an exemplary embodiment of this application, the classification of the current pixel position can be determined based on the current pixel luminance component at the current pixel position and the surrounding pixel luminance components of the surrounding pixel region.
[0081] In an exemplary embodiment of this application, the difference method can be used to evaluate and classify the differences between pixels at the current pixel position and in the surrounding pixel region.
[0082] In an exemplary embodiment of this application, the Y component of the pixel at the center pixel (i.e., the previous pixel position) (e.g., Y7) is subtracted from the Y components of the eight surrounding pixels (Y1-Y3, Y6, Y8, Yb-Yd) in the surrounding pixel region (i.e., the eight sub-pixel positions of the surrounding pixel region). Multiple (e.g., three) sub-pixel positions with the smallest differences are found and their positions are recorded. The magnitude of this difference indicates the proximity of the pixel to the center pixel. Assuming positions 1, 2, and 3 have the smallest brightness differences from the center pixel, the pixels at positions 1, 2, and 3 are considered to belong to the same category as the center pixel.
[0083] In an exemplary embodiment of this application, classifying the chromaticity component at the current pixel position based on the first chromaticity component of the current pixel at the current pixel position and the first chromaticity components of the surrounding pixels in the surrounding pixel region may include:
[0084] The difference between the first chromaticity component of the current pixel and the first chromaticity component of each of the surrounding pixels is evaluated using a preset difference method, and the chromaticity components at the current pixel position are classified according to the evaluation results.
[0085] In an exemplary embodiment of this application, the step of evaluating the difference between the first chromaticity component of the current pixel and the first chromaticity component of each of the surrounding pixels using a preset difference method, and classifying the chromaticity component at the current pixel position based on the evaluation result, may include:
[0086] Calculate the absolute value of the chromaticity component difference between the first chromaticity component of the current pixel and the first chromaticity component of each of the surrounding pixels;
[0087] Obtain the positions of b sub-pixels corresponding to the b absolute values of the chromaticity component differences with the smallest values among all the calculated absolute values of the chromaticity component differences, and record the encoding of the b sub-pixel positions as chromaticity position markers;
[0088] The positions of the b sub-pixels are identified as belonging to the same type of first chromaticity component as the current pixel position.
[0089] In an exemplary embodiment of this application, the classification of the current pixel position can be determined based on the first chromaticity component of the current pixel position and the first chromaticity components of the surrounding pixels in the surrounding pixel region.
[0090] In an exemplary embodiment of this application, the difference method can still be used to evaluate and classify the differences between pixels. The U component (e.g., U7) of the pixel at the center pixel (i.e., the previous pixel position) is subtracted from the U components of the eight surrounding pixels (U0, U2, U4, U5, U9, Ua, Uc, Ue) in the surrounding pixel region (i.e., the eight sub-pixel positions of the surrounding pixel region), and the multiple (e.g., three) sub-pixel positions with the smallest difference are found. Assuming that positions 1, 2, and 4 are the positions with the smallest chromaticity difference from the center pixel, then the pixels at positions 1, 2, and 4 are considered to belong to the same class as the center pixel.
[0091] In an exemplary embodiment of this application, the step of recovering the second chromaticity component of the current pixel position using the second chromaticity component of the surrounding pixels based on the luminance component classification result and the chromaticity component classification result of the current pixel position may include:
[0092] Obtain the luminance position markers from the luminance component classification results and the chrominance position markers from the chrominance component classification results;
[0093] When multiple sub-pixel positions are determined to belong to both the same type of luminance component and the same type of first chrominance component as the current pixel position based on the luminance position marker and the chrominance position marker, the second chrominance components of the surrounding pixels contained in the multiple sub-pixel positions are obtained as the second chrominance component of the current pixel position; or, the sub-pixel position that is closest to the multiple sub-pixel positions and contains the second chrominance components of the surrounding pixels is determined, and the second chrominance components of the surrounding pixels contained in the determined sub-pixel position are obtained as the second chrominance component of the current pixel position.
[0094] In an exemplary embodiment of this application, combining the aforementioned luminance and chrominance position markers, if it is determined that the surrounding sub-pixel positions corresponding to a plurality of position markers belong to both the same luminance category and the same chrominance category as the current pixel position, then the pixels of the second chrominance component of the surrounding pixels included in the surrounding sub-pixel positions corresponding to the plurality of position markers can be used as reference points to recover the pixel components of the current pixel position. That is, the V component of the YV pixels of the sub-pixel positions corresponding to the plurality of position markers is used as the V component of the pixel at the current pixel position.
[0095] In an exemplary embodiment of this application, for example, positions 1, 2, and 3 in the above example are similar in brightness (i.e., belong to the same brightness category), and positions 1, 2, and 4 are similar in first chromaticity (i.e., belong to the same chromaticity category). Positions 1 and 2 belong to both the same brightness category and the same chromaticity category. Position 1 contains a second chromaticity component (i.e., the second chromaticity component of surrounding pixels). Therefore, the second chromaticity component in position 1 (YV1) is taken as the second chromaticity component of the center pixel (i.e., the current pixel position). When multiple second chromaticity components meet the criteria, only one needs to be selected. Since they are all relatively close, the choice is not significant. Various methods can be used, such as arbitrary selection, minimum distance selection, minimum interpolation selection, average value selection, etc.
[0096] In an exemplary embodiment of this application, the step of recovering the second chromaticity component of the current pixel position using the second chromaticity component of the surrounding pixels based on the luminance component classification result and the chromaticity component classification result of the current pixel position may include:
[0097] Obtain the luminance position markers from the luminance component classification results and the chrominance position markers from the chrominance component classification results;
[0098] When it is determined, based on the luminance position marker and the chrominance position marker, that multiple sub-pixel positions are different from the current pixel position and belong to the same type of luminance component and the same type of first chrominance component, the sub-pixel positions among the multiple sub-pixel positions that belong to the same type of chrominance component as the current pixel position are obtained. The second chrominance component of the surrounding pixels corresponding to the sub-pixel position that has the smallest distance from the current pixel position among the sub-pixel positions that belong to the same type of chrominance component as the current pixel position is taken as the second chrominance component of the current pixel position.
[0099] In an exemplary embodiment of this application, combining the aforementioned luminance position marker and chrominance position marker information, if it is determined that the surrounding sub-pixel positions corresponding to one or more position markers do not belong to the same luminance category and the same chrominance category as the current pixel position, then taking the second chrominance component (i.e., the second chrominance component of the surrounding pixels) contained in the sub-pixel position corresponding to the same chrominance category as the primary reference, the pixel component of the current position is recovered.
[0100] In an exemplary embodiment of this application, for example, positions 1, 2, and 3 in the above example are similar brightness positions (i.e., belong to the same brightness category), and positions 4, 6, and 7 are similar first chromaticity positions (i.e., belong to the same chromaticity category). Therefore, the two categories do not have the same positions. The first chromaticity category result can be used as the filtering range. Among the three positions 4, 6, and 7, positions 4 and 6 contain the second chromaticity component. The second chromaticity component that is closest to the center pixel (the position with the smallest difference) can be taken as the second chromaticity component of the center pixel (i.e., the current pixel position) (i.e., the current pixel's second chromaticity component).
[0101] This application also provides an image processing apparatus 1, such as... Figure 8 As shown, the device may include a processor 11 and a computer-readable storage medium 12, wherein the computer-readable storage medium 12 stores instructions that, when executed by the processor 11, implement the image processing method described in any of the above-mentioned embodiments.
[0102] In the exemplary embodiments of this application, any of the embodiments in the above-described image processing method embodiments are applicable to the device embodiments, and will not be described in detail here.
[0103] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
Claims
1. An image processing method, characterized in that, The method includes: Obtain the current pixel component corresponding to the current pixel position; the current pixel component includes: the current pixel luminance component and the current pixel first chrominance component; Obtain the surrounding pixel region of the current pixel position, and the surrounding pixel components corresponding to the surrounding pixel region; the surrounding pixel components include: the surrounding pixel luminance component, the surrounding pixel first chrominance component, and the surrounding pixel second chrominance component; The luminance component of the current pixel position is classified according to the current pixel luminance component and the luminance components of the surrounding pixels, and the chrominance component of the current pixel position is classified according to the first chrominance component of the current pixel and the first chrominance component of the surrounding pixels. The second chromaticity component of the current pixel position is recovered using the second chromaticity component of the surrounding pixels based on the classification results of the luminance component and the chromaticity component of the current pixel position.
2. The image processing method according to claim 1, characterized in that, The step of obtaining the surrounding pixel region of the current pixel position includes: The current pixel position is taken as the center pixel position; Multiple sub-pixel positions are determined around the central pixel position, and these multiple sub-pixel positions constitute an N*M pixel region, which serves as the surrounding pixel region; N and M are positive integers.
3. The image processing method according to claim 1, characterized in that, Before classifying the luminance and chrominance components at the current pixel location, the method further includes: Based on the relative positional relationship between the current pixel position and the surrounding pixel region, the position of each sub-pixel within the surrounding pixel region is encoded.
4. The image processing method according to claim 3, characterized in that, The step of classifying the luminance component at the current pixel position based on the current pixel luminance component and the luminance components of the surrounding pixels includes: The difference between the current pixel luminance component and the luminance components of each of the surrounding pixels is evaluated using a preset difference method, and the luminance components at the current pixel position are classified according to the evaluation results.
5. The image processing method according to claim 4, characterized in that, The method of evaluating the difference between the current pixel's luminance component and the luminance components of each of the surrounding pixels using a preset difference method, and classifying the luminance component at the current pixel position based on the evaluation results, includes: Calculate the absolute value of the difference between the current pixel luminance component and the luminance components of each of the surrounding pixels; Obtain the positions of a sub-pixels corresponding to the a absolute values of the smallest absolute values of all calculated luminance component differences, and record the codes of the a sub-pixel positions as luminance position markers; a is a positive integer; The positions of the a sub-pixels are identified as belonging to the same type of brightness component as the current pixel position.
6. The image processing method according to claim 5, characterized in that, The step of classifying the chromaticity components at the current pixel position based on the first chromaticity component of the current pixel and the first chromaticity components of the surrounding pixels includes: The difference between the first chromaticity component of the current pixel and the first chromaticity component of each of the surrounding pixels is evaluated using a preset difference method, and the chromaticity components at the current pixel position are classified according to the evaluation results.
7. The image processing method according to claim 6, characterized in that, The method of evaluating the difference between the first chromaticity component of the current pixel and the first chromaticity components of each of the surrounding pixels using a preset difference method, and classifying the chromaticity components at the current pixel position based on the evaluation results, includes: Calculate the absolute value of the chromaticity component difference between the first chromaticity component of the current pixel and the first chromaticity component of each of the surrounding pixels; Obtain the positions of b sub-pixels corresponding to the b absolute values of the chromaticity component differences with the smallest values among all the calculated absolute values of the chromaticity component differences, and record the codes of the b sub-pixel positions as chromaticity position markers; b is a positive integer; The positions of the b sub-pixels are identified as belonging to the same type of first chromaticity component as the current pixel position.
8. The image processing method according to claim 7, characterized in that, The step of recovering the second chromaticity component of the current pixel position using the second chromaticity component of the surrounding pixels based on the luminance component classification result and the chromaticity component classification result of the current pixel position includes: Obtain the luminance position markers from the luminance component classification results and the chrominance position markers from the chrominance component classification results; When multiple sub-pixel positions are determined to belong to both the same type of luminance component and the same type of first chrominance component as the current pixel position based on the luminance position marker and the chrominance position marker, the second chrominance components of the surrounding pixels contained in the multiple sub-pixel positions are obtained as the second chrominance component of the current pixel position; or, the sub-pixel position that is closest to the multiple sub-pixel positions and contains the second chrominance components of the surrounding pixels is determined, and the second chrominance components of the surrounding pixels contained in the determined sub-pixel position are obtained as the second chrominance component of the current pixel position.
9. The image processing method according to claim 7, characterized in that, The step of recovering the second chromaticity component of the current pixel position using the second chromaticity component of the surrounding pixels based on the luminance component classification result and the chromaticity component classification result of the current pixel position includes: Obtain the luminance position markers from the luminance component classification results and the chrominance position markers from the chrominance component classification results; When it is determined, based on the luminance position marker and the chrominance position marker, that multiple sub-pixel positions are different from the current pixel position and belong to the same type of luminance component and the same type of first chrominance component, the sub-pixel positions among the multiple sub-pixel positions that belong to the same type of first chrominance component as the current pixel position are obtained. The second chrominance component of the surrounding pixels corresponding to the sub-pixel position that has the smallest distance from the current pixel position among the sub-pixel positions that belong to the same type of first chrominance component as the current pixel position is taken as the second chrominance component of the current pixel position.
10. An image processing apparatus comprising a processor and a computer-readable storage medium storing instructions, characterized in that, When the instructions are executed by the processor, the image processing method as described in any one of claims 1-9 is implemented.
Citation Information
Patent Citations
Stream media image processing method
CN101146234A
Data interpolation method and device and image output method and device
CN103259960A