CN111953977A - Image transmission method, system and device - Google Patents
Image transmission method, system and device Download PDFInfo
- Publication number
- CN111953977A CN111953977A CN202010660861.8A CN202010660861A CN111953977A CN 111953977 A CN111953977 A CN 111953977A CN 202010660861 A CN202010660861 A CN 202010660861A CN 111953977 A CN111953977 A CN 111953977A
- Authority
- CN
- China
- Prior art keywords
- image
- component
- gray
- neural network
- original
- 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.)
- Pending
Links
- 230000005540 biological transmission Effects 0.000 title claims abstract description 56
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000007906 compression Methods 0.000 claims abstract description 23
- 230000006835 compression Effects 0.000 claims abstract description 23
- 238000013528 artificial neural network Methods 0.000 claims description 116
- 230000006837 decompression Effects 0.000 claims description 21
- 238000006243 chemical reaction Methods 0.000 claims description 8
- 238000000638 solvent extraction Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 9
- 230000000903 blocking effect Effects 0.000 description 3
- 238000013500 data storage Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 239000003638 chemical reducing agent Substances 0.000 description 1
- 238000013144 data compression Methods 0.000 description 1
- 239000011159 matrix material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 230000010076 replication Effects 0.000 description 1
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/134—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
- H04N19/146—Data rate or code amount at the encoder output
-
- 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
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
The present disclosure provides an image transmission method, system and device, relating to the technical field of image processing, and capable of solving the problem of large data volume of code stream obtained by compressing an entire image. The specific technical scheme is as follows: the image transmission method provided by the embodiment of the disclosure comprises the following steps: collecting an original image in an RGB format, and converting the original image into a target image, wherein the color space of the target image is a YCbCr color space, Y is brightness, Cb is blue chroma, and Cr is red chroma; and removing the Cb component and the Cr component in the target image to obtain a gray-scale image, compressing the gray-scale image, and storing or sending the code stream obtained after compression to an image decoding end. The invention only compresses the Y component in the target image, and does not need to compress the whole original image, thereby greatly reducing the data volume of the transmission code stream.
Description
Technical Field
The present disclosure relates to the field of image processing, and in particular, to an image transmission method, system and apparatus.
Background
In the field of video transmission, since the number of transmitted images is large, the images need to be compressed to save the bandwidth required for transmission.
Most of the existing image compression schemes compress the whole image data, and the mode cannot reduce code streams to the maximum extent.
Disclosure of Invention
The embodiment of the disclosure provides an image transmission method, an image transmission system and an image transmission device, which can solve the problem of large data volume of a code stream obtained by compressing an overall image. The technical scheme is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided an image transmission method, which is applied to an image encoding end, the method including:
collecting an original image, wherein the original image is an image in an RGB format;
converting the original image into a target image, wherein the color space of the target image is an YCbCr color space, wherein Y is brightness, Cb is blue chroma, and Cr is red chroma;
removing a Cb component and a Cr component in the target image to obtain a gray-scale image;
and compressing the gray-scale image, and storing or sending a code stream obtained after compression to an image decoding end.
The image transmission method provided by the embodiment of the disclosure comprises the following steps: collecting an original image in an RGB format, converting the original image into a target image, wherein the color space of the target image is a YCbCr color space, Y is brightness, Cb is blue chroma, and Cr is red chroma; and removing the Cb component and the Cr component in the target image to obtain a gray-scale image, compressing the gray-scale image, and storing or sending the code stream obtained after compression to an image decoding end. Since only the Y component in the target image is compressed, the whole original image is not required to be compressed, and the transmission code stream can be greatly reduced.
In one embodiment, the converting the original image into the target image includes:
obtaining a Y component according to a first weight coefficient set and the R component, the G component and the B component of the image in the RGB format; the first set of weighting systems comprises: a weight coefficient of the first R component, a weight coefficient of the first G component, and a weight coefficient of the first B component;
obtaining the Cb component according to a second weight coefficient set, a first preset additional value and the R component, the G component and the B component of the RGB format image; the second set of weighting systems comprises: a weight coefficient of the second R component, a weight coefficient of the second G component, and a weight coefficient of the second B component;
obtaining the Cr component according to a third weight coefficient set, a second preset additional value and the R component, the G component and the B component of the RGB format image; the third set of weighting systems comprises: a weight coefficient of the third R component, a weight coefficient of the third G component, and a weight coefficient of the third B component.
According to a second aspect of the embodiments of the present disclosure, there is provided an image transmission method, which is applied to an image decoding end, the method including:
receiving a code stream, wherein the code stream comprises a gray scale image only with a Y component;
decompressing the code stream to obtain the gray-scale image;
inputting the gray-scale image into a pre-trained target neural network, and acquiring an original image corresponding to the gray-scale image through the target neural network, wherein the original image is an image in an RGB format;
and displaying the original image.
The image transmission method provided by the embodiment of the disclosure comprises the following steps: receiving a code stream, wherein the code stream comprises a gray scale image only with a Y component; decompressing the code stream to obtain a gray scale image; inputting the gray scale image into a pre-trained target neural network, and acquiring an original image corresponding to the gray scale image through the target neural network, wherein the original image is an image in an RGB format; the original image is displayed. The image coding segment only compresses the Y component in the target image, so that the code stream received by the image decoding end only comprises the gray-scale image of the Y component, and the data volume of the transmitted code stream can be reduced to a great extent because the transmitted code stream is not corresponding to the whole original image.
In one embodiment, before inputting the gray scale map into the pre-trained target neural network, the method further comprises:
and training the original neural network to obtain the target neural network.
In one embodiment, the training the original neural network to obtain the target neural network includes:
obtaining a sample set, wherein the sample set comprises a plurality of sample images in RGB format;
converting each RGB format sample image in the sample set into a training image, wherein the color space of the training image is a YCbCr color space;
removing Cb components and Cr components in each training image to obtain a training gray level image;
compressing each training gray scale image;
decompressing the compressed training gray-scale image to obtain a decompressed gray-scale image;
and training the original neural network through the sample images corresponding to the decompressed gray-scale image and the decompressed gray-scale image to obtain the target neural network.
In one embodiment, training the original neural network by the sample images corresponding to the decompressed grayscale map and the decompressed grayscale map to obtain the target neural network includes:
and partitioning the decompressed gray scale image and a sample image corresponding to the decompressed gray scale image according to a first preset rule to obtain a plurality of training sample sets, wherein each training sample set comprises: the block image in the decompressed gray scale map and the block image at the same position in the sample image corresponding to the decompressed gray scale map;
and training the original neural network according to each training sample set to obtain the target neural network.
In one embodiment, the training the original neural network according to each training sample set to obtain the target neural network includes:
taking the block image in the decompressed gray scale image in each training sample set as the input of the original neural network, and acquiring a corresponding network output result;
calculating the difference between the network output result and the block images at the same position in the sample image corresponding to the decompression gray scale map;
if the difference is larger than a preset error threshold, adjusting the original neural network parameters according to the difference, and re-executing the steps of obtaining the network output result and calculating the difference until the difference is smaller than the preset error threshold;
and if the difference is smaller than the preset error threshold, determining that the corresponding neural network is the target neural network when the difference is smaller than the preset error threshold.
According to a third aspect of embodiments of the present disclosure, there is provided an image transmission system including: the device comprises an image coding end and an image coding end;
the image coding end is used for collecting an original image, and the original image is an image in an RGB format;
the image coding end is used for converting the original image into a target image, and the color space of the target image is an YCbCr color space, wherein Y is brightness, Cb is blue chroma, and Cr is red chroma;
the image coding end is used for removing a Cb component and a Cr component in the target image to obtain a gray level image;
the image coding end is used for compressing the gray level image and storing or sending a code stream obtained after compression to the image decoding end;
the image decoding end is used for receiving a code stream, and the code stream comprises a gray image only with a Y component;
the image decoding end is used for decompressing the code stream to obtain the gray image;
the image decoding end is used for inputting the gray-scale image into a pre-trained target neural network and acquiring an original image corresponding to the gray-scale image through the target neural network, wherein the original image is an image in an RGB format;
and the image decoding end is used for displaying the original image.
In one embodiment of the present invention,
the image encoding end is used for obtaining a Y component according to a first weight coefficient set and an R component, a G component and a B component of the image in the RGB format; the first set of weighting systems comprises: a weight coefficient of the first R component, a weight coefficient of the first G component, and a weight coefficient of the first B component;
the image encoding end is configured to obtain the Cb component according to a second weight coefficient set, a first preset additional value, and the R component, the G component, and the B component of the RGB-format image; the second set of weighting systems comprises: a weight coefficient of the second R component, a weight coefficient of the second G component, and a weight coefficient of the second B component;
the image encoding end is configured to obtain the Cr component according to a third weight coefficient set, a second preset additional value, and the R component, the G component, and the B component of the RGB-format image; the third set of weighting systems comprises: a weight coefficient of the third R component, a weight coefficient of the third G component, and a weight coefficient of the third B component.
In one embodiment of the present invention,
and the image decoding end is used for training the original neural network to obtain the target neural network.
The image decoding end is used for obtaining a sample set, and the sample set comprises a plurality of sample images in RGB format;
the image decoding end is used for converting each sample image in the RGB format in the sample set into a training image, and the color space of the training image is a YCbCr color space;
the image decoding end is used for removing Cb components and Cr components in each training image to obtain a training gray level image;
the image decoding end is used for compressing each training gray level image;
the image decoding end is used for decompressing the compressed training gray-scale image to obtain a decompressed gray-scale image;
the image decoding end is used for training the original neural network through the sample images corresponding to the decompression gray level image and the decompression gray level image so as to obtain the target neural network.
In one embodiment of the present invention,
the image decoding end is configured to perform block processing on the decompressed grayscale map and a sample image corresponding to the decompressed grayscale map according to a first preset rule to obtain a plurality of training sample sets, where each training sample set includes: the block image in the decompressed gray scale map and the block image at the same position in the sample image corresponding to the decompressed gray scale map;
and training the original neural network according to each training sample set to obtain the target neural network.
In one embodiment of the present invention,
the image decoding end is configured to take the block image in the decompressed grayscale image in each of the training sample sets as an input of the original neural network, and obtain a corresponding network output result;
calculating the difference between the network output result and the block images at the same position in the sample image corresponding to the decompression gray scale map;
if the difference is larger than a preset error threshold, adjusting the original neural network parameters according to the difference, and re-executing the steps of obtaining the network output result and calculating the difference until the difference is smaller than the preset error threshold;
and if the difference is smaller than the preset error threshold, determining that the corresponding neural network is the target neural network when the difference is smaller than the preset error threshold.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an image transmission apparatus, which is applied to an image encoding side, the apparatus including:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring an original image, and the original image is an image in an RGB format;
the first conversion module is used for converting the original image into a target image, wherein the color space of the target image is an YCbCr color space, wherein Y is brightness, Cb is blue chroma, and Cr is red chroma;
the first image processing module is used for removing a Cb component and a Cr component in the target image to obtain a gray-scale image;
and the compression sending module is used for compressing the gray level image and storing or sending the code stream obtained after compression to an image decoding end.
In one embodiment, the conversion module comprises:
the Y component acquisition module is used for obtaining a Y component according to a first weight coefficient set and the R component, the G component and the B component of the RGB format image; the first set of weighting systems comprises: a weight coefficient of the first R component, a weight coefficient of the first G component, and a weight coefficient of the first B component;
a Cb component obtaining module, configured to obtain the Cb component according to a second weight coefficient set, a first preset additional value, and the R component, the G component, and the B component of the RGB format image; the second set of weighting systems comprises: a weight coefficient of the second R component, a weight coefficient of the second G component, and a weight coefficient of the second B component;
a Cr component obtaining module, configured to obtain a Cr component according to a third weight coefficient set, a second preset additional value, and the R component, the G component, and the B component of the RGB-format image; the third set of weighting systems comprises: a weight coefficient of the third R component, a weight coefficient of the third G component, and a weight coefficient of the third B component.
According to a fifth aspect of the embodiments of the present disclosure, there is provided an image transmission apparatus, which is applied to an image decoding side, the apparatus including:
the receiving module is used for receiving a code stream, and the code stream comprises a gray image only with a Y component;
the first decompression module is used for decompressing the code stream to obtain the gray-scale image;
the restoring module is used for inputting the gray level image into a pre-trained target neural network and acquiring an original image corresponding to the gray level image through the target neural network, wherein the original image is an image in an RGB format;
and the display module is used for displaying the original image.
In one embodiment, the apparatus further comprises:
and the acquisition module is used for training the original neural network to acquire the target neural network.
In one embodiment, the obtaining module comprises:
the acquisition submodule is used for acquiring a sample set, and the sample set comprises a plurality of sample images in an RGB format;
the conversion sub-module is used for converting each sample image in the RGB format in the sample set into a training image, and the color space of the training image is a YCbCr color space;
the image processing submodule is used for removing a Cb component and a Cr component in each training image to obtain a training gray level image;
the compression submodule is used for compressing each training gray scale image;
the decompression submodule is used for decompressing the compressed training gray-scale image to obtain a decompressed gray-scale image;
and the training submodule is used for training the original neural network through the sample image corresponding to the decompressed gray scale image and the decompressed gray scale image so as to obtain the target neural network.
In one embodiment, the decompression submodule comprises:
a blocking subunit, configured to block the decompressed grayscale map and a sample image corresponding to the decompressed grayscale map according to a first preset rule to obtain a plurality of training sample sets, where each of the training sample sets includes: the block image in the decompressed gray scale map and the block image at the same position in the sample image corresponding to the decompressed gray scale map;
and the training subunit is used for training the original neural network according to each training sample set so as to obtain the target neural network.
In one embodiment, the training subunit comprises:
the acquisition subunit is configured to use the block images in the decompressed grayscale image in each of the training sample sets as input of the original neural network, and acquire a corresponding network output result;
the calculating subunit is used for calculating the difference between the network output result and the block images at the same position in the sample image corresponding to the decompression gray scale map;
a correcting subunit, configured to, if the difference is greater than a preset error threshold, adjust the original neural network parameter according to the difference, and re-execute the steps of obtaining a network output result and calculating a difference until the difference is smaller than the preset error threshold;
and the determining subunit is configured to determine, if the difference is smaller than the preset error threshold, that the corresponding neural network is the target neural network when the difference is smaller than the preset error threshold.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flowchart of an image transmission method provided by an embodiment of the present disclosure;
fig. 2 is a flowchart of an image transmission method provided by an embodiment of the present disclosure;
FIG. 3 is a schematic structural diagram of a target neural network provided by an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an image transmission system provided in an embodiment of the present disclosure;
fig. 5 is a structural diagram of an image transmission apparatus provided in an embodiment of the present disclosure;
fig. 6 is a structural diagram of a first conversion module in an image transmission apparatus according to an embodiment of the disclosure;
fig. 7 is a structural diagram of an image transmission apparatus provided in an embodiment of the present disclosure;
fig. 8 is a structural diagram of an image transmission apparatus provided in an embodiment of the present disclosure;
fig. 9 is a structural diagram of an acquisition module in an image transmission apparatus according to an embodiment of the disclosure;
fig. 10 is a structural diagram of a decompression sub-module in an image transmission apparatus according to an embodiment of the disclosure;
fig. 11 is a structural diagram of a training subunit in an image transmission apparatus according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The embodiment of the present disclosure provides an image transmission method, as shown in fig. 1, where the method is applied to an image encoding end, and the image transmission method includes the following steps:
101. and collecting an original image, wherein the original image is an image in an RGB format.
The acquired image is an image in RGB format, i.e. a color picture.
102. And converting the original image into a target image, wherein the color space of the target image is a YCbCr color space, wherein Y is brightness, Cb is blue chroma, and Cr is red chroma.
Specifically, a Y component is obtained according to a first weight coefficient set and an R component, a G component and a B component of the image in the RGB format; the first set of weighting systems includes: a weight coefficient of the first R component, a weight coefficient of the first G component, and a weight coefficient of the first B component.
For example, the first set of weight coefficients is: 0.299, 0.578 and 0.114, wherein 0.299 is the weight coefficient of the first R component, 0.578 is the weight coefficient of the first G component, and 0.114 is the weight coefficient of the first B component, at this time, the Y component can be obtained by the following formula:
Y=0.299R+0.578G+0.114B;
wherein, R is the R component in the original image, G is the G component in the original image, and B is the B component in the original image.
Obtaining a Cb component according to the second weight coefficient set, the first preset additional value and the R component, the G component and the B component of the image in the RGB format; the second set of weighting systems includes: a weight coefficient of the second R component, a weight coefficient of the second G component, and a weight coefficient of the second B component.
For example, the second set of weight coefficients is: -0.172, -0.339 and 0.551, the first preset additional value being 128; where, -0.172 is the weight coefficient of the second R component, -0.339 is the weight coefficient of the second G component, and 0.551 is the weight coefficient of the second B component, then the Cb component can be obtained by the following formula:
Cb=-0.172R-0.339G+0.551B+128;
wherein, R is the R component in the original image, G is the G component in the original image, and B is the B component in the original image.
Obtaining a Cr component according to the third weight coefficient set, the second preset additional value and the R component, the G component and the B component of the image in the RGB format; the third set of weighting systems includes: a weight coefficient of the third R component, a weight coefficient of the third G component, and a weight coefficient of the third B component.
Illustratively, the third set of weight coefficients is: 0.511, -0.428 and-0.008, the second predetermined additional value being 128; where 0.511 is a weight coefficient of the third R component, -0.428 is a weight coefficient of the third G component, and-0.008 is a weight coefficient of the third B component, in this case, the Cr component may be obtained by the following formula:
Cr=0.511R-0.428G-0.008B+128;
wherein, R is the R component in the original image, G is the G component in the original image, and B is the B component in the original image.
103. And removing the Cb component and the Cr component in the target image to obtain a gray-scale image.
The Cb component and the Cr component are removed, and the original image becomes a gray scale image.
104. And compressing the gray level image, and storing or sending the code stream obtained after compression to an image decoding end.
And compressing the generated gray level image, and then storing the code stream obtained after compression or sending the code stream to an image decoding end through a network.
Specifically, the compression of the grayscale map may adopt an existing data compression processing method, which is not described herein again.
In the video image compression method in the image transmission method provided by the embodiment of the invention, only one component Y needs to be compressed and transmitted, and the CbCr component is reconstructed by carrying out color restoration after the Y component is decompressed at the receiving end, so that the code stream can be greatly reduced.
The image transmission method provided by the embodiment of the disclosure comprises the following steps: collecting an original image in an RGB format, converting the original image into a target image, wherein the color space of the target image is a YCbCr color space, Y is brightness, Cb is blue chroma, and Cr is red chroma; and removing the Cb component and the Cr component in the target image to obtain a gray-scale image, compressing the gray-scale image, and storing or sending the code stream obtained after compression to an image decoding end. The Y component in the target image is only compressed, and the whole original image is not required to be compressed, so that the data volume of the transmission code stream can be greatly reduced.
The embodiment of the present disclosure provides an image transmission method, as shown in fig. 2, where the method is applied to an image decoding end, and the image transmission method includes the following steps:
201. and receiving a code stream, wherein the code stream comprises a gray image only with a Y component.
Specifically, a code stream obtained by compressing a gray scale image at an image encoding end is obtained from a disk or a network.
202. And decompressing the code stream to obtain a gray scale image.
And decompressing the currently received code stream according to a decompression mode corresponding to the compression mode adopted by the image coding end, and obtaining a gray-scale image only containing Y components after decompression.
203. Inputting the gray-scale image into a pre-trained target neural network, and acquiring an original image corresponding to the gray-scale image through the target neural network, wherein the original image is an image in an RGB format.
Inputting the obtained gray-scale image into a pre-trained neural network (also called as a restorer), and restoring the gray-scale image into a color picture through the restorer; in this step, the obtained color picture is an original image, and then the original image can be output to a display terminal for displaying.
204. The original image is displayed.
The image transmission method provided by the embodiment of the disclosure comprises the following steps: receiving a code stream, wherein the code stream comprises a gray scale image only with a Y component; decompressing the code stream to obtain a gray scale image; inputting the gray scale image into a pre-trained target neural network, and acquiring an original image corresponding to the gray scale image through the target neural network, wherein the original image is an image in an RGB format; the original image is displayed. The image coding section only compresses the Y component in the target image, so that the code stream received by the image decoding end only comprises the gray-scale image of the Y component, and the transmitted code stream is not the code stream corresponding to the whole original image, so that the transmitted code stream can be greatly reduced.
In one embodiment, the step 203 further comprises the following sub-step a 1:
and A1, training the original neural network to obtain a target neural network.
In one embodiment, the step a1 includes the following sub-steps:
a11, acquiring a sample set, wherein the sample set comprises a plurality of sample images in RGB format.
And collecting sample images in an RGB format to form a sample set.
And A12, converting each sample image in the RGB format in the sample set into a training image, wherein the color space of the training image is a YCbCr color space.
And A13, removing the Cb component and the Cr component in each training image to obtain a training gray-scale map.
And A14, compressing each training gray scale image.
And A15, decompressing the compressed training gray-scale image to obtain a decompressed gray-scale image.
And A16, training the original neural network through the decompressed gray-scale image and the sample image corresponding to the decompressed gray-scale image to obtain the target neural network.
In one embodiment, the above step A16 includes the following sub-steps B1-B2:
in B1, block processing is performed on the sample image corresponding to the decompressed grayscale image and the decompressed grayscale image according to a first preset rule to obtain a plurality of training samples, where each training sample includes: and decompressing the block image in the gray-scale image and decompressing the block image at the same position in the sample image corresponding to the gray-scale image.
And partitioning the decompressed gray-scale image and the original image (sample image in RGB format) according to the same first preset rule to form a training sample set.
Wherein the training sample set comprises a plurality of training samples, each of which is represented as (Ai, Bi), wherein Ai represents a block image in a decompressed gray scale image, i.e. input data; bi represents a block image, i.e., an object, at the same position in the sample image corresponding to the decompressed grayscale image.
In B2, the original neural network is trained according to each training sample set to obtain the target neural network.
In one embodiment, the step B2 includes the following sub-steps C21-C24:
c21, taking the block image in the decompression gray scale image in each training sample set as the input of the original neural network, and obtaining the corresponding network output result;
c22, calculating the difference between the network output result and the block image at the same position in the sample image corresponding to the decompression gray map;
c23, if the difference is larger than the preset error threshold, adjusting the original neural network parameters according to the difference, and re-executing the steps of obtaining the network output result and calculating the difference until the difference is smaller than the preset error threshold;
and C24, if the difference is smaller than the preset error threshold, determining the corresponding neural network as the target neural network when the difference is smaller than the preset error threshold.
Specifically, the gray level image after being partitioned is used as the input of an original neural network, and the network output result is calculated; calculating the difference between the network output result and the actual value (target), adjusting the parameters (weight) of the original neural network according to the obtained difference, and continuously repeating the steps for continuous iteration until the difference between the network output result and the actual value is smaller than a preset error threshold.
The finally obtained neural network is used as a pre-trained target neural network used in the invention and is used for restoring the gray level image at an image decoding end.
A target neural network structure that can achieve color reduction is shown in fig. 3, where we refer to the trained neural network as: and a reducer.
Wherein, InputLayer represents the input of the target neural network; conv2D represents a two-dimensional convolution; RepeatVector indicates replication; reshape denotes the keep-before input; concatenate represents a merge matrix; UpSampling2D represents two-dimensional UpSampling. The implementation manner of each step in the neural network structure in fig. 3 is similar to that in the related art, and is not described here again.
An embodiment of the present disclosure provides an image transmission system, as shown in fig. 4, the system including: the device comprises an image coding end and an image coding end;
the image coding end is used for collecting an original image, and the original image is an image in an RGB format;
the image coding end is used for converting the original image into a target image, and the color space of the target image is an YCbCr color space, wherein Y is brightness, Cb is blue chroma, and Cr is red chroma;
the image coding end is used for removing a Cb component and a Cr component in the target image to obtain a gray level image;
the image coding end is used for compressing the gray level image and storing or sending a code stream obtained after compression to the image decoding end;
the image decoding end is used for receiving a code stream, and the code stream comprises a gray image only with a Y component;
the image decoding end is used for decompressing the code stream to obtain the gray image;
the image decoding end is used for inputting the gray-scale image into a pre-trained target neural network and acquiring an original image corresponding to the gray-scale image through the target neural network, wherein the original image is an image in an RGB format;
and the image decoding end is used for displaying the original image.
In one embodiment of the present invention,
the image encoding end is used for obtaining a Y component according to a first weight coefficient set and an R component, a G component and a B component of the image in the RGB format; the first set of weighting systems comprises: a weight coefficient of the first R component, a weight coefficient of the first G component, and a weight coefficient of the first B component;
the image encoding end is configured to obtain the Cb component according to a second weight coefficient set, a first preset additional value, and the R component, the G component, and the B component of the RGB-format image; the second set of weighting systems comprises: a weight coefficient of the second R component, a weight coefficient of the second G component, and a weight coefficient of the second B component;
the image encoding end is configured to obtain the Cr component according to a third weight coefficient set, a second preset additional value, and the R component, the G component, and the B component of the RGB-format image; the third set of weighting systems comprises: a weight coefficient of the third R component, a weight coefficient of the third G component, and a weight coefficient of the third B component.
In one embodiment of the present invention,
and the image decoding end is used for training the original neural network to obtain the target neural network.
The image decoding end is used for obtaining a sample set, and the sample set comprises a plurality of sample images in RGB format;
the image decoding end is used for converting each sample image in the RGB format in the sample set into a training image, and the color space of the training image is a YCbCr color space;
the image decoding end is used for removing Cb components and Cr components in each training image to obtain a training gray level image;
the image decoding end is used for compressing each training gray level image;
the image decoding end is used for decompressing the compressed training gray-scale image to obtain a decompressed gray-scale image;
the image decoding end is used for training the original neural network through the sample images corresponding to the decompression gray level image and the decompression gray level image so as to obtain the target neural network.
In one embodiment of the present invention,
the image decoding end is configured to perform block processing on the decompressed grayscale map and a sample image corresponding to the decompressed grayscale map according to a first preset rule to obtain a plurality of training sample sets, where each training sample set includes: the block image in the decompressed gray scale map and the block image at the same position in the sample image corresponding to the decompressed gray scale map;
and training the original neural network according to each training sample set to obtain the target neural network.
In one embodiment of the present invention,
the image decoding end is configured to take the block image in the decompressed grayscale image in each of the training sample sets as an input of the original neural network, and obtain a corresponding network output result;
calculating the difference between the network output result and the block images at the same position in the sample image corresponding to the decompression gray scale map;
if the difference is larger than a preset error threshold, adjusting the original neural network parameters according to the difference, and re-executing the steps of obtaining the network output result and calculating the difference until the difference is smaller than the preset error threshold;
and if the difference is smaller than the preset error threshold, determining that the corresponding neural network is the target neural network when the difference is smaller than the preset error threshold.
Based on the image transmission method described in the embodiment corresponding to fig. 1, the following is an embodiment of the apparatus of the present disclosure, which can be used to execute an embodiment of the method of the present disclosure.
An embodiment of the present disclosure provides an image transmission apparatus, as shown in fig. 5, the apparatus is applied to an image encoding end, and the apparatus includes:
the system comprises an acquisition module 11, a processing module and a display module, wherein the acquisition module is used for acquiring an original image, and the original image is an image in an RGB format;
a first conversion module 12, configured to convert the original image into a target image, where a color space of the target image is a YCbCr color space, where Y is luminance, Cb is blue chrominance, and Cr is red chrominance;
a first image processing module 13, configured to remove a Cb component and a Cr component in the target image to obtain a grayscale image;
and the compression sending module 14 is used for compressing the grayscale image and storing or sending the code stream obtained after compression to an image decoding end.
In one embodiment, as shown in fig. 6, the first conversion module 12 includes:
a Y component obtaining module 121, configured to obtain a Y component according to the first weight coefficient set and the R component, the G component, and the B component of the RGB-format image; the first set of weighting systems comprises: a weight coefficient of the first R component, a weight coefficient of the first G component, and a weight coefficient of the first B component;
a Cb component obtaining module 122, configured to obtain the Cb component according to a second weight coefficient set, a first preset additional value, and the R component, the G component, and the B component of the RGB format image; the second set of weighting systems comprises: a weight coefficient of the second R component, a weight coefficient of the second G component, and a weight coefficient of the second B component;
a Cr component obtaining module 123, configured to obtain a Cr component according to a third weight coefficient set, a second preset additional value, and the R component, the G component, and the B component of the RGB-format image; the third set of weighting systems comprises: a weight coefficient of the third R component, a weight coefficient of the third G component, and a weight coefficient of the third B component.
Based on the image transmission method described in the embodiment corresponding to fig. 2, the following is an embodiment of the apparatus of the present disclosure, which can be used to execute an embodiment of the method of the present disclosure.
An embodiment of the present disclosure provides an image transmission apparatus, as shown in fig. 7, the apparatus is applied to an image decoding end, and the apparatus includes:
the receiving module 21 is configured to receive a code stream, where the code stream includes a grayscale map with only Y component;
the first decompression module 22 is configured to decompress the code stream to obtain the grayscale map;
the restoring module 23 is configured to input the grayscale image into a pre-trained target neural network, and obtain an original image corresponding to the grayscale image through the target neural network, where the original image is an image in an RGB format;
and a display module 24, configured to display the original image.
In one embodiment, as shown in fig. 8, the apparatus further comprises:
and an obtaining module 25, configured to train the original neural network to obtain the target neural network.
In one embodiment, as shown in fig. 9, the obtaining module 25 includes:
an obtaining sub-module 251, configured to obtain a sample set, where the sample set includes a plurality of sample images in RGB format;
a conversion sub-module 252, configured to convert each sample image in RGB format in the sample set into a training image, where a color space of the training image is a YCbCr color space;
an image processing sub-module 253, configured to remove a Cb component and a Cr component from each training image to obtain a training grayscale image;
a compression sub-module 254, configured to perform compression processing on each of the training grayscale images;
the decompression submodule 255 is configured to decompress the compressed training grayscale image to obtain a decompressed grayscale image;
the training submodule 256 is configured to train the original neural network through the sample image corresponding to the decompressed grayscale map and the decompressed grayscale map to obtain the target neural network.
In one embodiment, as shown in fig. 10, the decompression sub-module 255 includes:
a blocking subunit 2551, configured to perform blocking processing on the decompressed grayscale map and a sample image corresponding to the decompressed grayscale map according to a first preset rule, so as to obtain a plurality of training sample sets, where each of the training sample sets includes: the block image in the decompressed gray scale map and the block image at the same position in the sample image corresponding to the decompressed gray scale map;
a training subunit 2552, configured to train the original neural network according to each of the training sample sets to obtain the target neural network.
In one embodiment, as shown in fig. 11, the training subunit 2552 includes:
an obtaining subunit 25521, configured to use the block images in the decompressed grayscale image in each of the training sample sets as inputs of the original neural network, and obtain a corresponding network output result;
a computing subunit 25522, configured to compute a difference between the network output result and a block image at the same position in the sample image corresponding to the decompressed grayscale map;
a modifying subunit 25523, configured to, if the difference is greater than a preset error threshold, adjust the original neural network parameter according to the difference, and re-execute the steps of obtaining a network output result and calculating a difference until the difference is smaller than the preset error threshold;
a determining subunit 25524, configured to determine, if the difference is smaller than the preset error threshold, that the corresponding neural network is the target neural network when the difference is smaller than the preset error threshold.
Based on the image transmission method described in the embodiment corresponding to fig. 1, an embodiment of the present disclosure further provides a computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a Read Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The storage medium stores computer instructions for executing the data transmission method described in the embodiment corresponding to fig. 1, which is not described herein again.
Based on the image transmission method described in the embodiment corresponding to fig. 2, an embodiment of the present disclosure further provides a computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a Read Only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The storage medium stores computer instructions for executing the data transmission method described in the embodiment corresponding to fig. 2, which is not described herein again.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims (10)
1. An image transmission method is applied to an image coding end, and the method comprises the following steps:
collecting an original image, wherein the original image is an image in an RGB format;
converting the original image into a target image, wherein the color space of the target image is an YCbCr color space, wherein Y is brightness, Cb is blue chroma, and Cr is red chroma;
removing a Cb component and a Cr component in the target image to obtain a gray-scale image;
and compressing the gray-scale image, and storing or sending a code stream obtained after compression to an image decoding end.
2. The image transmission method according to claim 1, wherein the converting the original image into the target image includes:
obtaining a Y component according to a first weight coefficient set and the R component, the G component and the B component of the image in the RGB format; the first set of weighting systems comprises: a weight coefficient of the first R component, a weight coefficient of the first G component, and a weight coefficient of the first B component;
obtaining the Cb component according to a second weight coefficient set, a first preset additional value and the R component, the G component and the B component of the RGB format image; the second set of weighting systems comprises: a weight coefficient of the second R component, a weight coefficient of the second G component, and a weight coefficient of the second B component;
obtaining the Cr component according to a third weight coefficient set, a second preset additional value and the R component, the G component and the B component of the RGB format image; the third set of weighting systems comprises: a weight coefficient of the third R component, a weight coefficient of the third G component, and a weight coefficient of the third B component.
3. An image transmission method, applied to an image decoding end, the method comprising:
receiving a code stream, wherein the code stream comprises a gray scale image only with a Y component;
decompressing the code stream to obtain the gray-scale image;
inputting the gray-scale image into a pre-trained target neural network, and acquiring an original image corresponding to the gray-scale image through the target neural network, wherein the original image is an image in an RGB format;
and displaying the original image.
4. The image transmission method according to claim 3, wherein before inputting the gray-scale map into a pre-trained target neural network, the method further comprises:
and training the original neural network to obtain the target neural network.
5. The image transmission method according to claim 4, wherein the training of the original neural network to obtain the target neural network comprises:
obtaining a sample set, wherein the sample set comprises a plurality of sample images in RGB format;
converting each RGB format sample image in the sample set into a training image, wherein the color space of the training image is a YCbCr color space;
removing Cb components and Cr components in each training image to obtain a training gray level image;
compressing each training gray scale image;
decompressing the compressed training gray-scale image to obtain a decompressed gray-scale image;
and training the original neural network through the sample images corresponding to the decompressed gray-scale image and the decompressed gray-scale image to obtain the target neural network.
6. The image transmission method according to claim 5, wherein training the original neural network by the sample images corresponding to the decompressed grayscale map and the decompressed grayscale map to obtain the target neural network comprises:
and partitioning the decompressed gray scale image and a sample image corresponding to the decompressed gray scale image according to a first preset rule to obtain a plurality of training sample sets, wherein each training sample set comprises: the block image in the decompressed gray scale map and the block image at the same position in the sample image corresponding to the decompressed gray scale map;
and training the original neural network according to each training sample set to obtain the target neural network.
7. The image transmission method according to claim 6, wherein the training the original neural network according to each of the training sample sets to obtain the target neural network comprises:
taking the block image in the decompressed gray scale image in each training sample set as the input of the original neural network, and acquiring a corresponding network output result;
calculating the difference between the network output result and the block images at the same position in the sample image corresponding to the decompression gray scale map;
if the difference is larger than a preset error threshold, adjusting the original neural network parameters according to the difference, and re-executing the steps of obtaining the network output result and calculating the difference until the difference is smaller than the preset error threshold;
and if the difference is smaller than the preset error threshold, determining that the corresponding neural network is the target neural network when the difference is smaller than the preset error threshold.
8. An image transmission system, comprising: the device comprises an image coding end and an image coding end;
the image coding end is used for collecting an original image, and the original image is an image in an RGB format;
the image coding end is used for converting the original image into a target image, and the color space of the target image is an YCbCr color space, wherein Y is brightness, Cb is blue chroma, and Cr is red chroma;
the image coding end is used for removing a Cb component and a Cr component in the target image to obtain a gray level image;
the image coding end is used for compressing the gray level image and storing or sending a code stream obtained after compression to the image decoding end;
the image decoding end is used for receiving a code stream, and the code stream comprises a gray image only with a Y component;
the image decoding end is used for decompressing the code stream to obtain the gray image;
the image decoding end is used for inputting the gray-scale image into a pre-trained target neural network and acquiring an original image corresponding to the gray-scale image through the target neural network, wherein the original image is an image in an RGB format;
and the image decoding end is used for displaying the original image.
9. An image transmission apparatus, applied to an image encoding side, the apparatus comprising:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring an original image, and the original image is an image in an RGB format;
the first conversion module is used for converting the original image into a target image, wherein the color space of the target image is an YCbCr color space, wherein Y is brightness, Cb is blue chroma, and Cr is red chroma;
the first image processing module is used for removing a Cb component and a Cr component in the target image to obtain a gray-scale image;
and the compression sending module is used for compressing the gray level image and storing or sending the code stream obtained after compression to an image decoding end.
10. An image transmission apparatus, applied to an image decoding side, the apparatus comprising:
the receiving module is used for receiving a code stream, and the code stream comprises a gray image only with a Y component;
the first decompression module is used for decompressing the code stream to obtain the gray-scale image;
the restoring module is used for inputting the gray level image into a pre-trained target neural network and acquiring an original image corresponding to the gray level image through the target neural network, wherein the original image is an image in an RGB format;
and the display module is used for displaying the original image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010660861.8A CN111953977A (en) | 2020-07-09 | 2020-07-09 | Image transmission method, system and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010660861.8A CN111953977A (en) | 2020-07-09 | 2020-07-09 | Image transmission method, system and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111953977A true CN111953977A (en) | 2020-11-17 |
Family
ID=73341424
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010660861.8A Pending CN111953977A (en) | 2020-07-09 | 2020-07-09 | Image transmission method, system and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111953977A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112887293A (en) * | 2021-01-21 | 2021-06-01 | 维沃移动通信有限公司 | Streaming media processing method and device and electronic equipment |
CN115150370A (en) * | 2022-07-05 | 2022-10-04 | 广东魅视科技股份有限公司 | Image processing method |
CN117014557A (en) * | 2023-10-07 | 2023-11-07 | 福昕鲲鹏(北京)信息科技有限公司 | Compression method and device for document image, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104780374A (en) * | 2015-03-23 | 2015-07-15 | 中国科学技术大学先进技术研究院 | Luminance-coding-based frame buffer destructive compression method and device |
CN106709880A (en) * | 2016-12-08 | 2017-05-24 | 彭志勇 | Grayscale image saving method and grayscale image original pixel acquisition method |
CN109741281A (en) * | 2019-01-04 | 2019-05-10 | Oppo广东移动通信有限公司 | Image processing method, device, storage medium and terminal |
CN110276731A (en) * | 2019-06-17 | 2019-09-24 | 艾瑞迈迪科技石家庄有限公司 | Endoscopic image color restoring method and device |
CN110602491A (en) * | 2019-08-30 | 2019-12-20 | 中国科学院深圳先进技术研究院 | Intra-frame chroma prediction method, device and equipment and video coding and decoding system |
-
2020
- 2020-07-09 CN CN202010660861.8A patent/CN111953977A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104780374A (en) * | 2015-03-23 | 2015-07-15 | 中国科学技术大学先进技术研究院 | Luminance-coding-based frame buffer destructive compression method and device |
CN106709880A (en) * | 2016-12-08 | 2017-05-24 | 彭志勇 | Grayscale image saving method and grayscale image original pixel acquisition method |
CN109741281A (en) * | 2019-01-04 | 2019-05-10 | Oppo广东移动通信有限公司 | Image processing method, device, storage medium and terminal |
CN110276731A (en) * | 2019-06-17 | 2019-09-24 | 艾瑞迈迪科技石家庄有限公司 | Endoscopic image color restoring method and device |
CN110602491A (en) * | 2019-08-30 | 2019-12-20 | 中国科学院深圳先进技术研究院 | Intra-frame chroma prediction method, device and equipment and video coding and decoding system |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112887293A (en) * | 2021-01-21 | 2021-06-01 | 维沃移动通信有限公司 | Streaming media processing method and device and electronic equipment |
CN115150370A (en) * | 2022-07-05 | 2022-10-04 | 广东魅视科技股份有限公司 | Image processing method |
CN117014557A (en) * | 2023-10-07 | 2023-11-07 | 福昕鲲鹏(北京)信息科技有限公司 | Compression method and device for document image, electronic equipment and storage medium |
CN117014557B (en) * | 2023-10-07 | 2024-01-23 | 福昕鲲鹏(北京)信息科技有限公司 | Compression method and device for document image, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10165297B2 (en) | High dynamic range codecs | |
CN111953977A (en) | Image transmission method, system and device | |
CN108141505B (en) | Compression and decompression method for high bit depth medical gray level image | |
US7738697B2 (en) | Color transformation method and apparatus with minimized transformation errors | |
US5675666A (en) | Image data compression method and apparatus with pre-processing to compensate for the blocky effect | |
US8780996B2 (en) | System and method for encoding and decoding video data | |
JPH07236140A (en) | Noise reducing device for encoding moving image | |
US7536054B2 (en) | Image compression device, image compression method, image compression program, compression encoding method, compression encoding device, compression encoding program, decoding method, decoding device, and decoding program | |
CN111429357B (en) | Training data determining method, video processing method, device, equipment and medium | |
CN111510739B (en) | Video transmission method and device | |
US20220272384A1 (en) | Image compression | |
CN111738951B (en) | Image processing method and device | |
EP1571852A2 (en) | Image coding and decoding with spatial subsampling | |
JP4293912B2 (en) | Data compression of color images using wavelet transform | |
US7146055B2 (en) | Image processing decompression apparatus and method of using same different scaling algorithms simultaneously | |
US20110299790A1 (en) | Image compression method with variable quantization parameter | |
CN114693818A (en) | Compression method suitable for digital ortho image data | |
JP2001501406A (en) | Method and apparatus for vector and inverse vector quantization of digital images | |
CN115150370B (en) | Image processing method | |
JP4037336B2 (en) | Image processing apparatus and method, and program | |
US6208754B1 (en) | Image compression and expansion device using pixel offset | |
JP4037318B2 (en) | Image processing apparatus and method, and program | |
WO2022088101A1 (en) | Encoding method, decoding method, encoder, decoder and storage medium | |
CN118138770A (en) | Video processing method, device, electronic equipment and storage medium | |
CN116309049A (en) | Image processing method and device and electronic equipment |
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 |