WO2015032339A1 - 一种jpeg图片的合成方法及叠加osd信息的方法及装置 - Google Patents

一种jpeg图片的合成方法及叠加osd信息的方法及装置 Download PDF

Info

Publication number
WO2015032339A1
WO2015032339A1 PCT/CN2014/085951 CN2014085951W WO2015032339A1 WO 2015032339 A1 WO2015032339 A1 WO 2015032339A1 CN 2014085951 W CN2014085951 W CN 2014085951W WO 2015032339 A1 WO2015032339 A1 WO 2015032339A1
Authority
WO
WIPO (PCT)
Prior art keywords
picture
jpeg
coefficient
dct
dct coefficients
Prior art date
Application number
PCT/CN2014/085951
Other languages
English (en)
French (fr)
Inventor
吴参毅
Original Assignee
浙江宇视科技有限公司
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 浙江宇视科技有限公司 filed Critical 浙江宇视科技有限公司
Priority to EP14842007.8A priority Critical patent/EP3043313A4/en
Priority to US14/914,319 priority patent/US20160219307A1/en
Publication of WO2015032339A1 publication Critical patent/WO2015032339A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/40Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/167Position within a video image, e.g. region of interest [ROI]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/625Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
    • 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

Definitions

  • the present invention relates to the field of image processing technologies, and in particular, to a method for synthesizing JPEG pictures, and a method and apparatus for superimposing OSD information.
  • BACKGROUND OF THE INVENTION In the electronic police subsystem and the bayonet subsystem of the Intelligent Transportation System (ITS), the front-end equipment completely records the violation process and enlarges the close-up license plate by capturing the picture of the illegal vehicle at the intersection. Usually, several pictures of a specific vehicle are generally combined into one large resolution picture for preservation.
  • the single picture and composite picture formats captured by the front-end device are in the JPEG (Joint Photographic Experts Group) format.
  • the patterns of picture composition vary depending on the specific application.
  • Figure 1 to Figure 3 show examples of two pictures, three pictures, and four pictures.
  • Figure 1 is composed of two JPEG images into one picture:
  • Figure la is a combination of two pictures in the vertical direction. At this time, the two pictures are the same width and equal to the composite picture width.
  • Figure lb Two pictures are combined in the horizontal direction. The two images are the same height and equal to the composite image height.
  • Figure 2 is composed of three pictures: In Figure 2a, picture 2 and picture 3 are the same height, firstly combined in the horizontal direction, and then combined with picture 1 and synthesized in the vertical direction; picture 2 and picture 3 in Figure 2b have the same width, first according to The vertical direction is combined, and then the composite picture is combined with the picture 1 in the horizontal direction.
  • Figure 3 is composed of 4 pictures: Picture 2, Picture 3 and Picture 4 in Figure 3a are the same height, first synthesized in the horizontal direction, and then the composite picture is further combined with the vertical direction of Picture 1; Picture 2, Picture 3 and Picture in Figure 3b 4 The width is the same, first synthesized in the vertical direction, and then the composite picture is further combined with the horizontal direction of the picture 1.
  • JPEG picture synthesis the JPEG pictures to be synthesized need to be separately decoded to obtain the YUV format of each picture, and then each YUV format picture is synthesized according to the synthesis mode.
  • JPEG encoding is performed. Taking two JPEG picture synthesis as an example, as shown in FIG. 4, two JPEG pictures are respectively decoded according to the JPEG standard decoding process (entropy decoding -> AC/DC coefficient decoding -> inverse DC prediction -> inverse quantization -> IDCT) decoding. The YUV picture is obtained, and then the YUV picture is synthesized according to the synthesis mode. After the synthesis is completed, the synthesized process is obtained according to the coding process of the JPEG standard (DCT -> quantization -> DC prediction -> AC/DC coefficient coding -> entropy coding). JPEG picture.
  • OSD On Screen Display
  • the same is also required to decode the JPEG picture according to the standard decoding process, and then superimpose the OSD information in the obtained YUV plane; after completion, the code is encoded according to the JPEG standard encoding process, and a new one is obtained.
  • Added JPEG image of OSD The existing OSD overlay scheme requires full picture decoding and re-encoding, which not only calculates the amount of computation, but also brings down the picture quality caused by the decoding and encoding operations of the entire picture. Summary of the invention
  • the object of the present invention is to solve the technical problem of large amount of calculation and degradation of synthesized picture quality in the prior art JPEG picture synthesis, and propose a method for synthesizing JPEG pictures, a method and a device for superimposing OSD information, and reducing the calculation amount when synthesizing pictures. .
  • the technical solution of the present invention is as follows:
  • a JPEG picture synthesis method for synthesizing a first picture and a second picture comprising the steps of: entropy decoding, AC/DC coefficient decoding, inverse DC prediction, and JPEG bit data streams of the first picture and the second picture Inverse quantization, obtaining DCT coefficients;
  • the synthesized DCT coefficients are quantized, DC predicted, AC/DC coefficient encoded, and entropy encoded to form a bit stream of the synthesized picture.
  • JPEG picture synthesis method further includes the steps of:
  • the header of the first picture or the second picture is reserved as the header of the composite picture, and the image height and width information in the header is modified to be the image height and width information of the composite picture.
  • the format of pictures is generally the same, and the information of the header of the JPEG picture file is generally the same.
  • the head of an picture file is reserved as the head of the composite picture.
  • the DCT coefficient synthesis according to the picture stitching mode is specifically configured to arrange DCT coefficients of the first picture and the second picture according to a JPEG raster scan order according to a picture stitching mode.
  • the picture stitching mode has a horizontal stitching mode and a vertical stitching mode. According to different stitching modes, the DCT coefficients are arranged in the JPEG raster scanning order.
  • the DCT coefficients of the second image are arranged after the last row of the first image;
  • Splicing mode DCT coefficients of the composite picture
  • the first half of the nth line is the DCT coefficient of the nth line of the first picture
  • the second half of the nth line of the composite picture is the DCT coefficient of the nth line of the second picture.
  • the invention also proposes a method for superimposing OSD information of a JPEG picture, the method comprising the steps of: performing entropy decoding, AC/DC coefficient decoding, inverse DC prediction and inverse quantization on a JPEG picture bit data stream to which the OSD information is superimposed, to obtain DCT coefficients. ;
  • the synthesized DCT coefficients are quantized, DC predicted, AC/DC coefficient encoded, and entropy encoded to form a bit stream of the synthesized picture.
  • the DCT coefficient of the region in which the OSD information needs to be superimposed is extracted, and is extracted from the DCT coefficients of the JPEG image according to the coordinate information of the region on the JPEG image where the OSD information needs to be superimposed.
  • the invention also provides a JPEG picture synthesizing device, which comprises a processor and a non-volatile memory storing a plurality of computer instructions.
  • a JPEG picture synthesizing device which comprises a processor and a non-volatile memory storing a plurality of computer instructions.
  • the computer instructions are executed by the processor, the following processing is performed: for the first picture and the second picture
  • the JPEG bit stream is subjected to entropy decoding, AC/DC coefficient decoding, inverse DC prediction, and inverse quantization to obtain DCT coefficients;
  • the synthesized DCT coefficients are quantized, DC predicted, AC/DC coefficient encoded, and entropy encoded to form a bit stream of the synthesized picture.
  • the computer instructions are also executed as follows when executed by the processor:
  • the header of the first picture or the second picture is reserved as the header of the composite picture, and the image height and width information in the header is modified to be the image height and width information of the composite picture.
  • the present invention also provides an apparatus for superimposing OSD information of a JPEG picture, comprising a processor and a non-volatile memory storing a plurality of computer instructions, the computer instructions being executed by the processor to perform the following processing: JPEG to superimpose OSD information
  • the picture bit data stream is subjected to entropy decoding, AC/DC coefficient decoding, inverse DC prediction, and inverse quantization to obtain DCT coefficients;
  • the DCT coefficient superimposed with the OSD information and the DCT coefficient of the non-superimposed region are subjected to DCT coefficient synthesis;
  • the synthesized DCT coefficients are quantized, DC predicted, AC/DC coefficient encoded, and entropy encoded to form a bit stream of composite pictures.
  • the DCT coefficient of the region in which the OSD information needs to be superimposed is extracted according to the JPEG image
  • the coordinate information of the area in which the OSD information needs to be superimposed is extracted from the DCT coefficients of the JPEG picture.
  • the method and device for synthesizing JPEG picture and superimposing OSD information proposed by the invention by entropy decoding, AC/DC coefficient decoding, inverse DC prediction and inverse quantization on a JPEG picture bit data stream, according to the JPEG mode according to the splicing mode in the DCT coefficient plane
  • the raster scan sequence performs DCT coefficient synthesis, and then performs quantization, DC prediction, AC/DC coefficient encoding, and entropy encoding to form a JPEG picture bit data stream.
  • entropy decoding, AC/DC coefficient decoding, inverse DC prediction, and inverse quantization are performed on JPEG pictures, and then IDCT changes are performed only for areas where OSD information needs to be superimposed, and DCD is performed after superimposing OSD information in the YUV plane.
  • the DCT coefficients are converted into DCT coefficients, and the DCT coefficients are combined with the DCT coefficients of the non-superimposed regions, and the synthesized DCT coefficients are quantized, DC predicted, AC/DC coefficient encoded, and entropy encoded to form a bit stream of the synthesized picture.
  • the invention completes the synthesis of the picture in the DCT coefficient plane, and does not need to perform IDCT transformation and DCT transformation on the entire JPEG picture, and the calculation amount is small, and the synthesis efficiency is high.
  • Figure la is a pattern of two JPEG picture synthesis in the vertical direction
  • Figure lb is a pattern of two JPEG picture synthesis in the horizontal direction
  • Figure 2a is a pattern of three JPEG picture synthesis in the vertical direction
  • Figure 2b shows the pattern of three JPEG picture synthesis in the horizontal direction
  • Figure 3a is a pattern of four JPEG picture synthesis in the vertical direction
  • Figure 3b shows the pattern of four JPEG picture synthesis in the horizontal direction
  • FIG. 4 is a schematic diagram of a prior art JPEG picture synthesis codec algorithm
  • Figure 5a is a schematic diagram of JPEG picture overlay OSD information
  • Figure 5b is a schematic diagram of JPEG picture overlay OSD information
  • Figure 6a is a schematic diagram of JPEG image raster scanning
  • Figure 6b is a schematic diagram of horizontally stitching JPEG picture raster scanning
  • Figure 6c is a schematic diagram of vertical splicing of a JPEF picture raster scan
  • FIG. 7 is a schematic diagram of a JPEG synthesis method according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a method for superimposing OSD information according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a JPEG synthesizing apparatus according to an embodiment of the present invention.
  • FIG. 10 is a hardware architecture diagram of a JPEG picture synthesizing apparatus and a JPEG picture superimposing OSD information apparatus according to an embodiment of the present invention. detailed description
  • the JPEG encoding standard encodes all 8x8 pixel blocks (hereinafter referred to as pixel blocks) in the picture in a raster scan order from left to right and from top to bottom, for one of the pixel blocks, after DCT transformation, a The DC coefficient and 63 AC coefficients are respectively quantized for the DC coefficient and the AC coefficient, and then DC prediction is performed, then AC coefficient and DC coefficient coding (abbreviated as AC/DC coefficient coding) are performed, and finally entropy coding is performed to form a bit data stream.
  • AC/DC coefficient coding AC coefficient and DC coefficient coding
  • the DC coefficient coding is DPCM (Differential Pulse Code Modulation), and the AC coefficient coding is RLE (Run-Length Encoding).
  • the JPEG picture decoding process is the reverse process of the above encoding process, that is, entropy decoding is performed first, then AC coefficient and DC coefficient decoding (referred to as AC/DC coefficient decoding), then inverse DC prediction, and then AC coefficient and DC coefficient are respectively performed.
  • picture 1 and picture 2 to be synthesized have K 8x8 pixel blocks per line, and M columns per column.
  • the raster scan order of picture 1 is shown in Figure 6a.
  • the two pictures are spliced, if the horizontal splicing mode is followed, the corresponding raster scan is as shown in Fig. 6b; if the vertical splicing mode is followed, the corresponding raster scan is as shown in Fig. 6c.
  • the pictures in the ITS system are saved in JPEG format, and the pictures are the same size.
  • the present invention is not limited to the same size of picture stitching, and for different size JPEG pictures, according to the splicing mode, it may be arranged according to the raster scan order.
  • the image of the stitched picture 1 and the pixel block of the picture 2 are arranged in the composite picture in relation to the original picture. Since the order of the pixel blocks is changed, the DC coefficient encoding of the pixel block is changed. Therefore, the DC coefficients of the picture pixel block can be re-encoded, and the bit stream can be reassembled to complete the stitching of the picture.
  • the picture is synthesized in the DCT coefficient plane, and then the quantization and DC prediction are performed again.
  • AC/DC coefficient coding, entropy coding, to form a composite picture after performing entropy decoding, AC/DC coefficient decoding, inverse DC prediction, and inverse quantization on the synthesized picture 1 and picture 2, the picture is synthesized in the DCT coefficient plane, and then the quantization and DC prediction are performed again.
  • AC/DC coefficient coding, entropy coding to form a composite picture.
  • FIG. 7 is a flowchart of a method for synthesizing a JPEG picture according to an embodiment of the present invention, including the steps of:
  • Step S1 entropy decoding, AC/DC coefficient decoding, inverse DC prediction, and inverse quantization of the JPEG bit stream of the picture 1 and picture 2 to be synthesized, to obtain a DCT coefficient.
  • the pictures in the ITS system are saved in JPEG format.
  • the saved JPEG pictures are entropy-encoded JPEG bit streams (JPEG bitstream). Therefore, when you need to synthesize picture 1 and picture 2, you need to first view picture 1 Entropy decoding is performed with picture 2.
  • the conventional method is to perform standard full JPEG decoding on picture 1 and picture 2 to be synthesized, and then perform synthesis on the YUV plane.
  • the present invention only performs composite picture 1 and picture 2 for entropy decoding, AC/DC coefficient decoding, inverse DC prediction, and inverse quantization to obtain DCT coefficients.
  • Step S2 Perform DCT coefficient synthesis according to the picture stitching mode.
  • the DCT coefficient here is the inverse quantized DC coefficient and AC coefficient in step S1.
  • the DCT coefficients of each pixel block include a DC coefficient and 63 AC coefficients, which are scanned according to JPEG raster.
  • the order of the pixel blocks of Picture 1 and Picture 2 changes in the stitched composite picture. As shown in the horizontal stitching mode of Figure 6b, the first line of picture 2 becomes the second half of the first line of the composite picture, the first line of picture 1 becomes the first half of the first line of the composite picture, and so on; One column becomes the k+1th column of the composite picture, the second column becomes the k+2 column of the composite picture, and so on.
  • the previous adjacent pixel block of each pixel block in the first column of the picture 2 has changed, and the first adjacent pixel block of the first pixel block of the first picture of the picture 1 has not changed except the previous pixel block of the first pixel block.
  • An adjacent block of pixels has also changed.
  • the first row of the picture 2 is connected to the last row of the picture 1, and the first pixel block of the picture 2 changes in the previous pixel block in the composite picture, while the other pixel blocks The previous adjacent pixel block has not changed.
  • DCT coefficient synthesis is performed according to the picture stitching mode, that is, the DC coefficient and the AC coefficient of the picture block 1 and the picture 2 pixel block are rearranged according to the JPEG raster scan order according to the spliced mode.
  • the splicing mode has the horizontal splicing mode of Fig. la, and the corresponding raster scanning is shown in Fig. 6b; the splicing mode also has the vertical splicing mode as shown in Fig. lb, and the corresponding raster scanning is shown in Fig. 6c.
  • the previous adjacent pixel block of the partial pixel block in the composite picture changes, so the corresponding DC coefficient changes according to the differential pulse modulation coding method.
  • Step S3 performing quantization, DC prediction, AC/DC coefficient coding, and entropy coding on the synthesized DCT coefficients to form a bit stream of the synthesized picture.
  • the original JPEG picture is incompletely decoded, and the synthesis is not performed at the YUV level, but is synthesized at the DCT coefficient level.
  • the IDCT transform of the decoding process and the DCT transform in the encoding process are saved, and the computing resources are saved.
  • the format of the picture is generally the same, and the information of the header of the JPEG picture file is generally the same.
  • the head of the picture file is reserved as a composite picture. The head, and the information about the image height and image width in the head is modified to the height and width information of the composite picture.
  • the electronic police or bayonet subsystem In addition to the picture synthesis service, the electronic police or bayonet subsystem also needs to add some intelligent recognition results, time, space and other OSD information to the composite picture.
  • OSD information is superimposed on pictures
  • OSD information is superimposed on the obtained YUV plane, and then encoded according to the JPEG standard encoding process, and a new one is obtained.
  • Added JPEG image of OSD is proposed, as shown in FIG. 8, including steps:
  • Step S801 performing entropy decoding, AC/DC coefficient decoding, inverse DC prediction, and inverse quantization on the JPEG picture bit data stream to be superimposed on the OSD information, to obtain a DCT coefficient.
  • the JPEG picture of the OSD information to be superimposed is subjected to standard JPEG decoding, and then the OSD information is superimposed on the YUV plane.
  • the JPEG picture to be superimposed on the OSD information is processed only to the DCT coefficient plane.
  • Step S802 Extract the area where the OSD information needs to be superimposed, and perform IDCT transformation to the data of the YUV plane, and superimpose the OSD information on the YUV plane data, and then perform DCT transformation.
  • the OSD information is superimposed on the JPEG picture, and the area in which the OSD information is superimposed has a clear coordinate indication, so the area in which the OSD information is superimposed is an area with a clear boundary on the JPEG picture.
  • the IDCT transform is continued, that is, the entire JPEG decoding process is completed, and the data of the region in the YUV plane is obtained.
  • the superposition of the OSD information is then performed on the YUV plane data of the area.
  • the JPEG picture is subjected to entropy decoding, AC/DC coefficient decoding, inverse DC prediction, and inverse quantization, and then only the IDCT change is performed on the area in which the OSD information needs to be superimposed, and the DCD conversion is performed after the OSD information is superimposed on the YUV plane. DCT coefficient.
  • IDCT and DCT conversion instead of performing full JPEG decoding and encoding on the entire JPEG picture, which reduces the computational effort.
  • each pixel block in the JPEG picture is scanned and encoded in raster order, and the JPEG picture file has a strict file format.
  • the JPEG picture file header contains the height and width information of the image.
  • the header of the JPEG picture file is first decoded, so that the height and width information of the image is known.
  • the code stream position including DC and AC position
  • length to each pixel block. Therefore, the pixel blocks therein can be directly operated according to the coordinates of the area in which the OSD information needs to be superimposed, and will not be described below.
  • Step S803 synthesizing the DCT coefficients of the DCT coefficients superimposed with the OSD information and the DCT coefficients of the non-superimposed regions.
  • the superposition of the OSD information is completed, and the DCT coefficients of the superimposed OSD information area are formed after the DCT transformation, and the DCT coefficients of the DCT coefficients and the non-superimposed regions are combined.
  • the area where the OSD information is superimposed does not change the relative position of the DCT coefficients of each pixel block obtained by superimposing the OSD information in the picture, so the newly obtained DCT coefficients are arranged in the original position.
  • the non-overlapping area refers to an area other than the OSD area superimposed on the JPEG picture.
  • Step S804 Perform quantization, DC prediction, AC/DC coefficient coding, and entropy coding on the synthesized DCT coefficients to form a bit stream of the synthesized picture.
  • JPEG decoding is performed on the area where the OSD information needs to be superimposed, and a YUV sub-picture is obtained.
  • the DCT transform is performed again; for the non-OSD superimposed area, only entropy decoding, AC/DC coefficient decoding, Anti-DC prediction and inverse quantization, and then DCT coefficient synthesis is performed with the region where the OSD is superimposed, and finally the remaining JPEG encoding steps are performed on the synthesized DCT coefficient picture: quantization, DC prediction, AC/DC coefficient coding, and entropy coding.
  • the present invention also proposes a device for realizing JPEG picture synthesis by using the above JPEG picture synthesis method.
  • a JPEG picture synthesis device includes:
  • a DCT decoding module 901 configured to perform entropy decoding on a bit stream of a JPEG picture to be synthesized, AC/DC coefficient decoding, inverse DC prediction, and inverse quantization.
  • the DCT coefficient synthesis module 902 is configured to perform DCT coefficient synthesis according to the JPEG raster scan order.
  • the encoding module 903 is configured to perform re-quantization, DC prediction, AC/DC coefficient encoding, and entropy encoding on the synthesized DCT coefficients to form a synthesized JPEG bit data stream.
  • the DCT decoding module 901 further includes an entropy decoding unit, an AC/DC coefficient decoding unit, an inverse DC prediction unit, and an inverse quantization unit, respectively performing entropy decoding, AC/DC coefficient decoding, and inputting the JPEG bit data stream according to the JPEG standard.
  • Anti-DC prediction and inverse quantization The encoding module 903 further includes a quantization unit, a DC prediction unit, an AC/DC coefficient encoding unit, and an entropy encoding unit for performing quantization, DC prediction, AC/DC coefficient encoding, and entropy encoding on the input DCT coefficient picture according to the JPEG standard, respectively.
  • the present invention also provides an apparatus for superimposing OSD information of a JPEG picture, the apparatus comprising:
  • the DCT decoding module is configured to perform entropy decoding, AC/DC coefficient decoding, inverse DC prediction, and inverse quantization on the JPEG picture bit data stream to which the OSD information is superimposed, to obtain a DCT coefficient.
  • the OSD information superimposing module is configured to extract the DCT coefficients of the region in which the OSD information needs to be superimposed and perform IDCT transformation to the YUV plane data, and superimpose the OSD information on the YUV plane data, and then perform DCT transformation to obtain a DCT coefficient.
  • the DCT coefficient synthesis module is configured to perform DCT coefficient synthesis on the DCT coefficient superimposed with the OSD information and the DCT coefficient of the non-superimposed region.
  • an encoding module configured to perform quantization, DC prediction, AC/DC coefficient encoding, and entropy encoding on the synthesized DCT coefficients to form a bit stream of the synthesized picture.
  • the DCT coefficient of the area in which the OSD information superimposing module extracts the OSD information is extracted, and is extracted from the DCT coefficients of the JPEG picture according to the coordinate information of the area on the JPEG picture that needs to be superimposed with the OSD information.
  • the OSD information superimposition module 904 includes a control unit, an IDCT transform unit, an OSD superimposing unit, and a DCT transform unit.
  • the control unit extracts DCT coefficients of the pixel block of the OSD information area, and inputs the IDCT transform unit to perform IDCT transformation, and then performs OSD in the OSD superimposing unit.
  • the information is superimposed and finally transformed into a DCT coefficient picture by the DCT transform unit.
  • the hardware architecture includes a processor and a non-volatile memory that stores a number of computer instructions.
  • the synthesized DCT coefficients are quantized, DC predicted, AC/DC coefficient encoded, and entropy encoded to form a bit stream of the synthesized picture.
  • the header of the first picture or the second picture is reserved as the header of the composite picture, and the image height and width information in the header is modified to be the image height and width information of the composite picture.
  • the computer instructions stored in the non-volatile memory are executed by the processor as follows:
  • the JPEG picture bit data stream to which the OSD information is superimposed is subjected to entropy decoding, AC/DC coefficient decoding, inverse DC prediction, and inverse quantization to obtain a DCT coefficient;
  • the DCT coefficient superimposed with the OSD information and the DCT coefficient of the non-superimposed region are subjected to DCT coefficient synthesis;
  • the synthesized DCT coefficients are quantized, DC predicted, AC/DC coefficient encoded, and entropy encoded to form a bit stream of the composite picture.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Discrete Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

一种JPEG图片的合成方法,叠加OSD信息的方法及装置。该合成方法对第一图片和第二图片的JPEG位数据流进行熵解码、AC/DC系数解码、反DC预测和反量化,然后根据图片拼接模式按照JPEG光栅扫描顺序进行DCT系数合成,再进行量化、DC预测、AC/DC系数编码和熵编码形成合成图片的JPEG位数据流。对于叠加OSD信息,仅对需要叠加OSD信息的区域进行IDCT变化,在YUV平面进行OSD信息的叠加后再进行DCT变换为DCT系数,将该DCT系数与非叠加区域的DCT系数进行DCT系数的合成。本方法和装置不需要对整个JPEG图片进行IDCT变换和DCT变换,计算量小,合成效率高。

Description

一种 JPEG图片的合成方法及叠加 OSD信息的方法及装置 技术领域 本发明涉及图像处理技术领域, 尤其涉及 JPEG图片的合成方法, 叠加 OSD信息的方法及装置。 背景技术 智能交通系统 ITS ( Intelligent Transport System ) 中的电子警察子系统和卡 口子系统中, 前端设备通过捕获路口违章车辆图片来完整记录其违章过程以及 放大特写的车牌。 通常, 对某一具体的车辆的几张图片一般合成为一张大分辨 率图片进行保存。
前端设备抓拍的单张图片和合成图片格式都是 JPEG ( Joint Photographic Experts Group )格式。 视具体应用, 图片合成的模式各异。 图 1~图 3分别给出 了两张图片、 三张图片、 四张图片合成的例子。 图 1由两张 JPEG图片合成为一 张图片: 图 la为两张图片竖直方向合成, 此时两张图片宽度相同, 且等于合成 图片宽度; 图 lb两张图片按照水平方向合成, 此时两张图片高度相同, 且等于 合成图片高度。
图 2由三张图片合成: 图 2a中图片 2和图片 3高度相同, 首先水平方向合 成, 然后合成图片再和图片 1按照竖直方向合成; 图 2b中图片 2和图片 3宽度 相同, 首先按照竖直方向合成, 然后合成图片再和图片 1按照水平方向合成。
图 3由 4张图片合成: 图 3a中图片 2、 图片 3和图片 4高度相同, 首先按 照水平方向合成, 然后合成图片进一步和图片 1竖直方向合成; 图 3b中图片 2、 图片 3和图片 4宽度相同, 首先按照竖直方向合成, 然后合成图片进一步和图 片 1水平方向合成。
在现有的 JPEG图片合成中, 首先需要把待合成的 JPEG图片分别解码, 得 到每个图片的 YUV格式, 然后把每个 YUV格式图片按照合成模式进行合成, 合成后再进行 JPEG编码。 以两个 JPEG图片合成为例,如图 4所示, 两个 JPEG 图片分别按照 JPEG标准的解码流程(熵解码-〉 AC/DC系数解码-〉反 DC预测-〉 反量化 -〉IDCT )解码得到 YUV图片, 然后按照合成模式, 对 YUV图片进行合 成,合成完毕后,再按照 JPEG标准的编码流程(DCT -〉量化-〉 DC预测-〉 AC/DC 系数编码-〉熵编码 )得到合成的 JPEG图片。
由于待合成图片分辨率一般为 200万或者 500万, 若两个图片合成的话, 则相当于进行 400万或者 1000万像素图片的解码和编码操作。 若 4个图片合成 的话, 则相当于进行 800万或 2000万像素图片的解码和编码。 可见 JPEG解码 和编码的计算量非常大。 在后端服务器通用 CPU上运行时, 这是一个巨大的性 能瓶颈。 同时解码后再编码, 也会造成图片质量降低。
在电子警察或者卡口子系统中除了图片合成外, 还需要在合成图片中添加 一些 OSD ( On Screen Display )信息, 例如增加智能识别结果的 OSD信息、 时 间或所在地区的 OSD信息等。 这些信息往往是在图片 JPEG编码完成之后需要 叠加的, 如图 5a所示的 OSDl。 此外, 在视频监控系统中, 按照国家标准, 下 级部门把本辖区内釆集的 JPEG图片上报给上级部门时,通常需要在图片上添加 本地区 OSD信息, 如图 5b所示, JPEG图片已经存在 OSD2, 在上传到上一级 部门时需要添加 OSDl。 对合成的 JPEG图片后期叠加 OSD来说, 同样的也需 要对 JPEG图片按照标准的解码流程解码后, 在得到的 YUV平面进行 OSD信 息叠加; 完毕后再按照 JPEG标准的编码流程进行编码, 得到新的添加了 OSD 的 JPEG图片。 现有的 OSD叠加方案, 需要进行整幅图片解码再编码, 不仅计 算量耗费, 同时也带来了整个图片由于解码和编码的操作带来的图片质量降低。 发明内容
本发明的目的是针对现有技术 JPEG图片合成时计算量大,合成图片质量降 低的技术问题, 提出一种 JPEG图片的合成方法, 叠加 OSD信息的方法及装 置, 降低了合成图片时的计算量。 为了实现上述发明目的, 本发明的技术方案如下:
一种 JPEG图片合成方法,用于合成第一图片和第二图片,该方法包括步骤: 对第一图片和第二图片的 JPEG位数据流进行熵解码、 AC/DC系数解码、 反 DC预测和反量化, 得到 DCT系数;
根据图片拼接模式进行 DCT系数合成;
对合成后的 DCT系数进行量化、 DC预测、 AC/DC系数编码和熵编码, 形 成合成图片的位数据流。
进一步地, 所述 JPEG图片合成方法还包括步骤:
保留第一图片或第二图片的头部作为合成图片的头部, 并修改头部中的图 像高度和宽度信息为合成图片的图像高度和宽度信息。 在智能交通系统 ITS中, 图片的格式一般是相同的, 其 JPEG图片文件头部的信息一般也是相同的,在进 行 JPEG图片合成时, 保留一个图片文件的头部作为合成图片的头部。
进一步地, 所述根据图片拼接模式进行 DCT系数合成具体为根据图片拼接 模式按照 JPEG光栅扫描顺序对所述第一图片和第二图片的 DCT系数进行排列。 图片拼接模式有水平拼接模式和垂直拼接模式,根据不同的拼接模式,按照 JPEG 光栅扫描顺序排列 DCT系数, 对于垂直拼接模式, 第二图片的 DCT系数排列 在第一图片的最后一行之后; 对于水平拼接模式, 合成图片的 DCT系数第 n行 的前半行是第一图片的第 n行的 DCT系数, 合成图片的 DCT系数第 n行的后 半行是第二图片的第 n行的 DCT系数。
本发明还提出了一种 JPEG图片叠加 OSD信息的方法, 该方法包括步骤: 对待叠加 OSD信息的 JPEG图片位数据流进行熵解码、 AC/DC系数解码、 反 DC预测和反量化, 得到 DCT系数;
抽取需要叠加 OSD信息的区域的 DCT系数进行 IDCT变换到 YUV平面数 据, 在 YUV平面数据上叠加 OSD信息后再进行 DCT变换;
将叠加了 OSD信息的 DCT系数与非叠加区域的 DCT系数进行 DCT系数 合成; 对合成的 DCT系数进行量化、 DC预测、 AC/DC系数编码和熵编码, 形成 合成图片的位数据流。
所述抽取需要叠加 OSD信息的区域的 DCT系数,是根据所述 JPEG图片上 需要叠加 OSD信息的区域的坐标信息,从所述 JPEG图片的 DCT系数中进行抽 取的。
本发明同时提出的一种 JPEG图片合成装置, 包括处理器以及存储有若干 计算机指令的非易失性存储器, 该些计算机指令被处理器执行时执行如下处 理: 对第一图片和第二图片的 JPEG位数据流进行熵解码、 AC/DC系数解码、 反 DC预测和反量化, 得到 DCT系数;
根据图片拼接模式进行 DCT系数合成;
对合成后的 DCT系数进行量化、 DC预测、 AC/DC系数编码和熵编码, 形 成合成图片的位数据流。
该些计算机指令被处理器执行时还执行如下处理:
保留第一图片或第二图片的头部作为合成图片的头部, 并修改头部中的图 像高度和宽度信息为合成图片的图像高度和宽度信息。
本发明同时还提出一种 JPEG图片叠加 OSD信息的装置, 包括处理器以及 存储有若干计算机指令的非易失性存储器, 该些计算机指令被处理器执行时 执行如下处理: 对待叠加 OSD信息的 JPEG图片位数据流进行熵解码、 AC/DC 系数解码、 反 DC预测和反量化, 得到 DCT系数;
抽取需要叠加 OSD信息的区域的 DCT系数进行 IDCT变换到 YUV平面数 据, 在 YUV平面数据上叠加 OSD信息后再进行 DCT变换;
将叠加了 OSD信息的 DCT系数与非叠加区域的 DCT系数进行 DCT系数 合成;
对合成的 DCT系数进行量化、 DC预测、 AC/DC系数编码和熵编码, 形成 合成图片的位数据流。
所述抽取需要叠加 OSD信息的区域的 DCT系数,是根据所述 JPEG图片上 需要叠加 OSD信息的区域的坐标信息,从所述 JPEG图片的 DCT系数中进行抽 取的。
本发明提出的一种 JPEG图片合成、叠加 OSD信息方法及装置,通过对 JPEG 图片位数据流进行熵解码、 AC/DC系数解码、 反 DC预测和反量化, 在 DCT系 数平面根据拼接模式按照 JPEG光栅扫描顺序进行 DCT系数合成, 然后进行量 化、 DC预测、 AC/DC系数编码和熵编码, 形成 JPEG图片位数据流。 对于叠加 OSD信息, 对 JPEG图片进行熵解码、 AC/DC系数解码、 反 DC预测和反量化, 然后仅对需要叠加 OSD信息的区域进行 IDCT变化, 在 YUV平面进行 OSD信 息的叠加后再进行 DCT变换为 DCT系数,将该 DCT系数与非叠加区域的 DCT 系数进行 DCT系数的合成, 对合成的 DCT系数进行量化、 DC预测、 AC/DC 系数编码和熵编码, 形成合成图片的位数据流。 本发明在 DCT系数平面完成图 片的合成, 不需要对整个 JPEG图片进行 IDCT变换和 DCT变换, 计算量小, 合成效率高。 附图说明
图 la为竖直方向两张 JPEG图片合成的模式;
图 lb为水平方向两张 JPEG图片合成的模式;
图 2a为竖直方向三张 JPEG图片合成的模式;
图 2b为水平方向三张 JPEG图片合成的模式;
图 3a为竖直方向四张 JPEG图片合成的模式;
图 3b为水平方向四张 JPEG图片合成的模式;
图 4为现有技术 JPEG图片合成编解码算法示意图;
图 5a为 JPEG图片叠加 OSD信息示意图;
图 5b为 JPEG图片叠加 OSD信息示意图;
图 6a为 JPEG图片光栅扫描示意图;
图 6b为水平拼接 JPEG图片光栅扫描示意图; 图 6c为垂直拼接 JPEF图片光栅扫描示意图;
图 7为本发明实施例 JPEG合成方法示意图;
图 8为本发明实施例叠加 OSD信息方法示意图;
图 9为本发明实施例 JPEG合成装置结构示意图;
图 10为本发明实施例 JPEG图片合成装置和 JPEG图片叠加 OSD信息 装置的硬件架构图。 具体实施方式
下面结合附图和实施例对本发明技术方案做进一步详细说明, 以下实施 例不构成对本发明的限定。
由于 JPEG编码标准中对图片中的所有 8x8像素块 (以下简称像素块) 按照从左到右,从上到下的光栅扫描顺序进行编码,对其中一个像素块来说, DCT变换后, 形成一个 DC系数和 63个 AC系数, 对 DC系数和 AC系数分 别进行量化,然后进行 DC预测,再进行 AC系数和 DC系数编码(简称 AC/DC 系数编码) , 最后进行熵编码形成位数据流。 其中 DC预测就是计算 DC系 数量化值 DCn 与按照光栅扫描顺序前一个相邻像素块的 DC 系数量化值 DCn-1的残差, 即 diff=DCn-DCn-l ; 对图片中的首个像素块, 由于其没有前 一个相邻像素块, 此时的前一个相邻像素块的 DC 系数量化值取缺省值 default, 即 diff=DCl -default, 其中 DC1为首个像素块的 DC系数量化值。 而 对 DC 系数编码是釆用差分脉冲调制编码 DPCM ( Differential Pulse Code Modulation ) , 对 AC 系数编码是釆用行程长度编码 RLE ( Run-Length Encoding )。 JPEG图片解码过程是上述编码过程的反向过程, 即先进行熵解 码, 然后进行 AC系数和 DC系数解码(简称 AC/DC系数解码 ) , 再进行反 DC预测, 再对 AC系数和 DC系数分别进行反量化, 最后进行 IDCT变换, 其中反 DC预测就是根据 DCn=diff+DCn-l来计算 DC系数量化值。
假设待合成的图片 1和图片 2每行都有 K个 8x8像素块, 每列有 M个 8x8像素块, 则图片 1光栅扫描顺序如图 6a所示。 两个图片进行拼接后, 如 果按照水平拼接模式,其对应的光栅扫描如图 6b所示; 如果按照垂直拼接模 式, 其对应的光栅扫描如图 6c所示。
需要说明的是, ITS 系统中的图片都是釆用 JPEG格式进行保存, 且图 片的大小相同。但本发明不限于相同大小的图片拼接,对于不同大小的 JPEG 图片, 按照拼接的模式根据光栅扫描顺序排列即可。
可见拼接后图片 1、 图片 2的像素块在合成图片中的排列次序相对于原 图片发生了变化。 由于像素块排列次序发生变化将导致像素块的 DC系数编 码发生了变化, 因此可以通过对图片像素块的 DC系数进行重新编码, 并重 组位数码流完成图片的拼接。
本发明根据上述的图片合成特点,对待合成图片 1和图片 2进行熵解码、 AC/DC系数解码、 反 DC预测、 反量化后, 在 DCT系数平面对图片进行合 成, 然后重新进行量化、 DC预测、 AC/DC系数编码、 熵编码, 形成合成的 图片。
图 7为本发明实施例 JPEG图片合成方法流程图, 包括步骤:
步骤 Sl、 对待合成的图片 1 和图片 2的 JPEG位数据流进行熵解码、 AC/DC系数解码、 反 DC预测和反量化, 得到 DCT系数。
ITS系统中的图片都是釆用 JPEG格式进行保存,保存的 JPEG图片是经 过熵编码后的 JPEG位数据流( JPEG bitstream ) , 因此需要进行图片 1和图 片 2的合成时, 首先需要对图片 1和图片 2进行熵解码, 传统的方法是对待 合成的图片 1和图片 2进行标准的完全 JPEG解码,然后在 YUV平面上进行 合成。 而本发明仅对待合成图片 1和图片 2进行熵解码、 AC/DC系数解码、 反 DC预测、 反量化得到 DCT系数。
步骤 S2、 根据图片拼接模式进行 DCT系数合成。
这里的 DCT系数即为步骤 S1中的反量化后的 DC系数和 AC系数。 每 个像素块的 DCT系数包括一个 DC系数和 63个 AC系数,按照 JPEG光栅扫 描标准, 图片 1和图片 2的像素块在拼接后的合成图片中的顺序位置发生了 变化。如图 6b的水平拼接模式, 图片 2的第一行成为了合成图片第一行的后 半行, 图片 1 的第一行成为了合成图片第一行的前半行, 依此类推; 图片 2 第一列成为了合成图片的第 k+1列, 第二列成为了合成图片的第 k+2列, 以 此类推。 图片 2第一列的每一个像素块的前一个相邻像素块均发生了变化, 同时图片 1第一列除首个像素块的前一个相邻像素块未发生变化外, 其他像 素块的前一个相邻像素块也发生了变化。如图 6c所示的垂直拼接模式, 图片 2的第一行接在图片 1的最后一行之后, 图片 2的首个像素块在合成图片中 其前一个像素块发生了变化, 而其他像素块的前一个相邻像素块均未发生变 化。
本步骤根据图片拼接模式进行 DCT系数合成即对图片 1和图片 2像素块 的 DC系数和 AC系数根据拼接的模式按照 JPEG光栅扫描顺序进行重新排 列。 拼接的模式有图 la的水平拼接模式, 其对应的光栅扫描如图 6b所示; 拼接的模式还有如图 lb的垂直拼接模式, 其对应的光栅扫描如图 6c所示。
经过按照 JPEG光栅扫描顺序重新排列后, 合成图片中部分像素块的前 一个相邻像素块发生了变化, 因此其对应的 DC系数按照差分脉冲调制编码 方法也会发生改变。
步骤 S3、 对合成后的 DCT系数进行量化、 DC预测、 AC/DC系数编码 和熵编码, 形成合成图片的位数据流。
在重新排列后, 按照新排列的像素块顺序, 进行量化和 DC预测, 就能 够对合成图片进行正确的 DC预测, 然后进行 AC/DC系数编码和熵编码, 并 按照光栅扫描顺序形成合成图片的位数据流, 完成图片合成。
可见本发明实施例在图片拼接时, 对原 JPEG图片进行非完全解码, 合 成时也不是在 YUV层面进行, 而是在 DCT 系数层面进行合成。 相比标准 JPEG编解码, 节省了解码过程的 IDCT变换和编码过程中的 DCT变换, 节 省了计算资源。 需要说明的是, 在智能交通系统 ITS中, 图片的格式一般是相同的, 其 JPEG图片文件头部的信息一般也是相同的, 在进行 JPEG图片合成时, 保留 一个图片文件的头部作为合成图片的头部, 并把头部中有关图像高度和图像 宽度的信息修改为合成图片的高度和宽度信息。
在电子警察或者卡口子系统中除了图片合成业务外, 还需要在合成图片 中添加一些智能识别结果、 时间、 空间等 OSD信息。 在图片上叠加 OSD信 息在现有技术中通常是对 JPEG图片按照标准的解码流程解码后, 在得到的 YUV平面进行 OSD信息的叠加, 完毕后再按照 JPEG标准的编码流程进行 编码, 得到新的添加了 OSD的 JPEG图片。 本实施例运用基于上述 JPEG图 片合成方法的原理,提出一种 JPEG图片叠加 OSD信息的方法,如图 8所示, 包括步骤:
步骤 S801、对待叠加 OSD信息的 JPEG图片位数据流进行熵解码、 AC/DC 系数解码、 反 DC预测和反量化, 得到 DCT系数。
与现有技术将待叠加 OSD信息的 JPEG图片进行标准的 JPEG解码, 然 后在 YUV平面上进行叠加 OSD信息不同的是, 本实施例对待叠加 OSD信 息的 JPEG图片仅处理到 DCT系数平面。
步骤 S802、抽取需要叠加 OSD信息的区域进行 IDCT变换到 YUV平面 的数据, 在 YUV平面数据上叠加 OSD信息后再进行 DCT变换。
在 JPEG图片上叠加 OSD信息, 叠加 OSD信息的区域都有明确的坐标 标示, 因此叠加 OSD信息的区域在 JPEG图片上是一个有明确界限的区域。 对于该区域在进行熵解码、 AC/DC系数解码、反 DC预测和反量化的基础上, 继续进行 IDCT变换, 即完成整个 JPEG解码流程, 得到该区域在 YUV平面 的数据。 然后在该区域的 YUV平面数据上进行 OSD信息的叠加。
本实施例对于 JPEG图片进行熵解码、 AC/DC系数解码、 反 DC预测和 反量化, 然后仅对需要叠加 OSD信息的区域进行 IDCT变化, 在 YUV平面 进行 OSD信息的叠加后再进行 DCT变换为 DCT系数。 显然仅对需要叠加 OSD信息的区域进行了 IDCT和 DCT变换, 而非对整个 JPEG图片都进行完 全的 JPEG解码和编码, 降低了计算工作量。
需要说明的是, JPEG 图片中每个像素块按照光栅顺序扫描编码, 同时 JPEG图片文件有严格的文件格式。 JPEG图片文件头部包含图像的高度和宽 度信息, 在解码 JPEG图片时, 首先就要解码 JPEG图片文件的头部, 从而 知道图像的高度和宽度信息, 按照 JPEG码流标准格式, 就会依次寻找到每 个像素块的码流位置 (包含 DC和 AC位置 ) 和长度。 因此可以根据需要叠 加 OSD信息的区域的坐标直接对其中的像素块进行操作, 以下不再赘述。
步骤 S803、 将叠加了 OSD信息的 DCT系数与非叠加区域的 DCT系数 进行 DCT系数合成。
上一步骤完成了 OSD信息的叠加, 并进行 DCT变换后形成了叠加 OSD 信息区域的 DCT系数,将这些 DCT系数与非叠加区域的 DCT系数进行 DCT 系数的合成。 叠加 OSD信息的区域在叠加 OSD信息后所得到的各像素块的 DCT系数在图片中的相对位置并没有发生改变, 所以新得到的这些 DCT系 数被排列进了原来的位置。其中非叠加区域是指 JPEG图片上叠加 OSD区域 以外的区域。
步骤 S804、 对合成的 DCT系数进行量化、 DC预测、 AC/DC系数编码 和熵编码, 形成合成图片的位数据流。
可见, 对需要叠加 OSD信息的区域进行 JPEG解码, 得到 YUV子图, 在 YUV子图上叠加 OSD信息后,重新进行 DCT变换;对非 OSD叠加区域, 只进行熵解码、 AC/DC 系数解码、 反 DC预测和反量化, 然后和叠加 OSD 的区域进行 DCT系数合成, 最后对合成的 DCT系数图片进行剩余的 JPEG 编码步骤: 量化、 DC预测、 AC/DC系数编码和熵编码。
本发明还提出了釆用上述 JPEG图片合成方法用来实现 JPEG图片合成的 装置, 如图 9所示, 一种 JPEG图片合成装置, 包括:
DCT解码模块 901, 用于对待合成的 JPEG图片的位数据流进行熵解码、 AC/DC系数解码、 反 DC预测和反量化。
DCT系数合成模块 902, 用于根据 JPEG光栅扫描顺序进行 DCT系数合 成。
编码模块 903,用于对合成后的 DCT系数重新进行量化、 DC预测、 AC/DC 系数编码和熵编码, 形成合成的 JPEG位数据流。
进一步地, DCT解码模块 901还包括熵解码单元、 AC/DC系数解码单元、 反 DC预测单元和反量化单元,分别按照 JPEG标准对输入的 JPEG位数据流 进行熵解码、 AC/DC系数解码、 反 DC预测和反量化。 编码模块 903还包括 量化单元、 DC预测单元、 AC/DC系数编码单元和熵编码单元,分别按照 JPEG 标准对输入的 DCT系数图片进行量化、 DC预测、 AC/DC系数编码和熵编码。
本发明还提供一种 JPEG图片叠加 OSD信息的装置, 该装置包括:
DCT解码模块,用于对待叠加 OSD信息的 JPEG图片位数据流进行熵解码、 AC/DC系数解码、 反 DC预测和反量化, 得到 DCT系数。
OSD信息叠加模块, 用于抽取需要叠加 OSD信息的区域的 DCT系数进行 IDCT变换到 YUV平面数据,在 YUV平面数据上叠加 OSD信息后再进行 DCT 变换, 得到 DCT系数。
DCT系数合成模块, 用于将叠加了 OSD信息的 DCT系数与非叠加区域的 DCT系数进行 DCT系数合成。
编码模块, 用于对合成的 DCT系数进行量化、 DC预测、 AC/DC系数编码 和熵编码, 形成合成图片的位数据流。
其中 OSD信息叠加模块在抽取需要叠加 OSD信息的区域的 DCT系数, 是 根据所述 JPEG图片上需要叠加 OSD信息的区域的坐标信息, 从所述 JPEG图 片的 DCT系数中进行抽取的。
OSD信息叠加模块 904 包括控制单元, IDCT 变换单元, OSD 叠加单 元, DCT变换单元。 控制单元抽取需要叠加 OSD信息区域像素块的 DCT系 数, 输入 IDCT变换单元进行 IDCT变换, 随后在 OSD叠加单元进行 OSD 信息叠加, 最后通过 DCT变换单元再次变换到 DCT系数图片。
请参图 10所示的 JPEG图片合成装置和 JPEG图片叠加 OSD信息装置 的硬件架构图。 该硬件架构包括处理器以及存储有若干计算机指令的非易失 性存储器。
对于 JPEG图片合成装置来说, 存储在非易失性存储器中的计算机指令 被处理器执行时执行如下处理:
对第一图片和第二图片的 JPEG位数据流进行熵解码、 AC/DC系数解码、 反 DC预测和反量化, 得到 DCT系数;
根据图片拼接模式进行 DCT系数合成;
对合成后的 DCT系数进行量化、 DC预测、 AC/DC系数编码和熵编码, 形 成合成图片的位数据流。
保留第一图片或第二图片的头部作为合成图片的头部, 并修改头部中的图 像高度和宽度信息为合成图片的图像高度和宽度信息。
对于 JPEG图片叠加 OSD信息装置来说, 存储在非易失性存储器中的计算 机指令被处理器执行时执行如下处理:
对待叠加 OSD信息的 JPEG图片位数据流进行熵解码、 AC/DC系数解码、 反 DC预测和反量化, 得到 DCT系数;
抽取需要叠加 OSD信息的区域的 DCT系数进行 IDCT变换到 YUV平面数 据, 在 YUV平面数据上叠加 OSD信息后再进行 DCT变换;
将叠加了 OSD信息的 DCT系数与非叠加区域的 DCT系数进行 DCT系数 合成;
对合成的 DCT系数进行量化、 DC预测、 AC/DC系数编码和熵编码, 形 成合成图片的位数据流。
以上所述仅为本发明的较佳实施例而已, 并不用以限制本发明, 凡在本 发明的精神和原则之内, 所做的任何修改、 等同替换、 改进等, 均应包含在 本发明保护的范围之内。

Claims

权利要求书
1、 一种 JPEG图片合成方法, 用于合成第一图片和第二图片, 其特征在于, 该方法包括步骤:
对第一图片和第二图片的 JPEG位数据流进行熵解码、 AC/DC系数解码、 反 DC预测和反量化, 得到 DCT系数;
根据图片拼接模式进行 DCT系数合成;
对合成后的 DCT系数进行量化、 DC预测、 AC/DC系数编码和熵编码, 形 成合成图片的位数据流。
2、 根据权利要求 1所述的 JPEG图片合成方法, 其特征在于, 所述 JPEG 图片合成方法还包括步骤:
保留第一图片或第二图片的头部作为合成图片的头部, 并修改头部中的图 像高度和宽度信息为合成图片的图像高度和宽度信息。
3、 根据权利要求 2所述的 JPEG图片合成方法, 其特征在于, 所述根据图 片拼接模式进行 DCT系数合成具体为根据图片拼接模式按照 JPEG光栅扫描顺 序对所述第一图片和第二图片的 DCT系数进行排列。
4、 根据权利要求 3所述的 JPEG图片合成方法, 其特征在于, 所述拼接模 式包括垂直拼接模式和水平拼接模式, 对于垂直拼接模式, 第二图片的 DCT系 数排列在第一图片的最后一行之后; 对于水平拼接模式, 合成图片的 DCT系数 第 n行的前半行是第一图片的第 n行的 DCT系数, 合成图片的 DCT系数第 n 行的后半行是第二图片的第 n行的 DCT系数。
5、 一种 JPEG图片叠加 OSD信息的方法, 其特征在于, 该方法包括步骤: 对待叠加 OSD信息的 JPEG图片位数据流进行熵解码、 AC/DC系数解码、 反 DC预测和反量化, 得到 DCT系数;
抽取需要叠加 OSD信息的区域的 DCT系数进行 IDCT变换到 YUV平面数 据, 在 YUV平面数据上叠加 OSD信息后再进行 DCT变换;
将叠加了 OSD信息的 DCT系数与非叠加区域的 DCT系数进行 DCT系数 合成;
对合成的 DCT系数进行量化、 DC预测、 AC/DC系数编码和熵编码, 形成 合成图片的位数据流。
6、 根据权利要求 5所述的图片叠加 OSD信息的方法, 其特征在于, 所述 抽取需要叠加 OSD信息的区域的 DCT系数,是根据所述 JPEG图片上需要叠加 OSD信息的区域的坐标信息, 从所述 JPEG图片的 DCT系数中进行抽取的。
7、 一种 JPEG图片合成装置, 包括处理器以及存储有若干计算机指令的 非易失性存储器, 其特征在于, 该些计算机指令被处理器执行时执行如下处 理:
对第一图片和第二图片的 JPEG位数据流进行熵解码、 AC/DC系数解码、 反 DC预测和反量化, 得到 DCT系数;
根据图片拼接模式进行 DCT系数合成;
对合成后的 DCT系数进行量化、 DC预测、 AC/DC系数编码和熵编码, 形 成合成图片的位数据流。
8、如权利要求 7所述的图片合成装置, 其特征在于, 该些计算机指令被处 理器执行时还执行如下处理:
保留第一图片或第二图片的头部作为合成图片的头部, 并修改头部中的图 像高度和宽度信息为合成图片的图像高度和宽度信息。
9、 如权利要求 7所述的图片合成装置, 其特征在于, 在根据图片拼接模式 进行 DCT系数合成时, 具体执行: 对于垂直拼接模式, 第二图片的 DCT系数 排列在第一图片的最后一行之后; 对于水平拼接模式, 将第一图片的第 n行的 DCT系数作为合成图片的 DCT系数第 n行的前半行, 将第二图片的第 n行的 DCT系数作为合成图片的 DCT系数第 n行的后半行。
10、一种 JPEG图片叠加 OSD信息的装置, 包括处理器以及存储有若干计 算机指令的非易失性存储器, 其特征在于, 该些计算机指令被处理器执行时 执行如下处理: 对待叠加 OSD信息的 JPEG图片位数据流进行熵解码、 AC/DC系数解码、 反 DC预测和反量化, 得到 DCT系数;
抽取需要叠加 OSD信息的区域的 DCT系数进行 IDCT变换到 YUV平面数 据, 在 YUV平面数据上叠加 OSD信息后再进行 DCT变换;
将叠加了 OSD信息的 DCT系数与非叠加区域的 DCT系数进行 DCT系数 合成;
对合成的 DCT系数进行量化、 DC预测、 AC/DC系数编码和熵编码, 形成 合成图片的位数据流。
11、 根据权利要求 10所述的图片叠加 OSD信息的装置, 其特征在于, 所 述抽取需要叠加 OSD信息的区域的 DCT系数,是根据所述 JPEG图片上需要叠 加 OSD信息的区域的坐标信息, 从所述 JPEG图片的 DCT系数中进行抽取的。
PCT/CN2014/085951 2013-09-05 2014-09-04 一种jpeg图片的合成方法及叠加osd信息的方法及装置 WO2015032339A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP14842007.8A EP3043313A4 (en) 2013-09-05 2014-09-04 COMPOSITE METHOD ASSOCIATED WITH JPEG IMAGES AND METHOD AND APPARATUS FOR OVERLAPING OSD INFORMATION
US14/914,319 US20160219307A1 (en) 2013-09-05 2014-09-04 Method for synthesizing jpeg images and method and apparatus for superimposing osd information onto jpeg image

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310399912.6A CN103489170B (zh) 2013-09-05 2013-09-05 一种jpeg图片合成、叠加osd信息方法及装置
CN201310399912.6 2013-09-05

Publications (1)

Publication Number Publication Date
WO2015032339A1 true WO2015032339A1 (zh) 2015-03-12

Family

ID=49829369

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/085951 WO2015032339A1 (zh) 2013-09-05 2014-09-04 一种jpeg图片的合成方法及叠加osd信息的方法及装置

Country Status (4)

Country Link
US (1) US20160219307A1 (zh)
EP (1) EP3043313A4 (zh)
CN (1) CN103489170B (zh)
WO (1) WO2015032339A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109565598A (zh) * 2016-05-11 2019-04-02 超威半导体公司 用于动态地拼接视频流的系统和方法

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103489170B (zh) * 2013-09-05 2017-01-11 浙江宇视科技有限公司 一种jpeg图片合成、叠加osd信息方法及装置
CN104244000B (zh) * 2014-09-19 2018-01-16 浙江宇视科技有限公司 一种jpeg图片快速拼接方法及装置
CN104506873A (zh) * 2014-12-24 2015-04-08 南京金智视讯技术有限公司 基于压缩域的快速jpg图像合成方法
CN107391052A (zh) * 2016-05-16 2017-11-24 山东新北洋信息技术股份有限公司 快递面单打印方法及装置
CN111510717B (zh) * 2019-01-31 2022-04-26 杭州海康威视数字技术股份有限公司 图像拼接方法和装置
CN112449185B (zh) * 2019-08-28 2022-01-25 腾讯科技(深圳)有限公司 视频解码方法、编码方法、装置、介质及电子设备
CN111968031A (zh) * 2020-07-14 2020-11-20 浙江大华技术股份有限公司 一种图像拼接方法、装置、存储介质及电子装置
CN113658085B (zh) * 2021-10-20 2022-02-01 北京优幕科技有限责任公司 图像处理方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1496608A (zh) * 2001-06-06 2004-05-12 ������������ʽ���� 解码装置、解码方法、查找表以及解码程序
CN1922859A (zh) * 2004-02-23 2007-02-28 Toa株式会社 图像压缩方法、图像压缩装置、图像传输系统、数据压缩预处理装置及计算机程序
CN101651821A (zh) * 2009-07-31 2010-02-17 中国科学技术大学 互动电视广告实现系统及方法
CN103413287A (zh) * 2013-08-27 2013-11-27 浙江宇视科技有限公司 一种jpeg图片合成方法及装置
CN103489170A (zh) * 2013-09-05 2014-01-01 浙江宇视科技有限公司 一种jpeg图片合成、叠加osd信息方法及装置

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6151420A (en) * 1995-12-15 2000-11-21 Polaroid Corporation Minimizing blocking artifacts in a filtered image
JP2000023167A (ja) * 1998-07-07 2000-01-21 Sony Corp 映像復号化装置とその方法、受信装置および再生装置
JP3680846B2 (ja) * 2003-05-28 2005-08-10 セイコーエプソン株式会社 動画像の圧縮装置及びそれを用いた撮像装置
JP2007243838A (ja) * 2006-03-10 2007-09-20 Toshiba Corp 情報転送装置、情報受信装置およびコンピュータプログラム
US8068693B2 (en) * 2007-07-18 2011-11-29 Samsung Electronics Co., Ltd. Method for constructing a composite image
US8090216B2 (en) * 2008-04-16 2012-01-03 Aptina Imaging Corporation Image noise level estimation from JPEG data
US8509518B2 (en) * 2009-01-08 2013-08-13 Samsung Electronics Co., Ltd. Real-time image collage method and apparatus
CN101707678B (zh) * 2009-12-11 2011-08-03 华亚微电子(上海)有限公司 Osd控制器
CN102572435B (zh) * 2012-01-16 2014-03-12 中南民族大学 基于压缩采样的视频编解码系统及其方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1496608A (zh) * 2001-06-06 2004-05-12 ������������ʽ���� 解码装置、解码方法、查找表以及解码程序
CN1922859A (zh) * 2004-02-23 2007-02-28 Toa株式会社 图像压缩方法、图像压缩装置、图像传输系统、数据压缩预处理装置及计算机程序
CN101651821A (zh) * 2009-07-31 2010-02-17 中国科学技术大学 互动电视广告实现系统及方法
CN103413287A (zh) * 2013-08-27 2013-11-27 浙江宇视科技有限公司 一种jpeg图片合成方法及装置
CN103489170A (zh) * 2013-09-05 2014-01-01 浙江宇视科技有限公司 一种jpeg图片合成、叠加osd信息方法及装置

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LIAO, HONGWEN ET AL.: "Face Recognition in Compressed Domain", ACTA SCIENTIARUM NATURALIUM UNIVERSITATIS SUNYATSENI, vol. 43, no. 5, 30 September 2004 (2004-09-30), pages 17 - 18, XP008179786 *
See also references of EP3043313A4 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109565598A (zh) * 2016-05-11 2019-04-02 超威半导体公司 用于动态地拼接视频流的系统和方法
EP3456048A4 (en) * 2016-05-11 2019-12-04 Advanced Micro Devices, Inc. SYSTEM AND METHOD FOR DYNAMIC STITCHING OF VIDEO STREAMS

Also Published As

Publication number Publication date
US20160219307A1 (en) 2016-07-28
EP3043313A4 (en) 2016-11-30
CN103489170B (zh) 2017-01-11
CN103489170A (zh) 2014-01-01
EP3043313A1 (en) 2016-07-13

Similar Documents

Publication Publication Date Title
WO2015032339A1 (zh) 一种jpeg图片的合成方法及叠加osd信息的方法及装置
Aghamaleki et al. Inter-frame video forgery detection and localization using intrinsic effects of double compression on quantization errors of video coding
TWI436286B (zh) 畫像解碼方法及裝置
US20100232504A1 (en) Supporting region-of-interest cropping through constrained compression
WO2021042957A1 (zh) 一种图像处理方法和装置
JPH10294947A (ja) 改善された効率のためにスキュードタイル記憶フォーマットを用いる動作補正を行うシステム及び方法
KR20190043469A (ko) 보조 프레임을 지원하는 비디오 코딩 포맷으로 비디오 스트림을 인코딩하기 위한 방법 및 인코더
US20180343470A1 (en) Method of using cube mapping and mapping metadata for encoders
JP2004242271A (ja) 動画像符号化方法、動画像復号方法、動画像符号化装置、及び動画像復号装置
JP2010212811A (ja) 動画像符号化装置及び動画像復号化装置
US20120027091A1 (en) Method and System for Encoding Video Frames Using a Plurality of Processors
JP2004336529A (ja) 動画データ処理装置及び方法並びにプログラム
TW201140557A (en) Moving image encoding method, moving image decoding method, moving image encoding device, and moving image decoding device
WO2006046550A1 (ja) 画像符号化方法および装置、ならびに画像復号方法および装置
WO2006100946A1 (ja) 画像信号再符号化装置及び画像信号再符号化方法
JP5037517B2 (ja) 動き及びテクスチャデータを予測する方法
JP4559811B2 (ja) 情報処理装置及び情報処理方法
JP2008053848A (ja) 画像処理装置及び画像処理方法
JP4448714B2 (ja) デジタル画像信号復号化装置及び復号化方法
JP4797999B2 (ja) 画像符号化・復号化装置
JP2009278179A (ja) 画像復号装置、画像復号方法、プログラム、及び、記録媒体
JP2006033142A (ja) 動画像符号化装置、動画像符号化方法、プログラム、記録媒体、画像処理装置、および画像処理システム
KR102127212B1 (ko) 다시점 영상 정보의 복호화 방법 및 장치
JP2002044669A (ja) 画像情報変換装置及び方法
JP2003179929A (ja) 画像復号化装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14842007

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2014842007

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2014842007

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 14914319

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE