CN112165588B - Screen superposition display system and method, and picture compression method - Google Patents

Screen superposition display system and method, and picture compression method Download PDF

Info

Publication number
CN112165588B
CN112165588B CN202011044799.6A CN202011044799A CN112165588B CN 112165588 B CN112165588 B CN 112165588B CN 202011044799 A CN202011044799 A CN 202011044799A CN 112165588 B CN112165588 B CN 112165588B
Authority
CN
China
Prior art keywords
image
continuous
compression
superimposed
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011044799.6A
Other languages
Chinese (zh)
Other versions
CN112165588A (en
Inventor
宋博
于奇
李靖
王勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Electronic Science and Technology of China
Chengdu Image Design Technology Co Ltd
Original Assignee
University of Electronic Science and Technology of China
Chengdu Image Design 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 University of Electronic Science and Technology of China, Chengdu Image Design Technology Co Ltd filed Critical University of Electronic Science and Technology of China
Priority to CN202011044799.6A priority Critical patent/CN112165588B/en
Publication of CN112165588A publication Critical patent/CN112165588A/en
Application granted granted Critical
Publication of CN112165588B publication Critical patent/CN112165588B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/44Receiver circuitry for the reception of television signals according to analogue transmission standards
    • H04N5/445Receiver circuitry for the reception of television signals according to analogue transmission standards for displaying additional information
    • H04N5/44504Circuit details of the additional information generator, e.g. details of the character or graphics signal generator, overlay mixing circuits
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N25/00Circuitry of solid-state image sensors [SSIS]; Control thereof
    • H04N25/70SSIS architectures; Circuits associated therewith
    • H04N25/76Addressed sensors, e.g. MOS or CMOS sensors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Graphics (AREA)
  • Image Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a screen superposition display system and method and a picture compression method, comprising a storage component and an image processor, wherein the storage component stores a compressed image of a to-be-superimposed image after compression processing, the image processor decompresses the compressed image and superimposes the to-be-superimposed image and a background image, and finally, the superimposed image is output. According to the screen superposition display system provided by the invention, the compressed picture is put into the storage component of the low-cost ISP, and the original picture without damage is obtained by decompression during OSD superposition, so that the requirement on the storage of ISP sheets is reduced, the hardware cost of the ISP is reduced, and the use flexibility of the OSD is improved. The technical scheme of the invention can realize the screen superposition display function in the ISP with low cost and small on-chip memory space.

Description

Screen superposition display system and method, and picture compression method
Technical Field
The present invention relates to the field of image processing technologies, and in particular, to a system and a method for displaying a superimposed screen and a method for compressing a picture.
Background
The screen overlay display is one of basic functions of an ISP (Image Signal Processor, image processor), and is generally used for overlay display of images such as a reverse auxiliary line, logo, or menu. Taking reversing assistance as an example, a reversing line needs to be superimposed on the output image of the ISP. The reversing line needs to be dynamically adjusted according to the turning condition of the vehicle, and the display is attractive. In addition, the reversing line also needs to be overlapped with contents such as different shapes, colors and the like according to the vehicle type. Therefore, the reversing line is prepared in advance by drawing and then is superimposed on the output image of the ISP, which is a good choice. The inventors found that for low cost ISPs, since the on-chip memory space of the ISP is relatively limited, if the superimposed image is in the original data state, the data amount of the original data is large, and the superimposing function of a large area cannot be supported. For OSD (On Screen Display), the use is limited.
Accordingly, it is desirable to provide a solution that can satisfy the low cost ISP implementation of the screen overlay display function.
Disclosure of Invention
The invention aims to provide a screen superposition display system and a screen superposition display method, which are used for solving the problems of relatively limited on-chip memory space of an ISP with low cost and limited OSD function in the prior art.
In order to solve the above technical problems, the present invention provides a screen overlay display system, comprising:
a storage unit configured to store a compressed picture, which is a picture in which a picture to be superimposed is subjected to compression processing;
and the image processor is configured to acquire a background image and the compressed image, decompress the compressed image to acquire the image to be superimposed, superimpose the image based on the image to be superimposed and the background image and output the superimposed image.
Optionally, the image processor includes:
an internal SRAM configured to acquire the compressed picture and transmit the compressed picture to an OSD module;
and the OSD module is configured to acquire the background image and the compressed image, decompress the compressed image to acquire the image to be superimposed, superimpose the image based on the image to be superimposed and the background image and output the superimposed image.
Optionally, the OSD module includes a decoding unit and a superimposing unit;
the decoding unit is used for acquiring the compressed graph, decompressing the compressed graph to acquire the graph to be superimposed, and transmitting the graph to be superimposed to the superimposing unit;
the superposition unit is used for acquiring the background image and the compression image, and carrying out image superposition based on the image to be superimposed and the background image and outputting a superimposed image.
Optionally, the internal SRAM is connected to the storage element through an SPI interface.
Optionally, the method further comprises:
a CMOS image sensor configured to acquire the background map.
Optionally, the method further comprises:
a display section configured to acquire the superimposed image and display the superimposed image.
Based on the same inventive concept, the invention also provides a screen superposition display method, which comprises the following steps:
storing a compression diagram, wherein the compression diagram is a picture of the to-be-superimposed diagram after compression treatment;
and acquiring a background image and the compressed image, decompressing the compressed image to acquire the image to be superimposed, superimposing the image based on the image to be superimposed and the background image, and outputting the superimposed image.
Optionally, the compression process includes:
quantizing each channel in the graph to be superimposed according to a quantization formula, wherein the quantization formula is as follows:
C=floor(4*A/256);
wherein C is the quantized color value, A is the color value of each channel in the graph to be superimposed, and floor is a downward rounding function;
the number of the C is 16, the codes are respectively 0-15, the quantized color values and the corresponding codes are stored as color indexes, and the size of each pixel of the quantized image is 4 bits.
Optionally, the compressing process further includes:
and carrying out lossless compression processing on the quantized image by using a lossless compression algorithm.
Optionally, the lossless compression algorithm includes:
dividing the quantized image data into continuous identical data and continuous non-identical data;
for the continuous identical data, marking as needing to be compressed, and representing the continuous identical data by using the continuous quantity and the data value;
for continuous non-identical data, the different data is directly stored continuously without compression.
Optionally, when the number of the continuous identical data or the number of the continuous non-identical data is greater than or equal to 4 and less than 1023, recording the continuous number by using 10 bits;
when the number of the continuous identical data or the number of the continuous non-identical data is more than or equal to 1024, recording the continuous number by using 18 bits;
and when the number of the continuous identical data or the number of the continuous non-identical data is larger than the maximum value of the continuous number of the 18bit record, carrying out lossless compression on the rest part again.
Alternatively, when the number of consecutive identical data is less than 4, then the consecutive non-identical data is considered.
Optionally, the encoding of the image data after the lossless compression process is:
flag bit + run range + image data;
the flag bit represents whether compression is needed or not, and the size of the flag bit is 2 bits; wherein 00 represents no compression required and the number of consecutive is less than 3;01 represents that compression is not required and the number of succession is 3 or more and 1023 or less; 10 represents the need for compression, and the number of consecutive is greater than 4 and less than 1023;11 represents the need for compression, and the number of consecutive is greater than 1024 and less than 26143;
the run range is a continuous number.
Optionally, the encoding uses 8 bits as a recording unit, and the encoding further includes a padding bit, where the padding bit is used to fill up 8 bits by filling up 0 at the end of the encoding when the compressed data is less than 8 bits.
Optionally, the image processor performs image superimposition and outputs a superimposed image according to the following formula:
Out=Image1*(1-Alpha)+Image2*Alpha;
the Image1 is the background Image, the Image2 is the Image to be superimposed, the Alpha is the transparency of the Image to be superimposed, the Alpha range is 0-1, and out is the Image after being superimposed obtained by calculation.
Optionally, when the format of the map to be compressed is an RGB format, the compressing process includes:
and converting the to-be-superimposed graph into a YUV format.
Optionally, the converting the to-be-superimposed graph into YUV format includes:
converting the graph to be superimposed into YUV format according to the following conversion formula:
Y=0.299R+0587G+0.114B;
U=-0.1687R-0.3313G+0.5B+128;
V=0.5R-0.4187G-0.0813B+128;
wherein Y represents a gray value; u and V represent chromaticity, R represents red, G represents green, and B represents blue.
Optionally, the format of the graph to be superimposed is an RGB format or a YUV format.
Based on the same inventive concept, the invention also provides a picture compression method, which comprises the following steps:
converting the original image into YUV format;
quantizing each channel in the YUV format original picture according to a quantization formula;
and carrying out lossless compression processing on the quantized image by using a lossless compression algorithm.
Optionally, the method comprises the following steps:
the lossless compression algorithm includes:
dividing the quantized image data into continuous identical data and continuous non-identical data;
for the continuous identical data, marking as needing to be compressed, and representing the continuous identical data by using the continuous quantity and the data value;
for continuous different data, marking that compression is not needed, and directly and continuously storing the different data;
when the number of the continuous identical data or the number of the continuous non-identical data is more than or equal to 4 and less than 1023, recording the continuous number by using 10 bits;
when the number of the continuous identical data or the number of the continuous non-identical data is more than or equal to 1024, recording the continuous number by using 18 bits;
when the number of the continuous identical data or the number of the continuous non-identical data is larger than the maximum value of the continuous number of the 18bit record, carrying out lossless compression on the rest part again;
when the number of the continuous identical data is smaller than 4, the continuous non-identical data is considered;
optionally, the encoding of the image data after the lossless compression process is:
flag bit + run range + image data;
the flag bit represents whether compression is needed or not, the size of the flag bit is 2 bits, wherein 00 represents that compression is not needed, the continuous number is less than 3, 01 represents that compression is not needed, the continuous number is more than or equal to 3 and less than 1023, 10 represents that compression is needed, the continuous number is more than 4 and less than 1023, 11 represents that compression is needed, and the continuous number is more than 1024 and less than 262343;
the run range is a continuous number.
Compared with the prior art, the invention has the following beneficial effects:
1. the invention provides a screen superposition display system which comprises a storage component and an image processor, wherein the storage component stores a compressed image of a to-be-superimposed image after compression processing, the image processor decompresses the compressed image and superimposes the to-be-superimposed image and a background image, and finally, the superimposed image is output. According to the screen superposition display system provided by the invention, the compressed picture is put into the storage component of the low-cost ISP, and the original picture without damage is obtained by decompression during OSD superposition, so that the requirement on the storage of ISP sheets is reduced, the hardware cost of the ISP is reduced, and the use flexibility of the OSD is improved. The technical scheme of the invention can realize the screen superposition display function in the ISP with low cost and small on-chip memory space.
2. By compressing the pictures, the data volume of elements such as Logo, menus, reversing lines and the like can be greatly reduced, and the data volume of repeated images is simple. And then the original image is restored by decompression in the ISP sheet, so that the effects of image superposition and ISP storage capacity reduction are achieved, and the cost is reduced.
3. In order to further reduce the data amount, the image data is classified into continuous identical data and continuous non-identical data classification processing. For continuous identical data, the data is marked as needed to be compressed, and the redundant data can be eliminated by adopting continuous quantity and data value, so as to achieve the purpose of compression. For continuous non-identical data, the different data is directly stored continuously without compression.
4. In order to minimize the data compression, if the continuous data is greater than 3 and less than 1023, the continuous length is recorded with 10bit data. If the continuous data is greater than 1024, the continuous length is recorded with 18bit width data. If the continuous length is greater than the maximum recordable 18bit width, the uncompressed portion is recoded. If the number of consecutive identical data is less than 4, then the consecutive non-identical data is considered. By the way of compressing the parts, the space can be saved to the maximum extent, and the compression rate can be improved.
The screen superposition display method and the picture compression method provided by the invention belong to the same invention conception with the screen superposition display system, so that the screen superposition display method and the picture compression method have the same beneficial effects.
Drawings
FIG. 1 is a schematic diagram of a screen overlay display;
FIG. 2 is a schematic diagram of a screen overlay display system according to an embodiment of the present invention;
FIG. 3 is a rule diagram of a lossless compression process;
fig. 4 is a schematic flow chart of a screen overlay display method according to another embodiment of the present invention;
fig. 5 is a flowchart of another method for displaying a screen overlay according to another embodiment of the present invention.
Detailed Description
Specific embodiments of the present invention will be described in more detail below with reference to the drawings. The advantages and features of the present invention will become more apparent from the following description. It should be noted that the drawings are in a very simplified form and are all to a non-precise scale, merely for convenience and clarity in aiding in the description of embodiments of the invention.
In the description of the present invention, it should be understood that the directions or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", etc., are based on the directions or positional relationships shown in the drawings, are merely for convenience in describing the present invention and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limiting the present invention.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In the description of the present invention, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
Referring to fig. 1 and fig. 2, an embodiment of the present invention provides a screen overlay display system, which includes a storage unit and an image processor, wherein the storage unit is configured to store a compressed image, and the compressed image is a picture of a to-be-overlaid image after compression processing. The image processor is configured to acquire a background image and the compressed image, decompress the compressed image to acquire the image to be superimposed, superimpose an image based on the image to be superimposed and the background image, and output a superimposed image. It will be appreciated that the background map may be acquired by some image acquisition means, for example, a CMOS image sensor, which is required to acquire a real-time image of the road behind the vehicle when reversing if the on-screen display system is used in reversing assistance. Of course, the use of the CMOS image sensor is not limited, and in other embodiments, other types of image capturing devices may be used, such as CCD (Charged Coupled Device) image sensors, and many other types are not described in detail herein. In addition, the image output after the image superposition may be displayed by using a display unit, which may be implemented by using, but not limited to, a CRT (Cathode Ray Tube) display, a LCD (Liquid Crystal Display) display, a LED (Light Emitting Diode) display or a 3D (3-Dimensional) display, and a display unit foreseeable by future technologies, which may be specifically selected according to actual needs. The storage means may be FLASH (non-volatile solid state storage).
The screen superposition display system comprises a storage component and an image processor, wherein the storage component stores a compressed image of a to-be-superimposed image after compression processing, and the image processor decompresses the compressed image and superimposes the to-be-superimposed image and a background image, and finally outputs a superimposed image. According to the screen superposition display system provided by the invention, the compressed picture is put into the storage component of the low-cost ISP, and the original picture without damage is obtained by decompression during OSD superposition, so that the requirement on the storage of ISP sheets is reduced, the hardware cost of the ISP is reduced, and the use flexibility of the OSD is improved. The technical scheme of the invention can realize the screen superposition display function in the ISP with low cost and small on-chip memory space. In order to facilitate understanding of the technical solution of the present invention, in the embodiment of the present invention, reversing assistance is taken as an example, and other application scenarios are the same as the reversing assistance, which is not described in detail herein.
Further, when the format of the to-be-superimposed graph is an RGB format or a YUV format, the RGB format may be converted into the YUV format first, that is, the compression processing includes: and converting the to-be-superimposed graph into a YUV format. Fig. 1 is a schematic diagram of a screen overlay display, the upper left diagram is the background diagram, the lower left diagram is the diagram to be overlaid, and the right diagram is the overlay effect. In general, the to-be-superimposed graph is in RGB space, that is, RGB format, the to-be-superimposed graph may be first converted into YUV space, that is, into YUV format, and the to-be-superimposed graph may be converted into YUV format according to the following conversion formula:
Y=0.299R+0587G+0.114B;
U=-0.1687R-0.3313G+0.5B+128;
V=0.5R-0.4187G-0.0813B+128;
wherein Y represents a gray value; u and V represent chromaticity, R represents red, G represents green, and B represents blue.
It should be noted that, besides converting the RGB format to the YUV format, the RGB format pictures can be directly overlapped, and the RGB format pictures can be any other color gamut pictures, which are not described in detail herein. In the embodiment of the invention, the conversion of the RGB format into the YUV format is taken as an example to specifically describe, and the to-be-superimposed graphs of other formats are similar.
Because the images to be superimposed are usually LOGO, reversing auxiliary lines, menus and the like with simpler color composition, for compressing data to the maximum extent, a color depth of only 16 colors is adopted. The color depth can be increased according to the actual situation of SRAM (Static Random-Access Memory) in ISP, 256 colors or more of color gamut can be supported, but the corresponding hardware cost will rise. Since OSD superposition compression only supports 16 colors, after conversion to a YUV map, the UV channel values need to be quantized to 4bit depth for 16 colors in total. Specifically, the compression process further includes:
quantizing a U channel and a V channel in the YUV format to-be-superimposed graph according to a quantization formula, wherein the quantization formula is as follows:
C=floor(4*A/256);
wherein C is the quantized color value, A is the color values of the U channel and the V channel in the graph to be superimposed, and floor is a downward rounding function; the number of the C is 16, the codes are respectively 0-15, the total quantity of the Y is 1, the quantized color values and the corresponding codes are stored as color indexes, and the size of each pixel of the quantized image is 4 bits. By compressing the pictures, the data volume of simple and repeated images of elements like Logo, menu, reversing line and the like can be greatly reduced. And then the original image is restored by decompression in the ISP sheet, so that the effects of image superposition and ISP storage capacity reduction are achieved, and the cost is reduced. It can be understood that when the graph to be superimposed is in YUV format, the color values of the Y channel, the U channel and the V channel in the graph to be superimposed are the color values of the Y channel, the U channel and the V channel, and when the SRAM memory is insufficient, Y may be selected to be not quantized or quantized to 1 and uv to be quantized. When the to-be-superimposed graph is in an RGB format and is not subjected to YUV format conversion, the A is an R channel, a G channel and a B channel, and the R channel, the G channel and the B channel can be selectively quantized or not quantized according to the size of the SRAM.
Preferably, the compression process further includes:
and carrying out lossless compression processing on the quantized image by using a lossless compression algorithm.
Optionally, the lossless compression algorithm includes:
dividing the quantized image data into continuous identical data and continuous non-identical data;
for the continuous identical data, marking as needing to be compressed, and representing the continuous identical data by using the continuous quantity and the data value;
for continuous non-identical data, the different data is directly stored continuously without compression.
In order to further reduce the data amount, the image data is classified into continuous identical data and continuous non-identical data classification processing. For continuous identical data, the data is marked as needed to be compressed, and the redundant data can be eliminated by adopting continuous quantity and data value, so as to achieve the purpose of compression. For continuous non-identical data, the different data is directly stored continuously without compression.
Preferably, when the number of the consecutive identical data or the number of the consecutive non-identical data is 4 or more and 1023 or less, recording the consecutive number with 10 bits;
when the number of the continuous identical data or the number of the continuous non-identical data is more than or equal to 1024, recording the continuous number by using 18 bits;
and when the number of the continuous identical data or the number of the continuous non-identical data is larger than the maximum value of the continuous number of the 18bit record, carrying out lossless compression on the rest part again.
Further, when the number of the continuous identical data is smaller than 4, the continuous non-identical data is considered. In order to minimize the data compression, if the continuous data is greater than 3 and less than 1023, the continuous length is recorded with 10bit data. If the continuous data is greater than 1024, the continuous length is recorded with 18bit width data. If the continuous length is greater than the maximum recordable 18bit width, the uncompressed portion is recoded. If the number of consecutive identical data is less than 4, then the consecutive non-identical data is considered. By the way of compressing the parts, the space can be saved to the maximum extent, and the compression rate can be improved.
Optionally, referring to fig. 3, fig. 3 is a schematic rule diagram of lossless compression, and encoding of image data after the lossless compression is:
flag bit + run range + image data;
the flag bit represents whether compression is needed or not, the size of the flag bit is 2 bits, wherein 00 represents that compression is not needed, the continuous number is less than 3, 01 represents that compression is not needed, the continuous number is more than or equal to 3 and less than 1023, 10 represents that compression is needed, the continuous number is more than 4 and less than 1023, 11 represents that compression is needed, and the continuous number is more than 1024 and less than 262343;
the run range is a continuous number.
Optionally, the encoding uses 8 bits as a recording unit, and the encoding further includes a padding bit, where the padding bit is used to fill up 8 bits by filling up 0 at the end of the encoding when the compressed data is less than 8 bits.
To facilitate an understanding of the encoding rules in the lossless compression process of the present application, the following is described in connection with a specific example: the data bits are 4bit binary numbers wide, each bracket representing one Byte, i.e., 8 bits. In brackets are binary codes. In the encoding, the first 2 bits represent the flag bits, the underlines represent the consecutive numbers, and the italics represent the padding bits. Let the raw data be [ d0, d0, d1, d1, d1, d2, d3, d3, d3 … d3 (1000 d 3), d4, d5, d6, d7, d8, d9].
The first two are consecutive data d0, d0. According to the rule of the lossless compression algorithm, the flag bit is 00, which indicates that compression is not needed. Length 2, thus 0010 is encoded followed by data values d0, d0. Since the compression code is less than 8 bits, the last 4 bits are complemented with 0. At this time, the first 2 d0 s are compressed to (0010, d 0) (d 0,0000).
Immediately after 3 data d1, d1, d1, the compression standard is not yet reached, the flag bit is 00 uncompressed, and the length is 3, thus being encoded as (0011, d 1) (d 1, d 1).
Then a d2, still not meeting the compression standard, with a flag bit of 00 uncompressed, a length of 1, and a code of (0001, d 2).
Then 1000 d 3's occur, reaching the compression standard, the flag bit is 10, the length is 1000 according to the rule, and thus the code is (1011,1110) (1000, d 3).
Successive individual data, d4, d5, d6, d7, d8, d9, are then presented, marked uncompressed according to rules, recorded data length 6, encoded (0100,0000) (0110, d 4) (d 5, d 6) (d 7, d 8) (d 9,0000).
Finally, the complete compression results were:
(0010 d0)(d0 0000)(0011 d1)(d1 d1)(0001 d2)(1011 1110)(1000 d3)(01000000)(0110 d4)(d5 d6)(d7 d8)(d9 0000)。
wherein bold indicates a flag bit, underline indicates a count value, italic indicates a fill bit, and bracket is 1 Byte data. As can be seen from the compression result after compression, the original data amount is 1012Bytes, and the compressed data is 12Bytes. The compressed data can be stored in FLASH, and the compressed data is stored in FLASH with a determined position. The FLASH memory is large in amount, and a plurality of compressed pictures can be stored generally. ISP can call compressed images at different positions in FLASH at proper time, and according to the content of the images, the effect that the reversing line moves along with the vehicle, or the functions of dynamic Logo, dynamic menu and the like can be realized.
The image processor decompresses the compressed image according to the compression rule to obtain a pixel color index of the original image, obtains a color value YUV component of the pixel by looking up a table through the pixel color index, and then the image processor performs image superposition according to the following formula and outputs the superimposed image:
Out=Image1*(1-Alpha)+Image2*Alpha;
the Image1 is the background Image, the Image2 is the Image to be superimposed, the Alpha is the transparency of the Image to be superimposed, the Alpha range is 0-1, and out is the Image after being superimposed obtained by calculation. It should be noted that the Alpha range in the formula is 0-1, and can be quantized to 16 transparency levels in total of 4 bits because it represents the transparency of the graph to be superimposed.
Optionally, referring to fig. 2, the image processor includes:
an internal SRAM configured to acquire the compressed picture and transmit the compressed picture to an OSD module;
and the OSD module is configured to acquire the background image and the compressed image, decompress the compressed image to acquire the image to be superimposed, superimpose the image based on the image to be superimposed and the background image and output the superimposed image.
Optionally, the OSD module includes a decoding unit and a superimposing unit;
the decoding unit is used for acquiring the compressed graph, decompressing the compressed graph to acquire the graph to be superimposed, and transmitting the graph to be superimposed to the superimposing unit;
the superposition unit is used for acquiring the background image and the compression image, and carrying out image superposition based on the image to be superimposed and the background image and outputting a superimposed image.
Optionally, the internal SRAM and the storage part are connected through SPI interfaceIn connection with the memory unit, it is understood that the internal SRAM and the memory unit may also be connected by I 2 The C or UART interface is communicatively coupled, without limitation.
And the image processor calls the compressed image from the determined address of the FLASH according to the configuration command and stores the compressed image into the internal SRAM. Due to the internal memory capacity limitations of the image processor, the image processor can typically only invoke a limited amount of compressed data in FLASH at a time, depending on the internal SRAM capacity size.
Based on the same inventive concept, please refer to fig. 4, another embodiment of the present invention further provides a screen overlay display method, using the screen overlay display system, comprising the following steps:
s1: storing a compression diagram, wherein the compression diagram is a picture of the to-be-superimposed diagram after compression treatment;
s2: and acquiring a background image and the compressed image, decompressing the compressed image to acquire the image to be superimposed, superimposing the image based on the image to be superimposed and the background image, and outputting the superimposed image.
In order to facilitate understanding of the screen overlay display method according to the present invention, a more specific scheme is provided below, referring to fig. 5, the specific steps are as follows:
the first step: performing RGB-YUV conversion on the image;
and a second step of: processing the YUV image to form 16-color pixel index image data;
and a third step of: compressing the image using a lossless algorithm (for specific steps, refer to the description of the compression process);
fourth step: compressing and storing the obtained product into FLASH;
fifth step: ISP obtains compressed image data from FLASH and stores the data in SRAM;
sixth step: the OSD module decompresses the image data, checks the color index table, reverts to the original image, and finally displays the image in a superposition way.
Optionally, when the format of the map to be compressed is an RGB format, the compressing process includes:
and converting the to-be-superimposed graph into a YUV format.
Optionally, the converting the to-be-superimposed graph into YUV format includes:
converting the graph to be superimposed into YUV format according to the following conversion formula:
Y=0.299R+0587G+0.114B;
U=-0.1687R-0.3313G+0.5B+128;
V=0.5R-0.4187G-0.0813B+128;
wherein Y represents a gray value; u and V represent chromaticity, R represents red, G represents green, and B represents blue.
Optionally, the compression process includes:
quantizing each channel in the graph to be superimposed according to a quantization formula, wherein the quantization formula is as follows:
C=floor(4*A/256);
wherein C is the quantized color value, A is the color value of each channel in the graph to be superimposed, and floor is a downward rounding function;
the number of the C is 16, the codes are respectively 0-15, the quantized color values and the corresponding codes are stored as color indexes, and the size of each pixel of the quantized image is 4 bits.
Optionally, the compressing process further includes:
and carrying out lossless compression processing on the quantized image by using a lossless compression algorithm.
Optionally, the lossless compression algorithm includes:
dividing the quantized image data into continuous identical data and continuous non-identical data;
for the continuous identical data, marking as needing to be compressed, and representing the continuous identical data by using the continuous quantity and the data value;
for continuous non-identical data, the different data is directly stored continuously without compression.
By compressing the pictures, the data volume of elements such as Logo, menus, reversing lines and the like can be greatly reduced, and the data volume of repeated images is simple. And then the original image is restored by decompression in the ISP sheet, so that the effects of image superposition and ISP storage capacity reduction are achieved, and the cost is reduced.
Optionally, when the number of the continuous identical data or the number of the continuous non-identical data is greater than or equal to 4 and less than 1023, recording the continuous number by using 10 bits;
when the number of the continuous identical data or the number of the continuous non-identical data is more than or equal to 1024, recording the continuous number by using 18 bits;
and when the number of the continuous identical data or the number of the continuous non-identical data is larger than the maximum value of the continuous number of the 18bit record, carrying out lossless compression on the rest part again.
Alternatively, when the number of consecutive identical data is less than 4, then the consecutive non-identical data is considered. In order to further reduce the data amount, the image data is classified into continuous identical data and continuous non-identical data classification processing. For continuous identical data, the data is marked as needed to be compressed, and the redundant data can be eliminated by adopting continuous quantity and data value, so as to achieve the purpose of compression. For continuous non-identical data, the different data is directly stored continuously without compression.
Optionally, the encoding of the image data after the lossless compression process is:
flag bit + run range + image data;
the flag bit represents whether compression is needed or not, and the size of the flag bit is 2 bits; wherein 00 represents no compression required and the number of consecutive is less than 3;01 represents that compression is not required and the number of succession is 3 or more and 1023 or less; 10 represents the need for compression, and the number of consecutive is greater than 4 and less than 1023;11 represents the need for compression, and the number of consecutive is greater than 1024 and less than 26143;
the run range is a continuous number.
Optionally, the encoding uses 8 bits as a recording unit, and the encoding further includes a padding bit, where the padding bit is used to fill up 8 bits by filling up 0 at the end of the encoding when the compressed data is less than 8 bits.
Optionally, the image processor performs image superimposition and outputs a superimposed image according to the following formula:
Out=Image1*(1-Alpha)+Image2*Alpha;
the Image1 is the background Image, the Image2 is the Image to be superimposed, the Alpha is the transparency of the Image to be superimposed, the Alpha range is 0-1, and out is the Image after being superimposed obtained by calculation.
Optionally, the format of the graph to be superimposed is an RGB format or a YUV format. It should be noted that, besides converting the RGB format to the YUV format, the RGB format pictures can be directly overlapped, and the RGB format pictures can be any other color gamut pictures, which are not described in detail herein.
Based on the same inventive concept, a further embodiment of the present invention further provides a picture compression method, including the following steps:
converting the original image into YUV format;
quantizing a U channel and a V channel in the original picture in the YUV format according to a quantization formula;
and carrying out lossless compression processing on the quantized image by using a lossless compression algorithm.
Further, the method comprises the following steps:
the lossless compression algorithm includes:
dividing the quantized image data into continuous identical data and continuous non-identical data;
for the continuous identical data, marking as needing to be compressed, and representing the continuous identical data by using the continuous quantity and the data value;
for continuous different data, marking that compression is not needed, and directly and continuously storing the different data;
when the number of the continuous identical data or the number of the continuous non-identical data is more than or equal to 4 and less than 1023, recording the continuous number by using 10 bits;
when the number of the continuous identical data or the number of the continuous non-identical data is more than or equal to 1024, recording the continuous number by using 18 bits;
when the number of the continuous identical data or the number of the continuous non-identical data is larger than the maximum value of the continuous number of the 18bit record, carrying out lossless compression on the rest part again;
when the number of the continuous identical data is smaller than 4, the continuous non-identical data is considered;
further, the encoding of the image data after the lossless compression process is:
flag bit + run range + image data;
the flag bit represents whether compression is needed or not, the size of the flag bit is 2 bits, wherein 00 represents that compression is not needed, the continuous number is less than 3, 01 represents that compression is not needed, the continuous number is more than or equal to 3 and less than 1023, 10 represents that compression is needed, the continuous number is more than 4 and less than 1023, 11 represents that compression is needed, and the continuous number is more than 1024 and less than 262343;
the run range is a continuous number.
In summary, the invention has the following beneficial effects:
1. the invention provides a screen superposition display system which comprises a storage component and an image processor, wherein the storage component stores a compressed image of a to-be-superimposed image after compression processing, the image processor decompresses the compressed image and superimposes the to-be-superimposed image and a background image, and finally, the superimposed image is output. According to the screen superposition display system provided by the invention, the compressed picture is put into the storage component of the low-cost ISP, and the original picture without damage is obtained by decompression during OSD superposition, so that the requirement on the storage of ISP sheets is reduced, the hardware cost of the ISP is reduced, and the use flexibility of the OSD is improved. The technical scheme of the invention can realize the screen superposition display function in the ISP with low cost and small on-chip memory space.
2. By compressing the pictures, the data volume of elements such as Logo, menus, reversing lines and the like can be greatly reduced, and the data volume of repeated images is simple. And then the original image is restored by decompression in the ISP sheet, so that the effects of image superposition and ISP storage capacity reduction are achieved, and the cost is reduced.
3. In order to further reduce the data amount, the image data is classified into continuous identical data and continuous non-identical data classification processing. For continuous identical data, the data is marked as needed to be compressed, and the redundant data can be eliminated by adopting continuous quantity and data value, so as to achieve the purpose of compression. For continuous non-identical data, the different data is directly stored continuously without compression.
4. In order to minimize the data compression, if the continuous data is greater than 3 and less than 1023, the continuous length is recorded with 10bit data. If the continuous data is greater than 1024, the continuous length is recorded with 18bit width data. If the continuous length is greater than the maximum recordable 18bit width, the uncompressed portion is recoded. If the number of consecutive identical data is less than 4, then the consecutive non-identical data is considered.
The screen superposition display method and the picture compression method provided by the invention belong to the same invention conception with the screen superposition display system, so that the screen superposition display method and the picture compression method have the same beneficial effects.
In the description of the present specification, a description of the terms "one embodiment," "some embodiments," "examples," or "particular examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics may be combined in any suitable manner in any one or more embodiments. Further, one skilled in the art can engage and combine the different embodiments or examples described in this specification.
The foregoing is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any person skilled in the art will make any equivalent substitution or modification to the technical solution and technical content disclosed in the invention without departing from the scope of the technical solution of the invention, and the technical solution of the invention is not departing from the scope of the invention.

Claims (18)

1. A screen overlay display system, comprising:
a storage section configured to store a compressed picture, which is a picture in which a picture to be superimposed is subjected to compression processing, the compression processing including: carrying out lossless compression processing on the quantized image by using a lossless compression algorithm, wherein the encoding of the image data after the lossless compression processing is as follows: flag bit + run range + image data; the flag bit represents whether compression is needed or not, and the size of the flag bit is 2 bits; wherein 00 represents no compression required and the number of consecutive is less than 3;01 represents that compression is not required and the number of succession is 3 or more and 1023 or less; 10 represents compression required, and the number of consecutive is 4 or more and 1023 or less; 11 represents the need for compression, and the number of consecutive is greater than 1024 and less than 26143; the run range is a continuous number;
and the image processor is configured to acquire a background image and the compressed image, decompress the compressed image to acquire the image to be superimposed, superimpose the image based on the image to be superimposed and the background image and output the superimposed image.
2. The screen overlay display system of claim 1, wherein the image processor comprises:
an internal SRAM configured to acquire the compressed picture and transmit the compressed picture to an OSD module;
and the OSD module is configured to acquire the background image and the compressed image, decompress the compressed image to acquire the image to be superimposed, superimpose the image based on the image to be superimposed and the background image and output the superimposed image.
3. The screen overlay display system according to claim 2, wherein the OSD module includes a decoding unit and an overlay unit;
the decoding unit is used for acquiring the compressed graph, decompressing the compressed graph to acquire the graph to be superimposed, and transmitting the graph to be superimposed to the superimposing unit;
the superposition unit is used for acquiring the background image and the compression image, and carrying out image superposition based on the image to be superimposed and the background image and outputting a superimposed image.
4. The screen overlay display system of claim 3 wherein the internal SRAM is connected to the memory component through an SPI interface.
5. The screen overlay display system of claim 1, further comprising:
a CMOS image sensor configured to acquire the background map.
6. The screen overlay display system of claim 1, further comprising:
a display section configured to acquire the superimposed image and display the superimposed image.
7. A screen overlay display method, comprising the steps of:
storing a compression diagram, wherein the compression diagram is a picture of a to-be-superimposed diagram subjected to compression processing, and the compression processing comprises: carrying out lossless compression processing on the quantized image by using a lossless compression algorithm, wherein the encoding of the image data after the lossless compression processing is as follows: flag bit + run range + image data; the flag bit represents whether compression is needed or not, and the size of the flag bit is 2 bits; wherein 00 represents no compression required and the number of consecutive is less than 3;01 represents that compression is not required and the number of succession is 3 or more and 1023 or less; 10 represents compression required, and the number of consecutive is 4 or more and 1023 or less; 11 represents the need for compression, and the number of consecutive is greater than 1024 and less than 26143; the run range is a continuous number;
and acquiring a background image and the compressed image, decompressing the compressed image to acquire the image to be superimposed, superimposing the image based on the image to be superimposed and the background image, and outputting the superimposed image.
8. The screen overlay display method according to claim 7, wherein the compression process includes:
quantizing each channel in the graph to be superimposed according to a quantization formula, wherein the quantization formula is as follows:
C=floor(4*A/256);
wherein C is the quantized color value, A is the color value of each channel in the graph to be superimposed, and floor is a downward rounding function;
the number of the C is 16, the codes are respectively 0-15, the quantized color values and the corresponding codes are stored as color indexes, and the size of each pixel of the quantized image is 4 bits.
9. The screen overlay display method of claim 8, wherein the lossless compression algorithm comprises:
dividing the quantized image data into continuous identical data and continuous non-identical data;
for the continuous identical data, marking as needing to be compressed, and representing the continuous identical data by using the continuous quantity and the data value;
for continuous non-identical data, the different data is directly stored continuously without compression.
10. The screen superimposition display method according to claim 9, wherein when the number of the continuous identical data or the number of the continuous non-identical data is 4 or more and 1023 or less, the continuous number is recorded with 10 bits;
when the number of the continuous identical data or the number of the continuous non-identical data is more than or equal to 1024, recording the continuous number by using 18 bits;
and when the number of the continuous identical data or the number of the continuous non-identical data is larger than the maximum value of the continuous number of the 18bit record, carrying out lossless compression on the rest part again.
11. The screen overlay display method according to claim 10, wherein when the number of the consecutive identical data is less than 4, the consecutive non-identical data is regarded.
12. The screen overlay display method of claim 11, wherein the code takes 8 bits as a recording unit, the code further comprising a padding bit for padding 8 bits at the last 0 of the code when the compressed data is less than 8 bits.
13. The screen overlay display method according to claim 7, wherein the image overlay is performed and the overlaid image is output according to the following formula:
Out=Image1*(1-Alpha)+Image2*Alpha;
the Image1 is the background Image, the Image2 is the Image to be superimposed, the Alpha is the transparency of the Image to be superimposed, the Alpha range is 0-1, and out is the Image after being superimposed obtained by calculation.
14. The screen overlay display method according to claim 7, wherein when the format of the map to be overlaid is an RGB format, the compression process includes:
and converting the to-be-superimposed graph into a YUV format.
15. The screen overlay display method of claim 14, wherein the converting the map to be overlaid to YUV format comprises:
converting the graph to be superimposed into YUV format according to the following conversion formula:
Y=0.299R+0587G+0.114B;
U=-0.1687R-0.3313G+0.5B+128;
V=0.5R-0.4187G-0.0813B+128;
wherein Y represents a gray value; u and V represent chromaticity, R represents red, G represents green, and B represents blue.
16. The screen overlay display method according to claim 7, wherein the format of the graph to be overlaid is an RGB format or a YUV format.
17. A picture compression method, comprising the steps of:
converting the original image into YUV format;
quantizing each channel in the YUV format original picture according to a quantization formula;
carrying out lossless compression processing on the quantized image by using a lossless compression algorithm, wherein the encoding of the image data after the lossless compression processing is as follows: flag bit + run range + image data; the flag bit represents whether compression is needed or not, and the size of the flag bit is 2 bits; wherein 00 represents no compression required and the number of consecutive is less than 3;01 represents that compression is not required and the number of succession is 3 or more and 1023 or less; 10 represents compression required, and the number of consecutive is 4 or more and 1023 or less; 11 represents the need for compression, and the number of consecutive is greater than 1024 and less than 26143; the run range is a continuous number.
18. The picture compression method as claimed in claim 17, comprising the steps of:
the lossless compression algorithm includes:
dividing the quantized image data into continuous identical data and continuous non-identical data;
for the continuous identical data, marking as needing to be compressed, and representing the continuous identical data by using the continuous quantity and the data value;
for continuous different data, marking that compression is not needed, and directly and continuously storing the different data;
when the number of the continuous identical data or the number of the continuous non-identical data is more than or equal to 4 and less than 1023, recording the continuous number by using 10 bits;
when the number of the continuous identical data or the number of the continuous non-identical data is more than or equal to 1024, recording the continuous number by using 18 bits;
when the number of the continuous identical data or the number of the continuous non-identical data is larger than the maximum value of the continuous number of the 18bit record, carrying out lossless compression on the rest part again;
and when the number of the continuous identical data is smaller than 4, the continuous non-identical data is considered.
CN202011044799.6A 2020-09-28 2020-09-28 Screen superposition display system and method, and picture compression method Active CN112165588B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011044799.6A CN112165588B (en) 2020-09-28 2020-09-28 Screen superposition display system and method, and picture compression method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011044799.6A CN112165588B (en) 2020-09-28 2020-09-28 Screen superposition display system and method, and picture compression method

Publications (2)

Publication Number Publication Date
CN112165588A CN112165588A (en) 2021-01-01
CN112165588B true CN112165588B (en) 2023-05-12

Family

ID=73860695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011044799.6A Active CN112165588B (en) 2020-09-28 2020-09-28 Screen superposition display system and method, and picture compression method

Country Status (1)

Country Link
CN (1) CN112165588B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6721455B1 (en) * 1998-05-08 2004-04-13 Apple Computer, Inc. Method and apparatus for icon compression and decompression
TWI281827B (en) * 2004-03-23 2007-05-21 Via Tech Inc Method of image display with real time compression
JP2006060490A (en) * 2004-08-19 2006-03-02 Fuji Photo Film Co Ltd Image compressor and image compression program
CN110572664A (en) * 2019-08-14 2019-12-13 中国地质大学(武汉) Novel BMP image compression method and system
CN111708574B (en) * 2020-05-28 2023-03-31 中国科学院信息工程研究所 Instruction stream compression and decompression method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ECG compression using run length encoding;S. Akhter, M.A.Haque;《18th European Signal Processing Conference (EUSIPCO - 2010)》;全文 *

Also Published As

Publication number Publication date
CN112165588A (en) 2021-01-01

Similar Documents

Publication Publication Date Title
US10687080B2 (en) Color volume transforms in coding of high dynamic range and wide color gamut sequences
EP1625509B1 (en) Strategies for processing image information using a color information data structure
US20170323617A1 (en) Rgb to yuv format conversion and inverse conversion method and circuit for depth packing and depacking
CN108141505B (en) Compression and decompression method for high bit depth medical gray level image
US8625666B2 (en) 4:4:4 color space video with 4:2:0 color space video encoders and decoders systems and methods
US20070248284A1 (en) Device and Method of Downscaling and Blending Two High Resolution Images
US8184127B2 (en) Apparatus for and method of generating graphic data, and information recording medium
CN110830804B (en) Method and apparatus for signaling picture/video formats
JP4647280B2 (en) Display device
TWI321959B (en) Method for transforming color space of image
TW201540045A (en) Adaptive processing of video streams with reduced color resolution
US20120314758A1 (en) Method and apparatus for processing video data
US7800629B2 (en) Image processing apparatus and method for preventing degradation of image quality when bit format of image is converted
CN112165588B (en) Screen superposition display system and method, and picture compression method
EP2222087A1 (en) Bit depth upscaling in RGB colour space for reducing propagation of errors due to transformation to YUV colour space
CN113439442A (en) Image data processing device and method
CN114020228A (en) Screen display method and device
TWI472232B (en) Video transmission by decoupling color components and apparatus thereof and processor readable tangible medium encoded with instructions
US20100091132A1 (en) Image capturing device and image preprocessing method thereof
US10922848B2 (en) Pixel storage for graphical frame buffers
KR100852958B1 (en) Apparatus and control method for display driver by sub-pixel rendering and data compression
US7885487B2 (en) Method and apparatus for efficiently enlarging image by using edge signal component
EP1594314A2 (en) Memory efficient method and apparatus for compression encoding large overlaid camera images
US8462168B2 (en) Decompression system and method for DCT-base compressed graphic data with transparent attribute
KR101012585B1 (en) Multi-channelImage registration system and the Method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant