CN111738266A - Image transmission method and device, electronic equipment and storage medium - Google Patents

Image transmission method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111738266A
CN111738266A CN202010471554.5A CN202010471554A CN111738266A CN 111738266 A CN111738266 A CN 111738266A CN 202010471554 A CN202010471554 A CN 202010471554A CN 111738266 A CN111738266 A CN 111738266A
Authority
CN
China
Prior art keywords
data
yuv
escape
target
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
CN202010471554.5A
Other languages
Chinese (zh)
Inventor
张辉
吴睿振
沈欣舞
刘文涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202010471554.5A priority Critical patent/CN111738266A/en
Publication of CN111738266A publication Critical patent/CN111738266A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/153Segmentation of character regions using recognition of characters or words
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The application discloses an image transmission method, an image transmission device, an electronic device and a computer readable storage medium, wherein the method comprises the following steps: determining YUV data corresponding to a target image, and determining attribute information of the target image; the attribute information comprises a secondary sampling rule, a representation mode, an arrangement mode, the data length of each component and the size of a target image of YUV chroma; generating YUV attribute data corresponding to the target image based on the attribute information; and combining the YUV attribute data and the YUV data into target data, and completing the transmission of the target image by transmitting the target data. According to the image transmission method, the YUV attribute data is introduced on the basis of the YUV data, so that the problem that engineering personnel cannot acquire the YUV attribute data through other channels in time when obtaining the YUV data or cannot correctly identify and process the YUV data under the condition that the YUV attribute data is wrong is solved.

Description

Image transmission method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to an image transmission method and apparatus, an electronic device, and a computer-readable storage medium.
Background
YUV is a color coding system, mainly used in video and graphics processing to express the content of images. Each pixel point of an image can be represented by Y, U and V, Y represents brightness, and U and V jointly represent chroma, so that an image can be represented as Y1U1V1Y2U2V2…YnUnVnSubscripts 1, 2, …, n denote the 1 st to nth pixel points.
In order to facilitate coding transmission and reduce bandwidth occupation, the method that human vision is relatively sensitive to brightness and relatively insensitive to position and chromaticity is used for optimizing YUV, a part of chromaticity information is omitted, and a plurality of pixel points share one chromaticity value is called YUV chromaticity secondary sampling.
In practical applications, the YUV representation of images has two different forms, namely a compact format and a planar format. Besides the difference of formats, the YUV precedence order can also be different. Therefore, the representation forms of the YUV data have a plurality of different formats, and when an engineer receives a YUV data, the engineer must acquire a plurality of information to correctly identify and process the YUV data.
Therefore, how to transmit the correct YUV data is a technical problem to be solved by those skilled in the art.
Disclosure of Invention
The application aims to provide an image transmission method, an image transmission device, electronic equipment and a computer readable storage medium, and correct YUV data are transmitted.
To achieve the above object, the present application provides an image transmission method, including:
determining YUV data corresponding to a target image, and determining attribute information of the target image; the attribute information comprises a secondary sampling rule of YUV chroma, a representation mode, an arrangement mode, the data length of each component and the size of the target image;
generating YUV attribute data corresponding to the target image based on the attribute information;
and combining the YUV attribute data and the YUV data into target data, and completing the transmission of the target image by transmitting the target data.
The YUV attribute data comprises ten bytes, a first byte and a second byte are used for describing the subsampling rule, a third byte is used for describing the representation mode, a fourth byte is used for describing the arrangement mode, a fifth byte and a sixth byte are used for describing the data length of each component, and a seventh byte to a cross section are used for describing the size of the target image.
Wherein the completing the transmission of the target image by transmitting the target data comprises:
determining a starting identification character and an escape character; wherein the start identifier is a start flag of the target image;
escaping the identification characters in the target data into a first escape field, and escaping the escape characters in the target data into a second escape field; wherein the escape character is a start flag of the first escape field and the second escape field;
and combining the initial identifier and the escaped target data into YUV extended data, and completing the transmission of the target image by transmitting the YUV extended data.
Wherein, if the start identification character is 0x7E and the escape character is 0x7D, escaping the identification character in the target data as a first escape field and escaping the escape character in the target data as a second escape field comprises:
escape 0x7E in the target data to 0x7D5E, escape 0x7D in the target data to 0x7D 5D.
To achieve the above object, the present application provides an image transmission apparatus comprising:
the determining module is used for determining YUV data corresponding to a target image and determining attribute information of the target image; the attribute information comprises a secondary sampling rule of YUV chroma, a representation mode, an arrangement mode, the data length of each component and the size of the target image;
a generating module, configured to generate YUV attribute data corresponding to the target image based on the attribute information;
and the transmission module is used for combining the YUV attribute data and the YUV data into target data and completing the transmission of the target image by transmitting the target data.
The YUV attribute data comprises ten bytes, a first byte and a second byte are used for describing the subsampling rule, a third byte is used for describing the representation mode, a fourth byte is used for describing the arrangement mode, a fifth byte and a sixth byte are used for describing the data length of each component, and a seventh byte to a cross section are used for describing the size of the target image.
Wherein the transmission module comprises:
a combination unit, configured to combine the YUV attribute data and the YUV data into target data;
a determination unit for determining a start identification character and an escape character; wherein the start identifier is a start flag of the target image;
an escape unit, configured to escape the identification character in the target data into a first escape field, and escape the escape character in the target data into a second escape field; wherein the escape character is a start flag of the first escape field and the second escape field;
and the transmission unit is used for combining the initial identifier and the escaped target data into YUV extended data and completing the transmission of the target image by transmitting the YUV extended data.
If the start identifier character is 0x7E and the escape character is 0x7D, the escape unit is specifically a unit that escapes 0x7E in the target data to 0x7D5E and escapes 0x7D in the target data to 0x7D 5D.
To achieve the above object, the present application provides an electronic device including:
a memory for storing a computer program;
a processor for implementing the steps of the image transmission method as described above when executing the computer program.
To achieve the above object, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the image transmission method as described above.
According to the scheme, the image transmission method provided by the application comprises the following steps: determining YUV data corresponding to a target image, and determining attribute information of the target image; the attribute information comprises a secondary sampling rule of YUV chroma, a representation mode, an arrangement mode, the data length of each component and the size of the target image; generating YUV attribute data corresponding to the target image based on the attribute information; and combining the YUV attribute data and the YUV data into target data, and completing the transmission of the target image by transmitting the target data.
According to the image transmission method, the YUV attribute data is introduced on the basis of the YUV data, the secondary sampling rule, the representation mode and the arrangement mode of YUV chromaticity of the target image, the data length of each component and the size of the target image can be identified, the YUV data and the YUV attribute data can be stored and transmitted simultaneously, and the problem that engineering personnel cannot acquire the YUV attribute data through other channels in time when obtaining the YUV data or cannot correctly identify and process the YUV data under the condition that the YUV attribute data is wrong is solved. The application also discloses an image transmission device, an electronic device and a computer readable storage medium, which can also realize the technical effects.
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 application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a flow chart illustrating an image transmission method according to an exemplary embodiment;
FIG. 2 is a flow diagram illustrating another method of image transmission according to an exemplary embodiment;
FIG. 3 is a block diagram illustrating an image transmission apparatus according to an exemplary embodiment;
FIG. 4 is a block diagram illustrating an electronic device in accordance with an exemplary embodiment.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application discloses an image transmission method, which is used for transmitting correct YUV data.
Referring to fig. 1, a flowchart of an image transmission method according to an exemplary embodiment is shown, as shown in fig. 1, including:
s101: determining YUV data corresponding to a target image, and determining attribute information of the target image; the attribute information comprises a secondary sampling rule of YUV chroma, a representation mode, an arrangement mode, the data length of each component and the size of the target image;
the execution subject of the embodiment is a sender of the target image, and the purpose is to transmit the target image to a receiver, that is, to transmit YUV data of the target image. In the specific implementation, in order to facilitate the receiver to correctly identify and process the YUV data of the target image, the attribute information of the target image, that is, the subsampling rule, the representation mode, the arrangement mode, the data length of each component and the size of the target image, needs to be transmitted simultaneously.
S102: generating YUV attribute data corresponding to the target image based on the attribute information;
in this step, YUV attribute data for identifying attribute information of the target image is generated in accordance with a predefined format. Preferably, the YUV attribute data includes ten bytes, the first byte and the second byte are used to describe the subsampling rule, the third byte is used to describe the representation, the fourth byte is used to describe the arrangement, the fifth byte and the sixth byte are used to describe the data length of each component, and the seventh byte to the cross section are used to describe the size of the target image.
The YUV attribute data is shown in table 1:
TABLE 1
Figure BDA0002514448430000051
First to two bytes, hold YUV chroma subsampling rules, expressed in hexadecimal numbers, support all subsampling rules, e.g. 0x0422, and possibly other extensions. The values in this field are defined, where the first number in 0422 is 0 since the supported chroma sampling rule is limited, and the first number is unused, and the second to four numbers represent the number of samples in the YUV chroma subsampling rule, for example, 0x0422 represents that every four pixels are sampled 4 times Y and sampled 2 times UV, and the next row of pixels are also sampled 2 times UV. There are many different types of YUV chroma subsampling rules, typically YUV444, YUV422, YUV420, YUV411, etc., and the values corresponding to this field are 0x0444, 0x0422, 0x0420 and 0x0411, respectively.
A third byte for storing a packed format or flatA face format, an expression form such as 0x01 or other isomorphic expression. The value in this field is defined, 0x00 indicates a compact format, i.e. Y, U and V components are stored interleaved one after the other, e.g. Y1U1V1Y2U2V2…YnUnVn(ii) a 0x01 denotes a flat format, i.e. Y, U and V components are stored in sequential grouped arrangement, e.g. Y1Y2…YnU1U2…UnV1V2…Vn. In addition to the above two formats, other formats not described in the present design may be represented by using numerical definitions 0x2, 0x3, and the like in sequence.
And the fourth byte, the U is stored and then the V or the V is stored and then the U is stored, and the expression form is 0x01 or other isomorphic expressions. The numerical value in this field is defined, 0x00 represents that U is first followed by V, namely the YUV data stores the U component first and then the V component; 0x01 indicates that V is first and then U, i.e. the YUV data stores the V component first and then the U component.
And the fifth byte to the sixth byte, wherein each component is stored and is represented by a number of bits, and the representation form is represented by 0x0888 and other similar forms. The values in this field define, where the first number in 0888 is not used and always 0, the second to four numbers, which in turn represent Y, U and how many bits of the V component are represented by the number, respectively. In engineering applications, it is common to express the value of a certain component by 6 bits, 8 bits or 10 bits, and assuming that 10 bits express the Y component, 8 bits express the U component, and 6 bits express the V component, the value corresponding to this field should be 0x0a86, where hexadecimal a is equal to 10 decimal.
Seventh to the cross section, the image size parameter is saved, and the expression form is expressed by 0x050003C0 and other similar forms. The numerical values in this field define, first to four numbers, which together represent the length of the number of pixels in the image size parameter, and fifth to eight numbers, which together represent the width of the number of pixels in the image size parameter. Assuming that the size parameter of an image is 1280x960, the length and width of the hexadecimal number are 0x0500 and 0x03C0, respectively, and the value of the corresponding field is 0x050003C 0.
S103: and combining the YUV attribute data and the YUV data into target data, and completing the transmission of the target image by transmitting the target data.
In this step, the YUV attribute data and the YUV data are combined and transmitted, so that the transmission of the target image is completed. Preferably, the YUV attribute data may be stored before the start of the YUV data in the form of: YUV attribute data + YUV data.
According to the image transmission method provided by the embodiment of the application, the YUV attribute data is introduced on the basis of the YUV data, the secondary sampling rule, the representation mode and the arrangement mode of the YUV chromaticity of the target image, the data length of each component and the size of the target image can be identified, the YUV data and the YUV attribute data can be stored and transmitted simultaneously, and the problem that engineering personnel cannot acquire the YUV attribute data through other channels in time when obtaining the YUV data or cannot correctly identify and process the YUV data under the condition that the YUV attribute data is wrong is avoided.
The embodiment of the application discloses an image transmission method, and compared with the previous embodiment, the embodiment further explains and optimizes the technical scheme. Specifically, the method comprises the following steps:
referring to fig. 2, a flowchart of another image transmission method according to an exemplary embodiment is shown, as shown in fig. 2, including:
s201: determining YUV data corresponding to a target image, and determining attribute information of the target image; the attribute information comprises a secondary sampling rule of YUV chroma, a representation mode, an arrangement mode, the data length of each component and the size of the target image;
s202: generating YUV attribute data corresponding to the target image based on the attribute information;
s203: combining the YUV attribute data and the YUV data into target data, and determining an initial identification character and an escape character; wherein the start identifier is a start flag of the target image;
s204: escaping the identification characters in the target data into a first escape field, and escaping the escape characters in the target data into a second escape field; wherein the escape character is a start flag of the first escape field and the second escape field;
s205: and combining the initial identifier and the escaped target data into YUV extended data, and completing the transmission of the target image by transmitting the YUV extended data.
The embodiment constructs YUV extended data by using the identification characters and the escape characters on the basis of YUV data and YUV attribute data, thereby continuously storing the YUV extended data of a plurality of images and being suitable for a streaming application scene. The streaming application scene refers to an application scene in which data commonly used in network multimedia applications is transmitted according to continuous single bytes, when receiving and processing data in such a scene, it is possible to start receiving and processing data from any one byte of the continuous single bytes, and for YUV data and YUV attribute data, if a data receiving party fails to start receiving data from a data start end, a YUV attribute data segment cannot be retrieved from the received data in the streaming application scene, so that the YUV data cannot be correctly identified and processed.
Therefore, the embodiment uses the identification character to indicate the start end of the YUV extended data of one image, and uses the escape character to solve the problem of substitute recognition of the identification character, so that when the start end of the YUV extended data of one image cannot be received, the YUV attribute data segment can be retrieved from the YUV extended data of the subsequent image.
Table 2 shows raw YUV attribute data and YUV data, and table 3 shows YUV extended data using an identification character and an escape character.
TABLE 2
Figure BDA0002514448430000081
TABLE 3
Figure BDA0002514448430000082
Figure BDA0002514448430000091
As shown in table 2, the YUV data and YUV attribute data segments of image 1 and image 2 are sequentially stored as a segment of data stream. As shown in table 3, identification characters are added before YUV data and YUV attribute data segments of each image, and escape characters are used to store 0x7E and 0x7D instead as required, so that YUV extended data of image 1 and image 2 are generated and stored in sequence as a segment of data stream.
The identification character is used to indicate a start flag of an image YUV extension data, and in a specific implementation, the identification character may be defined as 0x 7E. In the YUV extended data of each image, there is and only one 0x7E allowed to exist and serve as a start flag, the YUV attribute data segment is followed by the YUV attribute data segment, and the YUV attribute data segment is followed by all YUV data of the current image until the start flag 0x7E belonging to the next image appears. Similarly, starting from the start mark 0x7E of the second image and going to the start mark 0x7E of the third image, YUV attribute data segment and YUV data of the second image are in the middle.
Escape characters are used to solve the problem of alternate recognition of identification characters. Since 0x7E is used as the start flag of YUV extended data, and only one 0x7E is allowed to be used as the start flag in the YUV extended data of each image, when 0x7E exists in the YUV attribute data segment or the YUV data, a special method is needed to be used to store 0x7E instead, so that only one 0x7E is ensured to be used as the start flag in the YUV extended data of each image. In a specific implementation, 0x7D may be used as an escape character, an escape replacement is made in the YUV attribute data and YUV data, 0x7D5E is used instead of save if 0x7E is encountered, and 0x7D5D is used instead of save if 0x7D is encountered.
That is, if the starting identification character is 0x7E and the escape character is 0x7D, escaping the identification character in the YUV data into a first escape field and escaping the escape character in the YUV data into a second escape field, comprising: escape 0x7E in the YUV data to 0x7D5E, escape 0x7D in the YUV data to 0x7D 5D.
It should be noted that, in order to improve the conversion efficiency in data processing, 0x7E and 0x7D are selected as the identification character and the escape character, and on this basis, 0x5E is selected to be used for escape substitution of 0x7E and 0x5D is selected to be used for escape substitution of 0x7D, because 0x7E is 0x5E XOR0x20 (XOR is an exclusive-or operator, the same below) and 0x5E is 0x7EXOR 0x 20; the conversion mode of 0x 7D-0 x5DXOR 0x20 and 0x 5D-0 x7D XOR0x20 only needs to perform exclusive or operation with 0x20 in both forward conversion and reverse conversion, and the conversion process is simple and efficient.
Therefore, the identifier character and the escape character are used in the embodiment, and when the stream data receiver fails to receive the stream data from the start of the YUV extended data, the start of the next image can still be found from the stream data by means of the identifier character 0x7E, and the YUV attribute data segment and the YUV data are correctly identified and processed, so that the problem that the YUV data is not suitable for the stream transmission application scene is solved.
An image transmission apparatus provided in an embodiment of the present application is described below, and an image transmission apparatus described below and an image transmission method described above may be referred to each other.
Referring to fig. 3, a block diagram of an image transmission apparatus according to an exemplary embodiment is shown, as shown in fig. 3, including:
a determining module 301, configured to determine YUV data corresponding to a target image, and determine attribute information of the target image; the attribute information comprises a secondary sampling rule of YUV chroma, a representation mode, an arrangement mode, the data length of each component and the size of the target image;
a generating module 302, configured to generate YUV attribute data corresponding to the target image based on the attribute information;
a transmission module 303, configured to combine the YUV attribute data and the YUV data into target data, and complete transmission of the target image by transmitting the target data.
The image transmission device provided by the embodiment of the application introduces the YUV attribute data on the basis of the YUV data, can identify the secondary sampling rule, the representation mode and the arrangement mode of the YUV chromaticity of the target image, the data length of each component and the size of the target image, and can store and transmit the YUV data and the YUV attribute data simultaneously, thereby avoiding the problem that engineers cannot acquire the YUV attribute data through other channels in time when obtaining the YUV data or cannot correctly identify and process the YUV data under the condition of wrong YUV attribute data.
On the basis of the above embodiment, as a preferred implementation, the YUV attribute data includes ten bytes, where the first byte and the second byte are used to describe the subsampling rule, the third byte is used to describe the representation, the fourth byte is used to describe the arrangement, the fifth byte and the sixth byte are used to describe the data length of each component, and the seventh byte to the cross section are used to describe the size of the target image.
On the basis of the above embodiment, as a preferred implementation, the transmission module 303 includes:
a combination unit, configured to combine the YUV attribute data and the YUV data into target data;
a determination unit for determining a start identification character and an escape character; wherein the start identifier is a start flag of the target image;
an escape unit, configured to escape the identification character in the target data into a first escape field, and escape the escape character in the target data into a second escape field; wherein the escape character is a start flag of the first escape field and the second escape field;
and the transmission unit is used for combining the initial identifier and the escaped target data into YUV extended data and completing the transmission of the target image by transmitting the YUV extended data.
In addition to the above embodiments, as a preferred implementation, if the start identifier is 0x7E, and the escape character is 0x7D, the escape unit is specifically a unit that escapes 0x7E in the target data to 0x7D5E, and that escapes 0x7D in the target data to 0x7D 5D.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
The present application further provides an electronic device, and referring to fig. 4, a structure diagram of an electronic device 400 provided in an embodiment of the present application, as shown in fig. 4, may include a processor 11 and a memory 12. The electronic device 400 may also include one or more of a multimedia component 13, an input/output (I/O) interface 14, and a communication component 15.
The processor 11 is configured to control the overall operation of the electronic device 400, so as to complete all or part of the steps in the image transmission method. The memory 12 is used to store various types of data to support operation at the electronic device 400, such as instructions for any application or method operating on the electronic device 400 and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and so forth. The Memory 12 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia component 13 may include a screen and an audio component. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 12 or transmitted via the communication component 15. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 14 provides an interface between the processor 11 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 15 is used for wired or wireless communication between the electronic device 400 and other devices. Wireless communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G or 4G, or a combination of one or more of them, so that the corresponding communication component 15 may include: Wi-Fi module, bluetooth module, NFC module.
In an exemplary embodiment, the electronic Device 400 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the image transmission method described above.
In another exemplary embodiment, there is also provided a computer readable storage medium comprising program instructions which, when executed by a processor, implement the steps of the above-described image transmission method. For example, the computer readable storage medium may be the memory 12 described above including program instructions that are executable by the processor 11 of the electronic device 400 to perform the image transmission method described above.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. An image transmission method, comprising:
determining YUV data corresponding to a target image, and determining attribute information of the target image; the attribute information comprises a secondary sampling rule of YUV chroma, a representation mode, an arrangement mode, the data length of each component and the size of the target image;
generating YUV attribute data corresponding to the target image based on the attribute information;
and combining the YUV attribute data and the YUV data into target data, and completing the transmission of the target image by transmitting the target data.
2. The image transmission method according to claim 1, wherein the YUV attribute data includes ten bytes, a first byte and a second byte for describing the subsampling rule, a third byte for describing the representation, a fourth byte for describing the arrangement, a fifth byte and a sixth byte for describing a data length of each component, and seventh byte to cross section for describing a size of the target image.
3. The image transmission method according to claim 1, wherein the completing the transmission of the target image by transmitting the target data comprises:
determining a starting identification character and an escape character; wherein the start identifier is a start flag of the target image;
escaping the identification characters in the target data into a first escape field, and escaping the escape characters in the target data into a second escape field; wherein the escape character is a start flag of the first escape field and the second escape field;
and combining the initial identifier and the escaped target data into YUV extended data, and completing the transmission of the target image by transmitting the YUV extended data.
4. The image transmission method according to claim 3, wherein if the start identification character is 0x7E and the escape character is 0x7D, escaping the identification character in the target data to a first escape field and escaping the escape character in the target data to a second escape field comprises:
escape 0x7E in the target data to 0x7D5E, escape 0x7D in the target data to 0x7D 5D.
5. An image transmission apparatus, comprising:
the determining module is used for determining YUV data corresponding to a target image and determining attribute information of the target image; the attribute information comprises a secondary sampling rule of YUV chroma, a representation mode, an arrangement mode, the data length of each component and the size of the target image;
a generating module, configured to generate YUV attribute data corresponding to the target image based on the attribute information;
and the transmission module is used for combining the YUV attribute data and the YUV data into target data and completing the transmission of the target image by transmitting the target data.
6. The image transmission apparatus according to claim 5, wherein the YUV attribute data includes ten bytes, a first byte and a second byte for describing the subsampling rule, a third byte for describing the representation, a fourth byte for describing the arrangement, a fifth byte and a sixth byte for describing a data length of each component, and seventh byte to a cross for describing a size of the target image.
7. The image transmission apparatus according to claim 5, wherein the transmission module includes:
a combination unit, configured to combine the YUV attribute data and the YUV data into target data;
a determination unit for determining a start identification character and an escape character; wherein the start identifier is a start flag of the target image;
an escape unit, configured to escape the identification character in the target data into a first escape field, and escape the escape character in the target data into a second escape field; wherein the escape character is a start flag of the first escape field and the second escape field;
and the transmission unit is used for combining the initial identifier and the escaped target data into YUV extended data and completing the transmission of the target image by transmitting the YUV extended data.
8. The image transmission apparatus according to claim 7, wherein if the start flag character is 0x7E and the escape character is 0x7D, the escape unit is specifically a unit that escapes 0x7E in the target data as 0x7D5E and 0x7D in the target data as 0x7D 5D.
9. An electronic device, comprising:
a memory for storing a computer program;
processor for implementing the steps of the image transmission method according to any one of claims 1 to 4 when executing said computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the image transmission method according to one of claims 1 to 4.
CN202010471554.5A 2020-05-29 2020-05-29 Image transmission method and device, electronic equipment and storage medium Withdrawn CN111738266A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010471554.5A CN111738266A (en) 2020-05-29 2020-05-29 Image transmission method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010471554.5A CN111738266A (en) 2020-05-29 2020-05-29 Image transmission method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111738266A true CN111738266A (en) 2020-10-02

Family

ID=72646485

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010471554.5A Withdrawn CN111738266A (en) 2020-05-29 2020-05-29 Image transmission method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111738266A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112866389A (en) * 2021-01-21 2021-05-28 同方电子科技有限公司 Slip protocol-based file transmission method and device in short-wave radio station communication

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112866389A (en) * 2021-01-21 2021-05-28 同方电子科技有限公司 Slip protocol-based file transmission method and device in short-wave radio station communication
CN112866389B (en) * 2021-01-21 2022-09-16 同方电子科技有限公司 Slip protocol-based file transmission method and device in short-wave radio station communication

Similar Documents

Publication Publication Date Title
CN106776677B (en) File conversion method, device and file transmission system
US9288302B2 (en) Apparatus and method for reproducing handwritten message by using handwriting data
CN109104243B (en) Pixel communication method, information sending terminal and information receiving terminal
US9639309B1 (en) Image conversion methods
CN111295885B (en) Transmitter
CN105160033A (en) Expression character string processing method and device
CN112650456A (en) Printing method and device and electronic equipment
WO2021060758A1 (en) Lossless data compression device and method therefor
CN106569984B (en) Method, device and system for automatically generating and transmitting color word stock
US6859151B2 (en) Digital data transforming method
CN111738266A (en) Image transmission method and device, electronic equipment and storage medium
CN113795015B (en) Data transmission method, device, equipment and computer readable storage medium
US20100124353A1 (en) Robust Encoding of Metadata in Lossy Encoded Images
JP4311648B2 (en) Representative color selection device and method, reduced color image generation device and method, and program
CN112995199A (en) Data encoding and decoding method, device, transmission system, terminal equipment and storage medium
CN110149631B (en) Method and system suitable for cloud loudspeaker box connection establishment
CN107634974A (en) A kind of data transmission method and device
US20080070607A1 (en) Apparatus and method for transmitting/receiving binary data in short message system
CN115766628A (en) Message combination method, device, equipment and storage medium
CN114202756A (en) Method, device and readable medium for cross-network-segment data transmission
CN112203103B (en) Message processing method, device, electronic equipment and computer readable storage medium
US8090362B2 (en) Mobile electronic device and method for displaying characters on a bluetooth device
US9632736B1 (en) Image conversion methods
KR20060109535A (en) Transmission/reception apparatus for back up-data in mobile telecommunication terminal equipment
CN115348232B (en) Decoding method, decoding device, electronic equipment, medium and product

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
WW01 Invention patent application withdrawn after publication

Application publication date: 20201002

WW01 Invention patent application withdrawn after publication