CN111526366B - Image processing method, image processing apparatus, image capturing device, and storage medium - Google Patents
Image processing method, image processing apparatus, image capturing device, and storage medium Download PDFInfo
- Publication number
- CN111526366B CN111526366B CN202010352076.6A CN202010352076A CN111526366B CN 111526366 B CN111526366 B CN 111526366B CN 202010352076 A CN202010352076 A CN 202010352076A CN 111526366 B CN111526366 B CN 111526366B
- Authority
- CN
- China
- Prior art keywords
- image
- data
- value
- target
- image block
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/186—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/17—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
- H04N19/176—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/182—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/625—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Discrete Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The embodiment of the invention provides an image processing method and device, an image pickup device and a storage medium. The image processing method comprises the following steps: acquiring an initial image, wherein the initial image corresponds to an RGB data format; dividing the initial image into a plurality of image blocks; converting each image block in the plurality of image blocks from an RGB data format to a YUV data format, wherein Y is a luminance value and UV is a chrominance value; inverting the luminance value Y of a target image block into a darkness value D, the target image block being one or more of the plurality of image blocks; and coding the DUV data of the target image block and the YUV data of the non-reversal image block to obtain the target image data of the initial image. By inverting the luminance value Y to the darkness value D, the effect of reducing the data amount of the image data obtained by encoding is achieved.
Description
Technical Field
The embodiment of the invention relates to the technical field of image processing, in particular to an image processing method and device, an image pickup device and a storage medium.
Background
With the development of 5G technology and high definition video technology, the demand of high definition display is increasing.
Currently, a high definition video is displayed by dividing the video into one frame and one frame of pictures, converting RGB data into YUV data for each picture, and then decoding the YUV data. And then transmitted to a display device, such as a television, for playback. Since the conventional display devices display images in a passive light-emitting mode, the conventional encoding method is also provided for the display devices in the passive light-emitting mode. For some display devices with active lighting mode, the encoding method of passive lighting mode is also used.
However, for the display device in the active lighting mode, encoding each frame of image of the video by using the encoding method in the passive lighting mode also results in a very large data amount of the encoded image data.
Disclosure of Invention
The embodiment of the invention provides an image processing method, an image processing device, an image pickup apparatus and a storage medium, which are used for reducing the data volume of image data obtained by encoding.
In a first aspect, an embodiment of the present invention provides an image processing method, including:
acquiring an initial image, wherein the initial image corresponds to an RGB data format;
dividing the initial image into a plurality of image blocks;
converting each image block in the plurality of image blocks from an RGB data format to a YUV data format, wherein Y is a luminance value and UV is a chrominance value;
inverting the luminance value Y of a target image block into a darkness value D, the target image block being one or more of the plurality of image blocks;
and coding the DUV data of the target image block and the YUV data of the non-reversal image block to obtain the target image data of the initial image.
Optionally, the image partition includes one or more pixel points, the RGB data format includes an R component, a G component, and a B component, the YUV data format includes a Y component, a U component, and a V component, and the converting each image partition in the plurality of image partitions from the RGB data format to the YUV data format includes:
determining one or more pixel points corresponding to each image block;
determining the Y component of each pixel point according to the R component, the G component and the B component of each pixel point;
determining a first target pixel point of the one or more pixel points;
and determining the U component and/or the V component of the first target pixel point according to the R component, the G component and the B component of the first target pixel point.
Optionally, the inverting the luminance value Y of the target image block into the darkness value D includes:
the brightness value Y of the target image block is inverted into a darkness value D through a first preset formula, wherein the first preset formula is as follows:
d ═ 255-Y, where Y ═ 0.299R +0.587G + 0.114B.
Optionally, the inverting the luminance value Y of the target image block into the darkness value D includes:
acquiring the average brightness value of each image block;
determining the image block with the average brightness value larger than a first preset brightness threshold value as the target image block;
and reversing the brightness value Y of each pixel point corresponding to the target image block into a darkness value D.
Optionally, the inverting the luminance value Y of the target image block into the darkness value D includes:
acquiring the brightness value Y of each pixel point corresponding to each image block;
determining pixel points with the brightness value Y larger than a second preset brightness threshold value as second target pixel points;
and the brightness value Y of the second target pixel point is inverted into a darkness value D.
Optionally, the encoding the DUV data of the target image block and the YUV data of the non-inverted image block to obtain the target image data of the initial image includes:
performing discrete cosine transform on the DUV data of the target image block and the YUV data of the non-inverted image block to obtain DUV data after discrete cosine transform and YUV data after discrete cosine transform;
and coding the DUV data after the discrete cosine transform and the YUV data after the discrete cosine transform to obtain target image data of the initial image.
Optionally, after the encoding the DUV data of the target image block and the YUV data of the non-inverted image block to obtain the target image data of the initial image, the method includes:
and transmitting the target image data to display equipment so that the display equipment can decode and play the target image data of the initial image.
In a second aspect, an embodiment of the present invention provides an image processing apparatus, including:
the image acquisition module is used for acquiring an initial image, and the initial image corresponds to an RGB data format;
the dividing module is used for dividing the initial image into a plurality of image blocks;
the data conversion module is used for converting each image block in the plurality of image blocks from an RGB data format to a YUV data format, wherein Y is a brightness value, and UV is a chromatic value;
the data conversion module is further configured to invert luminance values Y of a target image block into a darkness value D, the target image block being one or more of the plurality of image blocks;
and the coding module is used for coding the DUV data of the target image block and the YUV data of the non-reversal image block to obtain the target image data of the initial image.
In a third aspect, an embodiment of the present invention provides an image pickup apparatus including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement an image processing method as in any embodiment of the invention.
In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements an image processing method according to any of the embodiments of the present invention.
The embodiment of the invention collects an initial image, wherein the initial image corresponds to an RGB data format; dividing the initial image into a plurality of image blocks; converting each image block in the plurality of image blocks from an RGB data format to a YUV data format, wherein Y is a luminance value and UV is a chrominance value; inverting the luminance value Y of a target image block into a darkness value D, the target image block being one or more of the plurality of image blocks; and coding the DUV data of the target image block and the YUV data of the non-inverted image block to obtain the target image data of the initial image, so that the problem of very large data volume of the image data obtained by coding is solved, and the effect of reducing the data volume of the image data obtained by coding is realized.
Drawings
Fig. 1 is a schematic flowchart of an image processing method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of an image processing method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of an image processing apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an image capturing apparatus according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. A process may be terminated when its operations are completed, but may have additional steps not included in the figure. A process may correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
Furthermore, the terms "first," "second," and the like may be used herein to describe various orientations, actions, steps, elements, or the like, but the orientations, actions, steps, or elements are not limited by these terms. These terms are only used to distinguish one direction, action, step or element from another direction, action, step or element. For example, without departing from the scope of the present application, the first target pixel may be referred to as a second target pixel, and similarly, the second target pixel may be referred to as a first target pixel. Both the first target pixel point and the second target pixel point are target pixel points, but the first target pixel point and the second target pixel point are not the same target pixel point. The terms "first", "second", etc. are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Example one
Fig. 1 is a flowchart of an image processing method according to an embodiment of the present invention, which is applicable to a scene in which an image is processed, and the method may be executed by an image processing apparatus, where the apparatus may be implemented in a software and/or hardware manner, and may be integrated on an image capturing device.
As shown in fig. 1, an image processing method according to an embodiment of the present invention includes:
s110, acquiring an initial image, wherein the initial image corresponds to an RGB data format.
The initial image is an image that needs to be encoded. Specifically, the initial image may be each frame image in a plurality of frame images constituting one video, for example, each frame image of a high definition video may be the initial image of this embodiment; the initial image may also be a picture, such as a landscape picture, etc., and is not particularly limited herein. In this step, the initial image corresponds to the RGB data format. The RGB data format refers to a data format in an RGB color mode. Specifically, any one color light F can be formed by adding and mixing R, G, B three colors with different components: f ═ R [ R ] + G [ G ] + B [ B ]. Wherein R, G, B are the coefficients of the three primary colors participating in the mixing respectively. Optionally, an initial image may be acquired by a camera device such as a camera having an image capturing function, and an RGB data format of each pixel point in the initial image, that is, an RGB value of each pixel point, is obtained after color separation correction.
And S120, dividing the initial image into a plurality of image blocks.
In this step, the images of the image blocks do not overlap each other. The plurality of image blocks refers to two or more image blocks, and the specific number of the plurality of image blocks is not limited. Alternatively, the image sizes of the image blocks may be the same or different, and are not limited herein. Preferably, the image sizes of the plurality of image blocks are the same. For example, the initial image is 160 × 160 in size, and is divided into 20 × 20 8 pixel blocks, each pixel block has 64 pixels, and each pixel is represented by RGB.
And S130, converting each image block in the plurality of image blocks from an RGB data format to a YUV data format, wherein Y is a brightness value, and UV is a chromatic value.
In this step, each image partition includes one or more pixel points. The specific number of the pixels is determined by dividing the image partition, and the embodiment is not particularly limited.
In an alternative embodiment, the image tile includes one or more pixel points, the RGB data format includes an R component, a G component, and a B component, the YUV data format includes a Y component, a U component, and a V component, and the converting each image tile of the plurality of image tiles from the RGB data format to the YUV data format includes:
determining one or more pixel points corresponding to each image block; determining the Y component of each pixel point according to the R component, the G component and the B component of each pixel point; determining a first target pixel point of the one or more pixel points; and determining the U component and/or the V component of the first target pixel point according to the R component, the G component and the B component of the first target pixel point.
In this embodiment, the R component, the G component, and the B component of each pixel point can be obtained by performing color separation correction on the initial image. And determining the Y component of each pixel point according to the R component, the G component and the B component of each pixel point. Alternatively, the Y component of each pixel may be calculated by (0.299R +0.587G + 0.114B). The first target pixel point refers to a pixel point needing to calculate the U component and/or the V component. Specifically, the first target pixel point is different for different YUV data formats. Taking the YUV420 format as an example, each pixel retains one Y (luminance) component, and in the horizontal direction, instead of taking U and V components for each row, only U components for one row, it repeats with only V components for the next row (i.e., 4:2:0,4:0: 2). Optionally, the U component of the first target pixel point may be calculated by-0.147R-0.289G + 0.436B. The V component of the first target pixel point can be calculated by V ═ 0.615R-0.515G-0.100B.
S140, inverting the brightness value Y of the target image block into a darkness value D, wherein the target image block is one or more of the plurality of image blocks.
The target image block refers to one or more image blocks of which the luminance value Y needs to be inverted to the darkness value D. Optionally, all image blocks in the plurality of image blocks may be used as the target image block in the present embodiment, so as to invert the luminance value Y into a darkness value D; a partial image block of the plurality of image blocks, for example, an image block having an average luminance value greater than 128, may be used as the target image block of the present embodiment, which is not limited herein.
Optionally, the brightness value Y of the target image block may be inverted into a darkness value D by a first preset formula, where the first preset formula is: d ═ 255-Y, where Y ═ 0.299R +0.587G + 0.114B. Wherein R, G, B are the coefficients of the three primary colors participating in the mixing respectively.
In an alternative embodiment, the inverting the luminance value Y of the target image block into the darkness value D includes:
acquiring the average brightness value of each image block; determining the image block with the average brightness value larger than a first preset brightness threshold value as the target image block; and reversing the brightness value Y of each pixel point corresponding to the target image block into a darkness value D.
In this embodiment, the average brightness value may be obtained by summing the brightness values Y of the pixels corresponding to each image block. Optionally, the first preset brightness threshold is 128. In this embodiment, the luminance value Y of each pixel of the target image block is inverted to a darkness value D.
Specifically, the luminance values Y of the pixel points of all the image blocks are inverted to the darkness values D, so that the data amount can be reduced. However, the luminance value Y of the partial image block is inverted to the darkness value D, which increases the data amount. Therefore, the target image block with the average brightness value larger than the first preset brightness threshold value is inverted, but the non-target image block is not inverted, and the data size obtained by decoding is further reduced.
In another alternative embodiment, the inverting the luminance value Y of the target image block into the darkness value D includes:
acquiring the brightness value Y of each pixel point corresponding to each image block; determining pixel points with the brightness value Y larger than a second preset brightness threshold value as second target pixel points; and the brightness value Y of the second target pixel point is inverted into a darkness value D.
In this embodiment, optionally, all the image blocks are used as the target image blocks. The second target pixel point is a pixel point of which the brightness value Y is greater than a second preset brightness threshold value. Optionally, the second preset brightness threshold is 128. In this embodiment, the brightness value Y of the second target pixel is inverted to the darkness value D, and the brightness values Y of other non-second target pixels do not need to be inverted to the darkness value D, so as to further reduce the data size obtained by decoding.
S150, encoding the DUV data of the target image block and the YUV data of the non-reversal image block to obtain the target image data of the initial image.
The target image data is obtained by encoding DUV data of a target image block and YUV data of an unreversed image block in an initial image. Encoding refers to an operation of compiling DUV data and YUV data into binary characters. The non-inverted image block is an image block other than the target image block among the plurality of image blocks.
In this embodiment, specifically, since most of the current high-definition display devices display video pictures in an active light emitting mode (dark background + highlight pattern, i.e. black and white characters), a large area of display is dark. In the passive light-emitting mode, the code for dark display is 1, and the code for bright display is 0, but in the active light-emitting mode, the code for dark display is 0, and the code for bright display is 1, and at this time, if only YUV data of all image blocks are coded according to the requirement of the active light-emitting mode, the data size obtained by coding is inevitably very large. However, the embodiment inverts the luminance value Y of the target image block into the darkness value D, and adapts to the display device in the active lighting mode for encoding, thereby solving the problem that the data size of the image data obtained by encoding is very large, and particularly solving the problem that the data size of the image data obtained by encoding the display device in the active lighting mode is very large. In addition, the data size of the decoded image data is reduced, and the transmission efficiency of the image data transmitted to the display device for playing is improved.
In an optional implementation, after the encoding the DUV data of the target image partition and the YUV data of the non-inverted image partition to obtain the target image data of the initial image, the method includes:
and transmitting the target image data to display equipment so that the display equipment can decode and play the target image data of the initial image.
In this embodiment mode, the display device may be in an active light-emitting mode, or may be a device in which the active light-emitting mode is compatible with a passive light-emitting mode. Specifically, when all the pixel points of the initial image are inverted from the brightness value Y to the darkness value D, the display device may be a device in an active light-emitting mode, where the code displayed in the dark color is 0 and the code displayed in the bright color is 1. When part of pixel points of the initial image are inverted into a darkness value D from a brightness value Y, the inverted part of pixel points are displayed by adopting an active light-emitting mode, namely the code displayed by the darkness is 0, and the code displayed by the brightness is 1; and the rest part of pixels which are not inverted are displayed by adopting a passive light-emitting mode, namely the code displayed by dark color is 1, and the code displayed by bright color is 0. The decoding and playing refers to an operation of playing and displaying the target image data after performing inverse decoding on the target image data.
Specifically, when the initial image is a picture, the display device may decode and play the initial image. When the initial image is each frame image in the multi-frame images forming a video, each initial image is decoded and coded according to the time stamp, so that the complete playing of the video is realized.
According to the technical scheme of the embodiment of the invention, an initial image is collected, and the initial image corresponds to an RGB data format; dividing the initial image into a plurality of image blocks; converting each image block in the plurality of image blocks from an RGB data format to a YUV data format, wherein Y is a luminance value and UV is a chrominance value; inverting the luminance value Y of a target image block into a darkness value D, the target image block being one or more of the plurality of image blocks; and encoding the DUV data of the target image block and the YUV data of the non-inverted image block to obtain the target image data of the initial image, and encoding the target image data by inverting the brightness value Y into a darkness value D in a manner of adapting to display equipment in an active light-emitting mode, so that the technical effect of reducing the data volume of the image data obtained by encoding is achieved.
Example two
Fig. 2 is a flowchart illustrating an image processing method according to a second embodiment of the present invention. The embodiment is further refined in the technical scheme, and is suitable for scenes for processing images. The method may be performed by an image processing apparatus, which may be implemented in software and/or hardware, and may be integrated on an image pickup device.
As shown in fig. 2, an image processing method according to a second embodiment of the present invention includes:
s210, collecting an initial image, wherein the initial image corresponds to an RGB data format.
The initial image is an image that needs to be encoded.
S220, dividing the initial image into a plurality of image blocks.
In this step, the images of the image blocks do not overlap each other. The plurality of image blocks refers to two or more image blocks, and the specific number of the plurality of image blocks is not limited.
And S230, converting each image block in the plurality of image blocks from an RGB data format into a YUV data format, wherein Y is a brightness value, and UV is a chromatic value.
In this step, each image partition includes one or more pixel points. The specific number of the pixels is determined by dividing the image partition, and the embodiment is not particularly limited.
S240, the brightness value Y of the target image block is inverted into a darkness value D, and the target image block is one or more of the image blocks.
The target image block refers to one or more image blocks of which the luminance value Y needs to be inverted to the darkness value D.
And S250, performing discrete cosine transform on the DUV data of the target image block and the YUV data of the non-inverted image block to obtain DUV data after discrete cosine transform and YUV data after discrete cosine transform.
In this step, performing discrete cosine transform on the target image block and the non-inverted image block means converting the image block from a spatial domain to a frequency domain, that is, calculating which two-dimensional cosine waves constitute the image. Specifically, the discrete cosine transform discards high frequency coefficients (AC coefficients) and retains low frequency information (DC coefficients). The high-frequency coefficient generally stores information on the boundary and texture of an image, and the low-frequency information is mainly information on a flat area in the stored image.
And S260, coding the DUV data after the discrete cosine transform and the YUV data after the discrete cosine transform to obtain target image data of the initial image.
In this step, the DUV data after the discrete cosine transform and the YUV data after the discrete cosine transform are encoded, thereby obtaining target image data of the initial image.
According to the technical scheme of the embodiment of the invention, an initial image is collected, and the initial image corresponds to an RGB data format; dividing the initial image into a plurality of image blocks; converting each image block in the plurality of image blocks from an RGB data format to a YUV data format, wherein Y is a luminance value and UV is a chrominance value; inverting the luminance value Y of a target image block into a darkness value D, the target image block being one or more of the plurality of image blocks; and encoding the DUV data of the target image block and the YUV data of the non-inverted image block to obtain the target image data of the initial image, and encoding the target image data by inverting the brightness value Y into a darkness value D in a manner of adapting to display equipment in an active light-emitting mode, so that the technical effect of reducing the data volume of the image data obtained by encoding is achieved.
EXAMPLE III
Fig. 3 is a schematic structural diagram of an image processing apparatus according to a third embodiment of the present invention, where this embodiment is applicable to a scene in which an image is processed, and the apparatus may be implemented in a software and/or hardware manner and may be integrated on an image capturing device.
As shown in fig. 3, the image processing apparatus provided in this embodiment may include an image capturing module 310, a dividing module 320, a data converting module 330, and an encoding module 340, where:
an image acquisition module 310, configured to acquire an initial image, where the initial image corresponds to an RGB data format;
a dividing module 320, configured to divide the initial image into a plurality of image blocks;
a data conversion module 330, configured to convert each image block of the plurality of image blocks from an RGB data format to a YUV data format, where Y is a luminance value and UV is a chrominance value;
the data conversion module 330 is further configured to invert the luminance values Y of a target image block into the darkness values D, the target image block being one or more of the plurality of image blocks;
and the encoding module 340 is configured to encode the DUV data of the target image block and the YUV data of the non-inverted image block to obtain the target image data of the initial image.
Optionally, the image partition includes one or more pixel points, the RGB data format includes an R component, a G component, and a B component, the YUV data format includes a Y component, a U component, and a V component, and the data conversion module 330 includes:
the pixel point determining unit is used for determining one or more pixel points corresponding to each image block;
the Y component determining unit is used for determining the Y component of each pixel point according to the R component, the G component and the B component of each pixel point;
a first target pixel point determining unit, configured to determine a first target pixel point of the one or more pixel points;
and the UV component determining unit is used for determining the U component and/or the V component of the first target pixel point according to the R component, the G component and the B component of the first target pixel point.
Optionally, the data conversion module 330 is specifically configured to invert the brightness value Y of the target image block into a darkness value D by using a first preset formula, where the first preset formula is:
d ═ 255-Y, where Y ═ 0.299R +0.587G + 0.114B.
Optionally, the data conversion module 330 further includes:
an average brightness value obtaining unit, configured to obtain an average brightness value of each image block;
a target image block determination unit, configured to determine an image block with the average brightness value greater than a first preset brightness threshold as the target image block;
and the first darkness value reversing unit is used for reversing the brightness value Y of each pixel point corresponding to the target image block into a darkness value D.
Optionally, the data conversion module 330 further includes:
the brightness value Y acquiring unit is used for acquiring the brightness value Y of each pixel point corresponding to each image block;
the second target pixel point determining unit is used for determining pixel points with the brightness value Y larger than a second preset brightness threshold value as second target pixel points;
and the second value reversing unit is used for reversing the brightness value Y of the second target pixel point into a darkness value D.
Optionally, the encoding module 340 includes:
the change unit is used for performing discrete cosine transform on the DUV data of the target image block and the YUV data of the non-inverted image block to obtain DUV data after the discrete cosine transform and YUV data after the discrete cosine transform;
and the coding unit is used for coding the DUV data after the discrete cosine transform and the YUV data after the discrete cosine transform to obtain target image data of the initial image.
Optionally, the apparatus further comprises:
and the transmission module is used for transmitting the target image data to display equipment so that the display equipment can decode and play the target image data of the initial image.
The image processing device provided by the embodiment of the invention can execute the image processing method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. Reference may be made to the description of any method embodiment of the invention not specifically described in this embodiment.
Example four
Fig. 4 is a schematic structural diagram of an image capturing apparatus according to a fourth embodiment of the present invention. Fig. 4 shows a block diagram of an exemplary image capture device 612 suitable for use in implementing embodiments of the present invention. The image pickup apparatus 612 shown in fig. 4 is only an example, and should not bring any limitation to the functions and the range of use of the embodiment of the present invention.
As shown in fig. 4, the image pickup apparatus 612 is expressed in the form of a general-purpose image pickup apparatus. Components of the camera device 612 may include, but are not limited to: one or more processors 616, a memory device 628, and a bus 618 that couples the various system components including the memory device 628 and the processors 616.
The camera device 612 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by the camera device 612 and includes both volatile and nonvolatile media, removable and non-removable media.
A program/utility 640 having a set (at least one) of program modules 642 may be stored, for example, in storage 628, such program modules 642 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. The program modules 642 generally perform the functions and/or methods of the described embodiments of the present invention.
The camera device 612 may also communicate with one or more external devices 614 (e.g., keyboard, pointing terminal, display 624, etc.), with one or more terminals that enable a user to interact with the camera device 612, and/or with any terminals (e.g., network card, modem, etc.) that enable the camera device 612 to communicate with one or more other computing terminals. Such communication may occur via input/output (I/O) interfaces 622. Also, the camera device 612 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public Network, such as the internet) through the Network adapter 620. As shown in fig. 4, the network adapter 620 communicates with the other modules of the camera device 612 via the bus 618. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the image capture device 612, including but not limited to: microcode, end drives, Redundant processors, external disk drive Arrays, RAID (Redundant Arrays of Independent Disks) systems, tape drives, and data backup storage systems, among others.
The processor 616 executes various functional applications and data processing by executing programs stored in the storage device 628, for example, implementing an image processing method provided by any embodiment of the present invention, which may include:
acquiring an initial image, wherein the initial image corresponds to an RGB data format;
dividing the initial image into a plurality of image blocks;
converting each image block in the plurality of image blocks from an RGB data format to a YUV data format, wherein Y is a luminance value and UV is a chrominance value;
inverting the luminance value Y of a target image block into a darkness value D, the target image block being one or more of the plurality of image blocks;
and coding the DUV data of the target image block and the YUV data of the non-reversal image block to obtain the target image data of the initial image.
According to the technical scheme of the embodiment of the invention, an initial image is collected, and the initial image corresponds to an RGB data format; dividing the initial image into a plurality of image blocks; converting each image block in the plurality of image blocks from an RGB data format to a YUV data format, wherein Y is a luminance value and UV is a chrominance value; inverting the luminance value Y of a target image block into a darkness value D, the target image block being one or more of the plurality of image blocks; and encoding the DUV data of the target image block and the YUV data of the non-inverted image block to obtain the target image data of the initial image, and encoding the target image data by inverting the brightness value Y into a darkness value D in a manner of adapting to display equipment in an active light-emitting mode, so that the technical effect of reducing the data volume of the image data obtained by encoding is achieved.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements an image processing method according to any embodiment of the present invention, where the method may include:
acquiring an initial image, wherein the initial image corresponds to an RGB data format;
dividing the initial image into a plurality of image blocks;
converting each image block in the plurality of image blocks from an RGB data format to a YUV data format, wherein Y is a luminance value and UV is a chrominance value;
inverting the luminance value Y of a target image block into a darkness value D, the target image block being one or more of the plurality of image blocks;
and coding the DUV data of the target image block and the YUV data of the non-reversal image block to obtain the target image data of the initial image.
The computer-readable storage media of embodiments of the invention may take any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or terminal. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
According to the technical scheme of the embodiment of the invention, an initial image is collected, and the initial image corresponds to an RGB data format; dividing the initial image into a plurality of image blocks; converting each image block in the plurality of image blocks from an RGB data format to a YUV data format, wherein Y is a luminance value and UV is a chrominance value; inverting the luminance value Y of a target image block into a darkness value D, the target image block being one or more of the plurality of image blocks; and encoding the DUV data of the target image block and the YUV data of the non-inverted image block to obtain the target image data of the initial image, and encoding by inverting the brightness value Y into a darkness value D and adapting to display equipment in an active light-emitting mode to achieve the technical effect of reducing the encoded data volume of the obtained image data.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims (10)
1. An image processing method, characterized in that the method comprises:
acquiring an initial image, wherein the initial image corresponds to an RGB data format;
dividing the initial image into a plurality of image blocks;
converting each image block in the plurality of image blocks from an RGB data format to a YUV data format, wherein Y is a luminance value and UV is a chrominance value;
inverting the luminance value Y of a target image block into a darkness value D, the target image block being one or more of the plurality of image blocks;
and coding the DUV data of the target image block and the YUV data of the non-reversal image block to obtain the target image data of the initial image.
2. The method of claim 1, wherein the image tile comprises one or more pixel points, the RGB data format comprises an R component, a G component, and a B component, the YUV data format comprises a Y component, a U component, and a V component, the converting each image tile of the plurality of image tiles from the RGB data format to the YUV data format comprises:
determining one or more pixel points corresponding to each image block;
determining the Y component of each pixel point according to the R component, the G component and the B component of each pixel point;
determining a first target pixel point of the one or more pixel points;
and determining the U component and/or the V component of the first target pixel point according to the R component, the G component and the B component of the first target pixel point.
3. The method of claim 1, wherein inverting the luminance value Y of the target image block to a darkness value D comprises:
the brightness value Y of the target image block is inverted into a darkness value D through a first preset formula, wherein the first preset formula is as follows:
d ═ 255-Y, where Y ═ 0.299R +0.587G + 0.114B.
4. The method of claim 1, wherein inverting the luminance value Y of the target image block to a darkness value D comprises:
acquiring the average brightness value of each image block;
determining the image block with the average brightness value larger than a first preset brightness threshold value as the target image block;
and reversing the brightness value Y of each pixel point corresponding to the target image block into a darkness value D.
5. The method of claim 1, wherein inverting the luminance value Y of the target image block to a darkness value D comprises:
acquiring the brightness value Y of each pixel point corresponding to each image block;
determining pixel points with the brightness value Y larger than a second preset brightness threshold value as second target pixel points;
and the brightness value Y of the second target pixel point is inverted into a darkness value D.
6. The method of claim 1, wherein the encoding the DUV data of the target image tile and the YUV data of the non-inverted image tile to obtain the target image data of the initial image comprises:
performing discrete cosine transform on the DUV data of the target image block and the YUV data of the non-inverted image block to obtain DUV data after discrete cosine transform and YUV data after discrete cosine transform;
and coding the DUV data after the discrete cosine transform and the YUV data after the discrete cosine transform to obtain target image data of the initial image.
7. The method of claim 1, wherein after said encoding the DUV data of the target image tile and the YUV data of the non-inverted image tile to obtain the target image data of the initial image, comprising:
and transmitting the target image data to display equipment so that the display equipment can decode and play the target image data of the initial image.
8. An image processing apparatus characterized by comprising:
the image acquisition module is used for acquiring an initial image, and the initial image corresponds to an RGB data format;
the dividing module is used for dividing the initial image into a plurality of image blocks;
the data conversion module is used for converting each image block in the plurality of image blocks from an RGB data format to a YUV data format, wherein Y is a brightness value, and UV is a chromatic value;
the data conversion module is further configured to invert luminance values Y of a target image block into a darkness value D, the target image block being one or more of the plurality of image blocks;
and the coding module is used for coding the DUV data of the target image block and the YUV data of the non-reversal image block to obtain the target image data of the initial image.
9. An image pickup apparatus characterized by comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the image processing method of any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the image processing method according to any one of claims 1 to 7.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010352076.6A CN111526366B (en) | 2020-04-28 | 2020-04-28 | Image processing method, image processing apparatus, image capturing device, and storage medium |
TW110115437A TWI825410B (en) | 2020-04-28 | 2021-04-28 | Image processing methods, devices, photographic equipment and storage media |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010352076.6A CN111526366B (en) | 2020-04-28 | 2020-04-28 | Image processing method, image processing apparatus, image capturing device, and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111526366A CN111526366A (en) | 2020-08-11 |
CN111526366B true CN111526366B (en) | 2021-08-06 |
Family
ID=71905032
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010352076.6A Active CN111526366B (en) | 2020-04-28 | 2020-04-28 | Image processing method, image processing apparatus, image capturing device, and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN111526366B (en) |
TW (1) | TWI825410B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112017174B (en) * | 2020-09-03 | 2024-05-31 | 湖南省华芯医疗器械有限公司 | Image processing method, device, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101064766A (en) * | 2006-04-26 | 2007-10-31 | 夏普株式会社 | Image processing method and image processing apparatus |
CN102907108A (en) * | 2011-03-18 | 2013-01-30 | 松下电器产业株式会社 | Generation device, display device, reproduction device, and glasses |
CN104885382A (en) * | 2012-12-27 | 2015-09-02 | 松下电器(美国)知识产权公司 | Visible-light-communication-signal display method and display device |
CN104915629A (en) * | 2014-03-13 | 2015-09-16 | 欧姆龙株式会社 | Image processing apparatus and image processing method |
CN110462627A (en) * | 2017-02-15 | 2019-11-15 | 脱其泰有限责任公司 | Image analysis system and correlation technique |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7283665B2 (en) * | 2003-04-15 | 2007-10-16 | Nokia Corporation | Encoding and decoding data to render 2D or 3D images |
TWI220849B (en) * | 2003-06-20 | 2004-09-01 | Weltrend Semiconductor Inc | Contrast enhancement method using region detection |
KR100630888B1 (en) * | 2004-11-23 | 2006-10-04 | 삼성전자주식회사 | Apparatus and method for improving recognizing performance of darkness of image |
CN101360187B (en) * | 2007-08-03 | 2010-06-02 | 鸿富锦精密工业(深圳)有限公司 | Image processing method and apparatus thereof |
US20110135198A1 (en) * | 2009-12-08 | 2011-06-09 | Xerox Corporation | Chrominance encoding and decoding of a digital image |
CN101873503B (en) * | 2009-12-09 | 2013-02-13 | 杭州海康威视数字技术股份有限公司 | Method and device for adjusting image property |
CN103489427B (en) * | 2012-06-14 | 2015-12-02 | 深圳深讯和科技有限公司 | YUV converts the method and system that RGB and RGB converts YUV to |
TWI629892B (en) * | 2016-05-09 | 2018-07-11 | 國立成功大學 | Rgb to yuv format conversion and inverse conversion method and circuit for depth packing and depacking |
CN107886550B (en) * | 2017-11-07 | 2021-10-19 | 上海应用技术大学 | Image editing propagation method and system |
CN110136183B (en) * | 2018-02-09 | 2021-05-18 | 华为技术有限公司 | Image processing method and device and camera device |
CN110910333B (en) * | 2019-12-12 | 2023-03-14 | 腾讯科技(深圳)有限公司 | Image processing method and image processing apparatus |
-
2020
- 2020-04-28 CN CN202010352076.6A patent/CN111526366B/en active Active
-
2021
- 2021-04-28 TW TW110115437A patent/TWI825410B/en active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101064766A (en) * | 2006-04-26 | 2007-10-31 | 夏普株式会社 | Image processing method and image processing apparatus |
CN102907108A (en) * | 2011-03-18 | 2013-01-30 | 松下电器产业株式会社 | Generation device, display device, reproduction device, and glasses |
CN104885382A (en) * | 2012-12-27 | 2015-09-02 | 松下电器(美国)知识产权公司 | Visible-light-communication-signal display method and display device |
CN104915629A (en) * | 2014-03-13 | 2015-09-16 | 欧姆龙株式会社 | Image processing apparatus and image processing method |
CN110462627A (en) * | 2017-02-15 | 2019-11-15 | 脱其泰有限责任公司 | Image analysis system and correlation technique |
Also Published As
Publication number | Publication date |
---|---|
TW202141427A (en) | 2021-11-01 |
CN111526366A (en) | 2020-08-11 |
TWI825410B (en) | 2023-12-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR100547812B1 (en) | Apparatus and method for converting color model of pixel data using color reference table | |
KR102617258B1 (en) | Image processing method and apparatus | |
JP6502947B2 (en) | Method and device for tone mapping high dynamic range images | |
CN112087648B (en) | Image processing method, image processing device, electronic equipment and storage medium | |
US20180005358A1 (en) | A method and apparatus for inverse-tone mapping a picture | |
JP4949463B2 (en) | Upscaling | |
JP2017522794A (en) | Method and apparatus for signaling in a bitstream the picture / video format of an LDR picture and the picture / video format of a decoded HDR picture obtained from the LDR picture and the illumination picture | |
CN111885312A (en) | HDR image imaging method, system, electronic device and storage medium | |
WO2024027287A1 (en) | Image processing system and method, and computer-readable medium and electronic device | |
KR20200011000A (en) | Device and method for augmented reality preview and positional tracking | |
CN111738951B (en) | Image processing method and device | |
CN108471536B (en) | Alpha channel transmission method and device, terminal device and storage medium | |
CN111526366B (en) | Image processing method, image processing apparatus, image capturing device, and storage medium | |
WO2021073316A1 (en) | Image signal conversion method and apparatus, and terminal device | |
WO2016197323A1 (en) | Video encoding and decoding method, and video encoder/decoder | |
WO2021217428A1 (en) | Image processing method and apparatus, photographic device and storage medium | |
CN114788280A (en) | Video coding and decoding method and device | |
US8891894B2 (en) | Psychovisual image compression | |
CN108668169B (en) | Image information processing method and device, and storage medium | |
CN108668170B (en) | Image information processing method and device, and storage medium | |
US11582464B2 (en) | Using morphological operations to process frame masks in video content | |
WO2021169817A1 (en) | Video processing method and electronic device | |
CN116347089B (en) | JPEG image processing method and device, electronic equipment and storage medium | |
US11601665B2 (en) | Embedding frame masks in a video stream | |
CN112449187B (en) | Video decoding method, video encoding device, video encoding medium, and electronic apparatus |
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 |