WO2020156420A1 - 交通图像的拼接 - Google Patents

交通图像的拼接 Download PDF

Info

Publication number
WO2020156420A1
WO2020156420A1 PCT/CN2020/073762 CN2020073762W WO2020156420A1 WO 2020156420 A1 WO2020156420 A1 WO 2020156420A1 CN 2020073762 W CN2020073762 W CN 2020073762W WO 2020156420 A1 WO2020156420 A1 WO 2020156420A1
Authority
WO
WIPO (PCT)
Prior art keywords
images
image
multiple traffic
traffic images
splicing
Prior art date
Application number
PCT/CN2020/073762
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 杭州海康威视数字技术股份有限公司
Publication of WO2020156420A1 publication Critical patent/WO2020156420A1/zh

Links

Images

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/46Embedding additional information in the video signal during the compression process
    • 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
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/23424Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving splicing one content stream with another content stream, e.g. for inserting or substituting an advertisement
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44016Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving splicing one content stream with another content stream, e.g. for substituting a video clip
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • H04N7/181Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast for receiving images from a plurality of remote sources

Definitions

  • the present disclosure relates to the field of image processing technology, in particular to the stitching of traffic images.
  • the method of stitching multiple JPEG images generally includes: First, the compressed code stream of multiple images is decoded by a JPEG decoder, and the reconstructed image of each image in the spatial domain is decoded. ; Then, all reconstructed images are spliced by a spatial domain image splicing device to obtain a super large image; finally, the super large image is encoded by a JPEG encoder to generate a compressed bit stream corresponding to the super large image. Therefore, when the super-large image needs to be viewed again in the future, there is no need to go through the splicing process, but the compressed code stream corresponding to the super-large image is directly decoded through the JPEG decoder.
  • the compressed code streams of multiple images must be decoded one by one and converted into reconstructed images such as YUV or RGB in the spatial domain before splicing all reconstructed images into super large images.
  • the super large image generated by splicing also needs to be encoded to form a corresponding compressed code stream. Therefore, in the current splicing process of multiple JPEG images, whether it is decoding, encoding, or splicing of spatial domain images, it needs to consume more memory and computing resources of hardware equipment, and increase the power consumption and operation of hardware equipment. Time brings a greater burden to hardware equipment. Moreover, the burden increases as the resolution of the image increases.
  • the present disclosure provides a system and method for splicing traffic images.
  • the first aspect of the present disclosure provides a traffic image splicing system.
  • the system includes: an image acquisition device for acquiring multiple traffic images and transmitting the multiple traffic images to the splicing device; the splicing device uses To splice the compressed code streams of the multiple traffic images to obtain a target code stream of the mosaic image obtained by splicing at least along the width direction of the image; the compressed code streams of the multiple traffic images are at the same restart interval Coded.
  • the target code stream corresponding to the mosaic image is obtained by directly splicing the compressed code streams of multiple traffic images with the same restart interval.
  • the comparison of multiple traffic images is omitted. Steps such as decoding the compressed code stream, splicing all the reconstructed images in the spatial domain obtained by decoding, and encoding the spliced image; thus realizing the rapid splicing of multiple compressed code streams and saving the memory of the hardware device And computing resources, improve the computing efficiency of hardware devices, reduce the power consumption of hardware devices, and reduce the computing burden of the CPU; in addition, compared to the prior art, which can only stitch multiple images with the same resolution along the image height direction, the present disclosure
  • the embodiment can also be applied to the stitching of multiple traffic images with different resolutions, and has a very flexible stitching method-it can realize the horizontal stitching of multiple traffic images, the vertical stitching of multiple traffic images, and Realizing the horizontal and vertical combined splicing of multiple traffic images can better meet the demand for
  • the multiple traffic images are captured by the image acquisition device when the vehicle is in violation of regulations; the multiple traffic images include any one of the following: at least N captured images of the vehicle not driving in a guide lane ; At least N captured images of the vehicle speeding; at least N captured images of the vehicle running through a red light; at least N captured images of the vehicle moving backward; at least N captured images of the vehicle changing lanes with solid lines; at least N captured images of illegal parking; Among them, the value of N is any of 2, 3, 4, 5, and 6.
  • the embodiments of the present disclosure can realize the splicing of traffic images under various violations, and through the spliced maps obtained by splicing, it is possible to intuitively and clearly know what violations have occurred in the vehicles in the spliced maps.
  • the multiple traffic images are arranged along the width direction and the height direction of the mosaic or only along the width direction, the arrangement method includes: the multiple traffic images are arranged in Arrangement in the form of symmetrical multi-grid or asymmetric multi-grid.
  • the image acquisition device includes an image acquisition unit and a communication unit; the image acquisition unit is configured to capture the multiple traffic images and transmit the multiple traffic images to the communication unit; the communication unit, Used to receive multiple traffic images transmitted by the image acquisition unit, and transmit the multiple traffic images to the splicing device via a network; the splicing device is used to receive multiple traffic images transmitted by the communication unit And splicing the compressed code streams of the multiple traffic images to obtain the target code stream.
  • the image acquisition device and the splicing device are jointly integrated into an image acquisition device;
  • the image acquisition device includes an image acquisition unit;
  • the image acquisition unit is used to capture the multiple traffic images and send them to The splicing device transmits multiple traffic images;
  • the splicing device is used to receive multiple traffic images transmitted by the image acquisition unit, and to splice the compressed code streams of the multiple traffic images to obtain the Target stream.
  • the embodiments of the present disclosure can allow the user to select a favorite or suitable image acquisition device to facilitate the user's operation of acquiring an image.
  • the multiple traffic images are multiple images captured by the image acquisition unit of the vehicle in violation of the regulations during the violation; the image acquisition unit only captures the images when it is determined that the vehicle has violated the regulations according to the captured video image sequence
  • the multiple traffic images; or the system further includes a violation analysis device; the violation analysis device is used to receive the video image sequence transmitted by the image acquisition unit, and determine the video image according to the video image sequence When the vehicles in the sequence have violations, send a violation capture instruction to the image acquisition unit; the image acquisition unit only captures the multiple traffic images when receiving the violation capture instruction.
  • the embodiment of the present disclosure captures multiple traffic images of the illegal vehicle during the violation process only when it is confirmed that the vehicle is in violation, which is beneficial to reducing the capture operation of non-violating traffic images and improving the efficiency and accuracy of obtaining the illegal traffic images. This makes the traffic images that need to be spliced have better pertinence.
  • the multiple traffic images are multiple images of the scene of a traffic accident captured by the image capture unit; the image capture unit is also used to capture the perspective when determining that a traffic accident occurs according to the captured video image sequence
  • the scope includes multiple traffic images at the scene of a traffic accident; or the system also includes a traffic accident detection device; the traffic accident detection device is used to receive a sequence of video images transmitted by the image acquisition unit, and to use the video image
  • the sequence determines that a traffic accident occurs, it sends a snapping instruction to the image acquisition unit; when the image acquisition unit receives the snapping instruction, the snapping angle of view includes multiple traffic images at the scene of the traffic accident.
  • the embodiments of the present disclosure only capture multiple traffic images when a traffic accident occurs, which is beneficial to reduce the capture operation of non-traffic accident traffic images, and improve the efficiency and accuracy of acquiring images corresponding to the traffic accident scene, so that The traffic images that need to be spliced have better pertinence.
  • the image acquisition device is used to acquire multiple traffic images with stitching requirements, wherein the multiple traffic images come from multiple image acquisition devices.
  • the system further includes a display device; the display device is configured to receive the target code stream transmitted by the splicing device, and display the mosaic image according to the target code stream.
  • the embodiment of the present disclosure further provides a display device to facilitate the user to view the mosaic.
  • the splicing device is further configured to determine whether the restart intervals of the initial compressed code streams of the multiple traffic images are the same before the splicing; in the restart interval of the initial compressed code streams of the multiple images Under the same premise, directly splicing the initial compressed code streams of the multiple traffic images; under the premise that the restart intervals of the initial compressed code streams of the multiple traffic images are different, All the initial compressed code streams are decoded to obtain multiple decoded traffic images, and the multiple decoded traffic images are encoded according to the same restart interval, and all the compressed code streams obtained after encoding are spliced.
  • the embodiment of the present disclosure adjusts all the compressed code streams to have the same restart interval through the splicing device.
  • the problem of splicing compressed code streams with different restart intervals can be solved, so that compressed code streams with different restart intervals can be spliced after being adjusted to ensure the normal operation of splicing.
  • the splicing device is configured to reorder all the entropy coding segments in all compressed code streams of the multiple traffic images according to the predetermined splicing positions of the multiple traffic images in the mosaic; After re-sorting all the entropy coding segments, the target code stream corresponding to the mosaic of the multiple traffic images is obtained.
  • the splicing device sequentially splices the corresponding code stream data in each image compression code stream according to the coding sequence determined by the splicing position of each image to obtain the target code stream, which can realize multiple traffic
  • the image stitching along the width direction can also reduce the complexity and difficulty of image stitching for images of different resolutions, and help reduce the difficulty of implementing the stitching device.
  • a second aspect of the present disclosure provides a method for splicing traffic images.
  • the method includes: acquiring a plurality of traffic images; and splicing compressed code streams of the plurality of traffic images to obtain a result of splicing at least along the width direction of the image
  • the target code stream of the mosaic image; the respective compressed code streams of the multiple traffic images are coded at the same restart interval.
  • the method for splicing traffic images provided by the embodiments of the present disclosure corresponds to the system for splicing traffic images provided by the present disclosure
  • the method provided by the present disclosure includes the beneficial technical effects of the traffic image splicing system. Repeat it again.
  • Fig. 1 is a flowchart of a method for encoding and stitching multiple JPEG images in the prior art.
  • Fig. 2 is a flowchart of a method for stitching multiple JPEG images in the prior art.
  • Fig. 3 is a schematic diagram of a process of splicing multiple images by a spatial domain image splicing device provided in the prior art.
  • Fig. 4 is a schematic structural diagram of a JPEG image composed of several minimum coding units according to an exemplary embodiment of the present disclosure.
  • Fig. 5 is a schematic diagram showing the coding sequence of several MCUs in the image coding process according to an exemplary embodiment of the present disclosure.
  • Fig. 6 is a structural block diagram of a JPEG encoder according to an exemplary embodiment of the present disclosure.
  • Fig. 7 is a structural block diagram of a JPEG decoder according to an exemplary embodiment of the present disclosure.
  • Fig. 8 is a schematic diagram showing the structure of a JPEG compression code stream according to an exemplary embodiment of the present disclosure.
  • Figure 9 is a schematic diagram of the syntax structure of a restart interval definition marker segment.
  • Fig. 10 is a structural block diagram of a system for splicing traffic images according to an exemplary embodiment of the present disclosure.
  • Fig. 11 is a structural block diagram of a system for splicing traffic images according to an exemplary embodiment of the present disclosure.
  • Fig. 12 is a structural block diagram of another traffic image stitching system according to an exemplary embodiment of the present disclosure.
  • Fig. 13 is a flowchart showing a process of calculating a restart interval according to an exemplary embodiment of the present disclosure.
  • Fig. 14 is a flowchart showing a splicing process of multiple compressed code streams according to an exemplary embodiment of the present disclosure.
  • Fig. 15 is a schematic diagram showing the structure of the entropy coding segment corresponding to each photo before splicing in an application scenario in which an electronic police captures an object running through a red light according to an exemplary embodiment of the present disclosure.
  • FIG. 16 is a schematic diagram of the structure of the entropy coding segment corresponding to the mosaic image obtained after all the entropy coding segments of the multiple photos shown in FIG. 15 are spliced by the traffic image splicing system provided by the embodiment of the present disclosure.
  • Fig. 17a is a schematic diagram showing a mosaic image obtained by splicing four traffic images in a "Tian-shaped" splicing manner according to an exemplary embodiment of the present disclosure.
  • Fig. 17b is a schematic diagram showing another mosaic image obtained by splicing four traffic images in a "Tian-shaped" splicing manner according to an exemplary embodiment of the present disclosure.
  • Fig. 18a is a schematic diagram showing another mosaic image obtained by splicing four traffic images in a "Tian-shaped" splicing manner according to an exemplary embodiment of the present disclosure.
  • Fig. 18b is a schematic diagram showing another mosaic image obtained by splicing four traffic images in a "Tian-shaped" splicing manner according to an exemplary embodiment of the present disclosure.
  • Fig. 19a is a schematic diagram of a mosaic image obtained by splicing multiple traffic images in an asymmetric multi-grid splicing method according to an exemplary embodiment of the present disclosure.
  • Fig. 19b is a schematic diagram of a mosaic image obtained by splicing multiple traffic images in another asymmetric multi-grid splicing method according to an exemplary embodiment of the present disclosure.
  • Fig. 19c is a schematic diagram of a stitched image obtained by stitching multiple traffic images in a longitudinal stitching manner according to an exemplary embodiment of the present disclosure.
  • Fig. 19d is a schematic diagram of a mosaic image obtained by splicing multiple traffic images in a horizontal splicing manner according to an exemplary embodiment of the present disclosure.
  • Fig. 19e is a schematic diagram of a mosaic image obtained by splicing three traffic images in a "top, bottom, two" mosaic mode according to an exemplary embodiment of the present disclosure.
  • Fig. 19f is a schematic diagram of a mosaic image obtained by splicing three traffic images in a "up, two, next" splicing manner according to an exemplary embodiment of the present disclosure.
  • Fig. 20 is a flowchart showing a method for stitching traffic images according to an exemplary embodiment of the present disclosure.
  • Fig. 21 is a hardware structure diagram of an electronic device according to an exemplary embodiment of the present disclosure.
  • first, second, third, etc. may be used in this disclosure to describe various information, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as second information, and similarly, the second information may also be referred to as first information.
  • word “if” as used herein can be interpreted as "when” or “when” or "in response to determination”.
  • MCU the full name of Minimum Coded Unit
  • image coding which contains the smallest group of coded data units.
  • One frame of image can be composed of several MCUs, as shown in Figure 4, the image J is composed of several MCU units, such as MCU0, MCU1, ..., MCUn.
  • the several MCUs are sequentially coded from left to right and top to bottom, as shown in FIG. 5.
  • MCU row means all MCUs in a complete row from left to right in the image.
  • the JPEG encoder 600 is used to encode JPEG images, and generally includes a discrete cosine transform module 601, a quantization module 602, and an entropy encoding module 603. As shown in FIG. 6, when the JPEG encoder 600 encodes the original image, the original image is processed by the discrete cosine transform module 601, the quantization module 602 and the entropy encoding module 603, and finally the compressed code stream of the original image is obtained by encoding. It can be seen that when the image is stored, the compressed code stream of the original image is stored.
  • the JPEG decoder 700 is used to decode the compressed bitstream of the JPEG image, and generally includes an entropy decoding module 701, an inverse quantization module 702, and an inverse transform module 703. As shown in Figure 7, when the JPEG decoder 700 decodes the compressed bitstream of the JPEG image, the compressed bitstream is processed by the entropy decoding module 701, the inverse quantization module 702, and the inverse transform module 703, and finally decoded to obtain the reconstructed reconstruction image. It can be seen from this that when it is necessary to display the stored image, the JPEG decoder 700 can decode the compressed code stream corresponding to the stored image to reconstruct the corresponding image.
  • the compressed code stream structure of JPEG is shown in Figure 8. From the first layer of the compressed code stream structure shown in Figure 8, the JPEG compressed code stream starts with the start of image (SOI, Start of image), and includes a frame of The code stream data is compressed, and finally ends with the end of image (EOI, End of image). It can be seen from the second layer of the compressed code stream structure shown in FIG. 8 that the second layer specifies that the frame starts with the frame header, and the frame includes one or more scans. The frame header may contain one or more table descriptions or other marker segments as a prefix. After the first scan, DNL marker segments can optionally appear to mark the height of the frame of the image through the DNL marker segments. It can be seen from the third layer of the compressed code stream structure shown in FIG.
  • the third layer specifies that scanning starts with the scan head and includes one or more entropy coding segments.
  • Each scan header can contain one or more table descriptions or other marked segments as a prefix. If scanning restart is not allowed, only one entropy coding segment is included at this time, and the restart flag RST cannot appear, that is, the restart flags such as RST0,..., RSTlast-1 shown in the third layer do not appear.
  • the third layer of the compressed code stream structure shown in Figure 8 allows scanning to be restarted.
  • each entropy coding segment is composed of an entropy coding MCU sequence, that is, it includes multiple MCUs. If restarting is allowed and the restart interval is Ri, each entropy coding section except for the last entropy coding section contains Ri MCUs. The last entropy coding segment contains all the remaining MCUs obtained from this scan.
  • Start of Image is a hexadecimal marking code used to mark the beginning of an image, and is assigned a value of 0xFFD8, where the most significant bit MSB (Most Significant Bit) appears in the ordered byte sequence of the compressed data front.
  • EOI the full name of End of Image, is a hexadecimal marking code used to mark the end of an image. It is assigned a value of 0xFFD9, where the most significant bit MSB appears before the ordered byte sequence of the compressed data.
  • the restart interval defines the marker segment, which determines whether the scan is allowed to restart, and the restart interval Ri.
  • the structure of the syntax of the restart interval definition marker segment ie, the aforementioned definition syntax of the restart interval
  • FIG. 9 The structure of the syntax of the restart interval definition marker segment (ie, the aforementioned definition syntax of the restart interval) is shown in FIG. 9, and the meanings of DRI, Lr, and Ri shown in FIG. 9 are described in the following description.
  • DRI the full name of Define Restart Interval
  • Restart Interval is a hexadecimal mark code used to identify the beginning of the restart interval definition marker segment, and is assigned a value of 0xFFDD, where the most significant bit MSB appears in the ordered byte sequence of the compressed data front.
  • Lr is a hexadecimal tag code used to specify the length of the restart interval definition tag segment, and its value is always equal to 0x0004, where the most significant bit MSB should appear before the ordered byte sequence of the compressed data.
  • Ri indicates the restart interval. For example, if the value of Ri is 0, it means that the next scan is not allowed to restart; if the value of Ri is not 0, it means that the next scan is allowed to restart.
  • each of the other entropy coding sections should contain Ri MCUs. And the last entropy coding segment contains all the MCUs left in this scan. Among them, the value range of Ri is [0, 65535].
  • restart mark this is a condition mark, this mark exists between entropy coding segments only when the restart coding tool is enabled.
  • the most significant bit MSB should appear before the ordered byte sequence of the compressed data.
  • RSTlast-1 that is, RST0, RST1,...RST7, RST0, RST1,...RST7,...,RSTlast-1 .
  • the embodiment of the present disclosure provides a traffic image splicing system, which is used to directly splice the compressed code streams of multiple JPEG images without decoding the compressed code streams of multiple JPEG images to obtain multiple reconstructed images in the spatial domain.
  • the traffic image stitching system of the embodiment of the present disclosure does not need to convert multiple images into reconstructed images such as YUV or RGB in the spatial domain to complete image stitching; instead, it is directly based on the compression code of multiple images.
  • the stream is spliced, and the compressed code stream of the images after the multiple images are spliced can be obtained to realize image splicing.
  • the system of the embodiment of the present disclosure directly splices the compressed code streams of multiple images with the same restart interval to obtain the target code stream corresponding to the mosaic, so as to realize the splicing between the multiple traffic images.
  • the steps of decoding the compressed code stream of multiple images, splicing all the reconstructed images in the spatial domain obtained by decoding, and encoding the spliced images obtained by the splicing are omitted; thereby realizing multiple compression codes
  • the rapid splicing of streams is conducive to saving the memory and computing resources of the hardware equipment, improving the computing efficiency of the hardware equipment, reducing the power consumption of the hardware equipment and reducing the computing burden of the CPU; in addition, compared with the prior art, it can only be resolved in the image height direction
  • the method of splicing multiple images with the same rate, the embodiment of the present disclosure can also be applied to the splicing of multiple images with different resolutions, and has a very flexible splicing method-it can realize the horizontal splic
  • the traffic image splicing system can be applied to terminals, such as image acquisition equipment (electronic police or image capture device or camera), mobile equipment, personal assistants, tablet equipment, computer equipment, servers or equipment related to monitoring scenes. It is used for the stitching of multiple illegal traffic images to obtain a stitching image used to indicate the violation of the vehicle, but it is not limited to this application.
  • the traffic image stitching system can be applied to any type of image stitching, such as the stitching of multiple JPEG images, but is not limited to JPEG images.
  • the embodiment of the present disclosure uses the JPEG image stitching standard as an example to describe the traffic image stitching system.
  • the traffic image stitching system 100 provided by the embodiment of the present disclosure includes an image acquisition device 101 and a stitching system. ⁇ 102 ⁇ Device 102.
  • the image acquisition device 101 is configured to acquire multiple traffic images and transmit the multiple traffic images to the stitching device 102.
  • the multiple traffic images transmitted by the image acquisition device 101 to the stitching device 102 may be compressed images of each traffic image.
  • the splicing device 102 is used for splicing the compressed code streams of the multiple traffic images to obtain a target code stream of the mosaic image obtained by splicing at least along the width direction of the image; the respective compression codes of the multiple traffic images The stream is coded according to the same restart interval.
  • the target code stream can be understood as the target compressed code stream.
  • the splicing operation of the splicing device 102 on the compressed code streams of the multiple traffic images can be executed when a user's splicing instruction is received, or it can be executed when multiple traffic images transmitted by the image acquisition device 101 are received. Automatically execute when the image.
  • the multiple traffic images are captured by the image acquisition device 101 when the vehicle has a violation, but it should be noted that the multiple traffic images may include, but are not limited to, when the vehicle has a violation
  • the captured images may also include images captured in other scenes due to actual use requirements. For example, in a scene where the characteristics of criminals are compared, the multiple traffic images may also include those used to compare criminals.
  • the plurality of traffic images may include multiple images captured in the traffic accident scene; in a road condition monitoring scene, the plurality of traffic images may also be included in the highway intersection Multiple images captured when congested.
  • the resolution of all the images in the traffic image may be the same, or at least two images may have different resolutions.
  • the splicing device 102 can process the compressed code streams of multiple traffic images in the above various scenarios to obtain the target code stream of the spliced image.
  • the mosaic image can be displayed according to the target code stream, so that the public security department can learn from the mosaic image what violations or criminal characteristics have occurred in the vehicle in the mosaic image , Or the situation at the scene of a traffic accident, or road congestion.
  • the multiple traffic images may include any one of the following:
  • the first type at least N captured images in which the vehicle is not driving in the guide lane; 4 captured images in which the vehicle is not driving in the guide lane in the mosaic shown in Fig. 17b.
  • the second type at least N captured images of the vehicle speeding; 2 captured images of the vehicle speeding in the mosaic shown in Figure 19d.
  • the third type at least N captured images of the vehicle running through the red light; 4 captured images of the vehicle running through the red light in the mosaic shown in Figure 17a.
  • the fourth type at least N captured images of the vehicle in retrograde; 2 captured images of the retrograde vehicle in the mosaic shown in FIG. 19c or 3 captured images of the retrograde vehicle in the mosaic shown in FIG. 19e.
  • the fifth type at least N captured images of the vehicle's solid line changing lane; 4 captured images of the vehicle's solid line changing lane in the mosaic shown in Figure 18b or the vehicle's solid line changing lane in the mosaic shown in Figure 19f 3 snapshots of images.
  • the sixth type at least N captured images of illegal parking; 4 captured images of illegal parking in the mosaic shown in Figure 18a.
  • N is any of 2, 3, 4, 5, and 6.
  • the multiple traffic images captured when the vehicle violates regulations include but are not limited to the above six types of illegal captures, and the above six types of illegal captured traffic images are only examples.
  • the image acquisition device 101 may transmit the multiple traffic images to the stitching device 102 via a network. Based on this, the image acquiring device 101 may be physically separated from the stitching device 102, For example, the image acquisition device 101 can be used in an environment where the driving condition of a vehicle needs to be monitored, and the splicing device 102 can be used in equipment for processing information or for information gathering in the public security department.
  • the image acquisition device 101 may include an image acquisition unit 1011 and a communication unit 1012; in addition to the function of splicing images, the splicing device 102 may also have a network communication function, or The equipment applied by the splicing device 102 has a network communication function.
  • the image acquisition unit 1011 is used to capture the multiple traffic images, and transmit multiple traffic images to the communication unit 1012.
  • the communication unit 1012 is configured to receive multiple traffic images transmitted by the image acquisition unit 1011, and transmit the multiple traffic images to the stitching device 102 via the network.
  • the splicing device 102 is specifically configured to receive multiple traffic images transmitted by the communication unit 1012, and splice the compressed code streams of the multiple traffic images to obtain the target code stream.
  • the image acquisition unit 1011 is, for example, an image sensor, or a hardware component with an image acquisition function, such as a camera integrated with multiple image sensors.
  • the communication unit 1012 is, for example, a hardware device with a network communication function including a wireless transmission module, a wired transmission module, and a control module.
  • the splicing device 102 includes, for example, a processor and a storage medium storing machine-executable instructions.
  • the processor can implement the image splicing method of the present disclosure by executing the machine-executable instructions.
  • the image acquisition device 101 may not transmit the multiple traffic images to the splicing device 102 via the network. Based on this, the image acquisition device 101 and the splicing device 102 may directly communicate with each other physically.
  • the upper connection is integrated into an image acquisition device. It can be understood that the image acquisition device 101 and the splicing device 102 belong to the component parts of the image acquisition device.
  • the image acquisition device 101 and the stitching device 102 are jointly integrated into an image acquisition device, and the image acquisition device 101 includes an image acquisition unit.
  • the image acquisition unit is used to capture the multiple traffic images and transmit the multiple traffic images to the stitching device 102.
  • the splicing device 102 is specifically configured to receive multiple traffic images transmitted by the image acquisition unit, and splice the compressed code streams of the multiple traffic images to obtain the target code stream.
  • any of the above embodiments under any circumstances, such as no traffic accidents or no violations of regulations, if the image acquisition device 101 continues to capture traffic images, the image acquisition unit will lose more energy consumption. , And the captured traffic images are of little significance for understanding the scene of a traffic accident or determining vehicle violations.
  • the image acquisition unit can reduce the capturing operation of non-traffic accident traffic images or non-violating traffic images, and improve the efficiency and accuracy of obtaining traffic accident images or illegal images, so that the required traffic images have For better pertinence, in one embodiment, on the premise that the multiple traffic images are captured by the image acquisition unit during the violation of the vehicle in the process of violation, the image acquisition unit is used to Only when the collected video image sequence confirms that the vehicle is in violation of the regulations, the multiple traffic images of the vehicle in violation of the regulations are captured.
  • the image capture unit is used to capture the viewing angle range when it is determined that a traffic accident has occurred according to the captured video image sequence Including multiple traffic images at the scene of a traffic accident.
  • a device other than the image acquisition unit may be used to determine whether a traffic accident has occurred or whether the vehicle has violated regulations based on the video image sequence.
  • the system may further include a violation analysis device, the violation analysis device for receiving The video image sequence transmitted by the image acquisition unit, and when it is determined according to the video image sequence that the vehicle in the video image sequence has violations, the violation capture instruction is sent to the image acquisition unit; correspondingly, The image acquisition unit only captures multiple traffic images of the illegal vehicle during the violation process when it receives the illegal capture instruction.
  • the system may further include a traffic accident detection device; the traffic accident detection device is used to receive the images The video image sequence transmitted by the acquisition unit, and when it is determined that a traffic accident occurs according to the video image sequence, a snapping instruction is sent to the image acquisition unit; when the image acquisition unit receives the snapping instruction, the capturing angle of view includes Multiple traffic images at the scene of a traffic accident.
  • the violation analysis device or the traffic accident detection device may be a server or a part of a server, and may also be a part of the image acquisition device 101.
  • the image acquisition device 101 can acquire multiple traffic images with stitching requirements through multiple image acquisition devices. It can be understood that: the image acquisition device 101 may not have the function of acquiring images, but can acquire The function of images captured by other image capture devices. For example, when an expressway is congested, traffic images of the same or different road congestion conditions can be captured by multiple electronic police officers installed on the road; after the multiple electronic police capture multiple traffic images, they can be uploaded to the public security system In this way, when the multiple traffic images need to be spliced, the image acquisition device 101 can request the server of the public security system to acquire the corresponding image.
  • the splicing device 102 After the splicing device 102 receives the multiple traffic images transmitted by the image acquisition device 101, since the restart intervals of the initial compressed bit streams of all the traffic images obtained by the image acquisition device 101 are not necessarily the same, Therefore, it may cause certain difficulties in the splicing operation of the splicing device 102. Based on this, it is necessary to solve the problem of splicing compressed code streams with different restart intervals to ensure the normal operation of the splicing operation.
  • the The splicing device 102 is also used to determine whether the restart intervals of the initial compressed code streams of the multiple traffic images are the same before splicing; on the premise that the restart intervals of the initial compressed code streams of the multiple traffic images are not the same Next, decode all the initial compressed code streams of the multiple traffic images to obtain multiple decoded traffic images, and encode the multiple decoded traffic images at the same restart interval, and All compressed code streams obtained afterwards are spliced.
  • the stitching device 102 re-encodes all the images in the plurality of traffic images. It can be understood that, after the initial compression code streams of all images are decoded, all the decoded images are encoded at the same restart interval to obtain all compressed code streams with the same restart interval. Subsequently, the splicing device 102 may splice all compressed code streams with the same restart interval to obtain the target code stream.
  • the splicing device 102 adjusts all the compressed code streams to the compressed code streams with the same restart interval, which realizes that the compressed code streams with different restart intervals can be spliced after being adjusted, and the splicing operation is guaranteed. Work properly.
  • the restart interval of each initial compressed code stream can be known from the data recorded in Ri in the restart interval definition marker segment in the initial compressed code stream. Based on this, the splicing device 102 can compare the initial compressed code stream Whether the Ri is the same to determine whether the restart interval is the same. Wherein, in order to improve the efficiency of judgment, the splicing device 102 can stop the judgment operation as long as it judges that the restart intervals of the two initial compressed code streams are different, and can obtain the different restart intervals of the initial compressed code streams. critical result.
  • the splicing device 102 may not need to re-encode the multiple traffic images, but It is possible to directly splice the initial compressed code streams of the multiple traffic images.
  • the stitching device 102 encodes the decoded multiple traffic images at the same restart interval, or the image acquisition device 101 encodes the obtained traffic images at the same restart interval.
  • the process of encoding all images can include:
  • the target restart interval is used for encoding the multiple traffic images before image splicing
  • the multiple traffic images are respectively encoded into corresponding compressed code streams.
  • the process of the stitching device 102 or the image acquisition device 101 determining the target restart interval of any one of the multiple traffic images may include:
  • the coding block division information refers to the pixel information of each image block when the image is divided into several image blocks to achieve coding during the coding process; for example, the image block can be regarded as a minimum coding unit MCU, Correspondingly, the coding block division information may refer to the pixel unit of the MCU. It should be noted that the image blocks in the present disclosure are not limited to the smallest coding unit, and may also be blocks of other sizes.
  • the understanding of the interval can be: for any image, according to the maximum horizontal sampling factor and the resolution of the image, determine the number of minimum coding unit MCUs in any row of the image, and use the number of MCUs as the The original restart interval of the image; among them, since the total number of MCUs in different MCU rows in the same image is the same, only the number of MCUs in one MCU row needs to be determined.
  • the understanding of the common divisor of the original restart interval of all traffic images to be spliced can be understood as: calculating the common divisor of the total number of MCUs in the MCU rows of each traffic image.
  • the sampling factors of the different components of the color space of the image including the Y component representing the brightness information and the UV component representing the color difference information
  • the maximum value of the horizontal sampling factor that is, the maximum horizontal sampling factor Hmax and the maximum vertical sampling factor Vmax can be obtained; the units of both Hmax and Vmax are pixels.
  • the sampling factor used in each image is the same.
  • the width of the minimum coding unit MCU obtained for each image is 8 ⁇ Hmax and the height is 8 ⁇ Vmax.
  • the value of Wi/(8 ⁇ Hmax) is an integer
  • the stitching device 102 or the image acquisition device 101 can calculate the number of MCUs included in any row of each image, and then can calculate all the images based on the calculated number of MCUs in any row of each image
  • the common divisor of the number of MCUs in a row for example, if the number of MCUs in a row of 3 images are 2, 4, and 8, the common divisors of the number of MCUs in a row of these 3 images are 1 and 2. Then, the calculated common divisor 1 or 2 can be used as the target restart interval for encoding the multiple traffic images before image splicing.
  • the greatest common divisor may be used as the target restart interval.
  • the traffic image can be encoded according to the target restart interval to generate a compressed code stream corresponding to each traffic image.
  • the process of encoding the multiple traffic images by the splicing device 102 or the image acquiring device 101 according to the target restart interval may include:
  • the image is encoded according to the entropy encoding section to obtain a compressed code stream corresponding to the image.
  • the stitching device 102 encodes the multiple traffic images according to the same target restart interval, for the image with the smallest width pixel.
  • the number of entropy coding segments corresponding to one line may be 1.
  • the number of entropy coding segments corresponding to one line is greater than 1, and is an integer multiple of 1.
  • the number of entropy coding segments corresponding to a line of each image will vary with the size of the target restart interval.
  • the target restart interval is 1, then There are 8 entropy coding segments corresponding to one line of the image, and if the target restart interval is 8, then there is only one entropy coding segment corresponding to one line of the image. It can be seen that the number of entropy coding segments corresponding to one line of each image has a negative correlation with the size of the target restart interval.
  • each entropy coding segment during encoding of each image includes R0 MCUs. Between every two adjacent entropy coding segments, there is a restart mark RSTm; the restart mark RSTm will appear cyclically, that is, RST0, RST1,...RST7, RST0, RST1,...RST7,...,RSTlast-1 .
  • the height Hi of other images is an integer multiple of the height of the MCU.
  • the compressed bitstream of each image can be obtained.
  • the encoding process of each image is relatively independent, and each compressed code stream obtained is also relatively independent, without mutual confusion.
  • the splicing process of the splicing device 102 on all the compressed code streams with the same restart interval may include:
  • the target code stream corresponding to the mosaic of the multiple traffic images is obtained.
  • the predetermined splicing position of the traffic image in the splicing image may be specified by the user, or may be determined by the splicing system according to the default template.
  • the user can specify the splicing position of each image by using the splicing template that comes with the splicing system, or can specify the splicing position of each image by a custom combined splicing method.
  • the user can select the desired template from the stitching templates saved by the stitching system, so that in the subsequent stitching, the stitching system can determine the predetermined stitching of each image according to the selected template.
  • Position or, the user can specify the splicing order of each image one by one, so that in subsequent splicing, the splicing system can determine the predetermined splicing position of each image according to the splicing sequence according to the default template.
  • the system may further include a display device, the display device being used to splice the multiple traffic images before the splicing device 102 , Displaying the stitching setting area, so that the user can reserve the stitching positions of the multiple traffic images through the stitching setting area.
  • the splicing device 102 can also be used to detect the input information of the splicing setting area, and determine the splicing position of the multiple traffic images according to the input information.
  • the splicing device 102 can determine the entropy coding segment corresponding to each row of the mosaic according to the predetermined splicing position of each image, and according to the top to bottom, left to right Obtain the corresponding entropy coding segments from the compression code streams of the corresponding images in order to achieve the reordering of all the entropy coding segments in all the compression code streams of all images.
  • the splicing device 102 After the splicing device 102 reorders all the entropy coding segments in all the compressed code streams of all the images, it can obtain the target codes corresponding to the spliced images of the multiple traffic images according to all the reordered entropy coding segments flow. In one embodiment, in order to further improve the accuracy of the obtained target code stream, the splicing device 102 obtains the target code stream corresponding to the mosaic of the multiple traffic images according to all the entropy coding segments after reordering.
  • the process can include:
  • the bytes used to represent the image width and the image height in the target code stream after the restart markers are sequentially sorted are modified to the bytes corresponding to the actual width and actual height of the mosaic.
  • all entropy coding segments are spliced: take out the compressed code stream (hereinafter referred to as the first compressed code stream) corresponding to the image (hereinafter referred to as the first image) corresponding to the upper left corner of the mosaic image to be spliced ). Since the first image is located in the upper left corner of the mosaic, the entropy coding segment corresponding to the MCU on the first line of the first image in the first compressed code stream must be the mosaic The entropy coding segment that is ranked first in the target code stream corresponding to the picture.
  • the code stream data of the corresponding entropy coding segment can be sequentially obtained from the compressed code stream of each image, and the obtained code stream data can be spliced in sequence until the splicing Finish all the entropy coding sections to get the target code stream.
  • modify the frame header information after modifying the restart mark of the target code stream, further modify the frame header information of the target code stream after the restart mark is modified. Specifically, according to the actual width, actual height, and stitching position of all images, the actual width and actual height of the stitched image can be calculated. In this way, according to the actual width and actual height of the mosaic image, the bytes used to represent the width and height of the image in the frame header information of the target code stream modified by the restart mark can be respectively modified as the The bytes corresponding to the actual width and actual height of the mosaic. Thus, the JPEG compression code stream of the mosaic image is obtained.
  • the display device or the mosaic device 102 may first perform a decoding operation on the JPEG compression code stream to reconstruct the mosaic image in the spatial domain. Then the display device only needs to display the splicing image. It can be seen that the display device can also be used to receive the target code stream transmitted by the splicing device 102, and display all the images according to the target code stream. ⁇ Mosaic.
  • the decoding and display of the mosaic picture above is based on a system with decoding function.
  • a system without decoding function to realize the display of the mosaic picture, it can be connected by physical wiring or network communication.
  • the target code stream is sent to a device with a decoding function, so that after the target code stream is decoded by the device with a decoding function, the decoded mosaic image is displayed.
  • the splicing device 102 may only have a splicing function. Accordingly, the decoding function, encoding function, and detection function may be implemented by other devices than the splicing device 102.
  • the splicing device 102 may include a decoding module for implementing the function of decoding the compressed code stream ( (Such as a decoder), an encoding module (such as an encoder) for implementing the function of encoding an image, a splicing module for implementing the function of splicing the compressed code stream of an image, and for implementing the splicing setting
  • the detection module of the detection function of the input information of the area may include a decoding module for implementing the function of decoding the compressed code stream (Such as a decoder), an encoding module (such as an encoder) for implementing the function of encoding an image, a splicing module for implementing the function of splicing the compressed code stream of an image, and for implementing the splicing setting
  • the detection module of the detection function of the input information of the area may include a decoding module for implementing the function of decoding the compressed code stream (Such as a decoder), an encoding module (such as
  • the traffic image splicing system provided by the embodiment of the present disclosure is not limited to the following application scenarios.
  • the traffic image stitching system provided by the embodiment of the present disclosure can be applied to a scene where an electronic policeman captures an object running through a red light, as follows.
  • the first photo generally shows the scene where the vehicle is driving across the stop line
  • the second photo generally shows the scene where the vehicle is driving in the middle of the intersection
  • the third photo generally shows the scene where the vehicle arrives on the opposite side of the intersection
  • the fourth A photo is generally a close-up enlarged photo that clearly records the vehicle license plate information. Since these four photos are generated at different times, it is necessary to encode these four photos at different times in sequence, and it is impossible to stitch the four images before encoding.
  • the four photos are usually stitched together in the form of "tian".
  • the splicing method of the "tian shape” can be understood as a symmetrical tetragonal splicing method.
  • a restart interval ie, an entropy Coding segments
  • the total number of entropy coding segments corresponding to each line of each photo is 1.
  • the compressed code stream of each photo obtained after encoding each photo has 68 (that is, 1088 ⁇ 16) entropy coding segments, as shown in Figure 15.
  • the compressed code stream of each photo is mutually exclusive. independent.
  • the splicing device 102 After obtaining the compressed bitstream of each photo, the splicing device 102 reorders the entropy coding sections of all compressed bitstreams, and sequentially updates the entropy coding sections between every two adjacent entropy coding sections in the target bitstream. Restart marking and modify the frame header information of the target code stream to obtain the final spliced target code stream.
  • the embodiment of the present disclosure directly reorders and splices all the entropy coding segments of the 4 images with the same restart interval according to a predetermined splicing sequence, and can realize splicing in the width direction and the height direction at the same time.
  • the entropy coding segments of the four photos are combined together to form a mosaic corresponding to the entropy coding segment.
  • the effect of the resulting mosaic can be as shown in FIG. 17a, FIG. 17b, FIG. 18a, or FIG. 18b, where the 4 photos are arranged in the mosaic in the form of a symmetrical square grid.
  • the splicing method of multiple traffic images in the embodiment of the present disclosure is not limited to the "tian-shaped" splicing method, but may also be other methods, for example, the image is obtained in an asymmetric and uneven multi-grid splicing method.
  • the number of images in the upper part of the mosaic in Figure 19a is less than the number of images in the lower part of the mosaic, and the number of images in the upper part of the mosaic in Figure 19b is more than that in the lower part of the mosaic.
  • the stitched image shown in Figure 19c is obtained by vertical stitching, so that all the images in the stitched image are arranged in order from top to bottom; or, the stitched image shown in Figure 19d is obtained by horizontal stitching
  • the mosaic shown in Fig. 19e can be obtained by the stitching method of “upper, lower and two”, or the stitching of “upper, second and next”
  • the mosaic image shown in Fig. 19f is obtained; among them, the “upper, lower, two” and the “up, two, and the next” can be considered as an asymmetric three-square grid.
  • the present disclosure is not only applicable to the stitching of multiple images with different resolutions, but also has flexible stitching methods for multiple traffic images. It can realize the horizontal stitching of multiple traffic images and the vertical stitching of multiple images. Splicing can also realize the horizontal and vertical combined splicing of multiple images, especially to meet the needs of arbitrary splicing of multiple traffic images. Therefore, in the mosaic, the multiple traffic images are arranged along the width direction and the height direction of the mosaic or only along the width direction.
  • the arrangement method may include: the multiple traffic images are arranged in Arrangement in the form of symmetrical multi-grid or asymmetric multi-grid.
  • the target restart interval is set to the greatest common divisor of the number of MUCs of all traffic images for one row, but in other embodiments, the greatest common divisor may not be selected.
  • the number is used as the target restart interval. Based on this, the number of entropy coding segments corresponding to a line of each image will also change.
  • system embodiment described above is only illustrative, wherein the devices described as separate components may or may not be physically separated, and the components displayed as a unit may be or may be Not a physical unit.
  • the embodiment of the present disclosure also provides a traffic image splicing method.
  • the method can be applied to image devices (electronic police or image capture devices or cameras), mobile devices, personal assistants, tablet devices, computer devices, servers, or devices related to surveillance scenes, and can be used for multiple illegal traffic images. Splicing to obtain a spliced image indicating which violations of the vehicle occurred, but not limited to this application.
  • the method for splicing traffic images may be applicable to the splicing of any type of image, such as the splicing of multiple JPEG images, but is not limited to JPEG images.
  • the embodiment of the present disclosure uses the JPEG image stitching standard as an example to describe the method for stitching traffic images.
  • the method for stitching traffic images provided by the embodiment of the present disclosure includes:
  • the multiple traffic images are arranged along the width direction and the height direction of the mosaic or only along the width direction, and the arrangement method includes: the multiple traffic images are symmetrical Arrangement in the form of multiple grids, or in the form of asymmetric multiple grids.
  • the multiple traffic images are captured when the vehicle violates regulations; the multiple traffic images include any of the following, but are not limited to the following examples:
  • At least N snapshot images of the vehicle changing lanes with solid lines At least N snapshot images of the vehicle changing lanes with solid lines
  • At least N captured images of illegal parking At least N captured images of illegal parking
  • N is any of 2, 3, 4, 5, and 6.
  • the multiple traffic images may include, but are not limited to, images captured when the vehicle is in violation of regulations, and may also include images captured in other scenes due to actual usage requirements, for example, in the characteristics of criminals.
  • the multiple traffic images may also include multiple images used to compare the characteristics of criminals; in the scene of a traffic accident, the multiple traffic images may include those captured in the scene of the traffic accident Multiple images; in a road condition monitoring scene, the multiple traffic images may also include multiple images captured when the expressway is congested.
  • the resolution of all the images in the traffic image may be the same, or at least two images may have different resolutions.
  • the multiple traffic images are obtained by an image acquisition device, the image acquisition device includes an image acquisition unit and a communication unit; the compressed code streams of the multiple traffic images are spliced into the target code by the splicing device flow.
  • acquiring multiple traffic images includes:
  • the image acquisition unit captures the multiple traffic images, and transmits the multiple traffic images to the splicing device through the communication unit, so that the splicing device responds to the multiple traffic images transmitted by the communication unit
  • the compressed code stream is spliced.
  • the multiple traffic images are obtained by an image acquisition device; the compressed code streams of the multiple traffic images are spliced into the target code stream by a splicing device; the image acquisition device and the splicing device Are integrated together into an image acquisition device; the image acquisition device includes an image acquisition unit;
  • the acquiring multiple traffic images includes:
  • the image acquisition unit captures the multiple traffic images, and transmits the multiple traffic images to the stitching device.
  • the image acquisition unit determines that the vehicle exists according to the acquired video image sequence. Only when the violation is committed, the multiple traffic images are captured; or the image acquisition unit only captures the multiple traffic images when the capture instruction is received; the capture instruction is captured by the violation analysis device according to the image acquisition unit When it is determined that the vehicle violates regulations, the video image sequence is sent to the image acquisition unit.
  • the multiple traffic images are multiple images of the scene of a traffic accident captured by the image acquisition unit
  • the captured angle of view includes multiple traffic images at the scene of a traffic accident; or the image acquisition unit only captures multiple traffic images at the scene of a traffic accident when the image acquisition unit receives a capture instruction; the capture instruction is provided by the traffic accident detection device
  • the multiple traffic images may come from multiple image acquisition devices.
  • the method may further include:
  • the restart intervals of all traffic images obtained through the step S201 are not necessarily the same, which may increase the difficulty of stitching, in order to solve the problem of stitching compressed code streams with different restart intervals, Compressed code streams with different restart intervals can also be spliced after being adjusted to ensure normal splicing operation.
  • the method may further include:
  • encoding the multiple decoded traffic images at the same restart interval includes:
  • S20231 Determine the target restart interval of the multiple traffic images; the target restart interval is used for encoding the multiple traffic images before image splicing;
  • S20232 Encode the multiple traffic images into corresponding compressed code streams according to the target restart interval.
  • the step S20231 may include:
  • S202313 Select a common divisor greater than 1 or the greatest common divisor from the common divisors as the target restart interval.
  • step S20232 may include:
  • S202322 Encode the image according to the entropy coding segment to obtain a compressed code stream corresponding to the image.
  • the stitching of the compressed code streams of the multiple traffic images may include:
  • S2031 Reorder all entropy coding segments in all compressed code streams of the multiple images according to predetermined splicing positions of the multiple traffic images in the mosaic;
  • S2032 Obtain the target code stream corresponding to the mosaic of the multiple traffic images according to all the entropy coding segments after the reordering.
  • step S2032 may include:
  • S20322 Determine the actual width and actual height of the mosaic according to the predetermined mosaic positions of the multiple traffic images in the mosaic;
  • S20323 Modify the bytes representing the image width and the image height in the target code stream after the restart markers are sequentially sorted to the bytes corresponding to the actual width and actual height of the mosaic.
  • the process of determining the predetermined splicing position includes:
  • the input information of the splicing setting area is detected, and the splicing position of the multiple traffic images is determined according to the input information.
  • the method for splicing traffic images in the embodiments of the present disclosure directly splices the compressed code streams of multiple traffic images with the same restart interval to obtain the target code stream corresponding to the spliced image. Compared with the prior art, the multiple images are omitted.
  • the memory and computing resources of the device improve the computing efficiency of the hardware device, reduce the power consumption of the hardware device, and reduce the computing burden of the CPU; in addition, compared to the prior art, only multiple images with the same resolution can be stitched along the image height direction.
  • the embodiment of the present disclosure can also be applied to the stitching of multiple traffic images with different resolutions, and has a very flexible stitching method-it can realize the horizontal stitching of multiple traffic images and the vertical stitching of multiple traffic images. , It can also realize the horizontal and vertical combined splicing of multiple traffic images, which can better meet the demand for arbitrary splicing of traffic images, especially the demand for arbitrary splicing of multiple traffic images.
  • an electronic device which includes:
  • a memory for storing a computer program executable by the processor
  • FIG. 21 is a hardware structure diagram of an electronic device according to an exemplary embodiment of the present disclosure, except for the processor 510, memory 530, interface 520, and In addition to the non-volatile storage medium 540, the electronic device generally may include other hardware according to the actual function of the electronic device, which will not be repeated here.
  • the electronic device of the embodiment of the present disclosure corresponds to the method of splicing traffic images in any of the foregoing embodiments, the electronic device of the embodiment of the present disclosure also includes at least the following beneficial technical effects:
  • the electronic device in the embodiment of the present disclosure directly splices the compressed code streams of multiple traffic images with the same restart interval to obtain the target code stream corresponding to the mosaic image. Compared with the prior art, it omits the need for the multiple traffic images. Steps such as decoding the compressed code stream, splicing all the reconstructed images in the spatial domain obtained by decoding, and encoding the spliced image; thus realizing the rapid splicing of multiple compressed code streams and saving the memory of the hardware device And computing resources, improve the computing efficiency of hardware devices, reduce the power consumption of hardware devices, and reduce the computing burden of the CPU; in addition, compared to the prior art, which can only stitch multiple images with the same resolution along the image height direction, the present disclosure
  • the embodiment can also be applied to the stitching of multiple traffic images with different resolutions, and has a very flexible stitching method-it can realize the horizontal stitching of multiple traffic images, the vertical stitching of multiple traffic images, and Realizing the horizontal and vertical combined splicing of multiple traffic images can better
  • the embodiment of the present disclosure also provides a computer-readable storage medium on which a computer program is stored.
  • the program is executed by a processor, the The steps of the stitching method of traffic images.
  • the present disclosure may adopt the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program codes.
  • Computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer-readable storage media include, but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only Memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage , Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by computing devices.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read-only Memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • CD-ROM compact disc
  • DVD digital versatile disc
  • Magnetic cassettes magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by computing devices.
  • the computer-readable storage medium of the embodiment of the present disclosure corresponds to the method for splicing traffic images in any of the foregoing embodiments, the computer-readable storage medium of the embodiment of the present disclosure also includes at least the following beneficial technical effects:
  • the computer-readable storage medium of the embodiment of the present disclosure directly splices the compressed code streams of multiple traffic images with the same restart interval to obtain the target code stream corresponding to the mosaic image.
  • the need for multiple images is omitted.
  • the memory and computing resources of the device improve the computing efficiency of the hardware device, reduce the power consumption of the hardware device, and reduce the computing burden of the CPU; in addition, compared to the prior art, only multiple images with the same resolution can be stitched along the image height direction.
  • the embodiment of the present disclosure can also be applied to the stitching of multiple traffic images with different resolutions, and has a very flexible stitching method-it can realize the horizontal stitching of multiple traffic images and the vertical stitching of multiple traffic images. , It can also realize the horizontal and vertical combined splicing of multiple traffic images, which can better meet the demand for arbitrary splicing of traffic images, especially the demand for arbitrary splicing of multiple traffic images.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Traffic Control Systems (AREA)

Abstract

本公开提供一种交通图像的拼接系统及方法,其中的系统包括:图像获取装置,用于获取多张交通图像,并向拼接装置传输所述多张交通图像;所述拼接装置,用于对所述多张交通图像的压缩码流进行拼接,以得到至少沿图像宽度方向进行拼接所得的拼接图的目标码流。

Description

交通图像的拼接 技术领域
本公开涉及图像处理技术领域,特别涉及交通图像的拼接。
背景技术
随着图像处理技术的发展及用户对图像清晰度越来越高的需求,目前的图像传感器所采集的图像的分辨率也越来越高。但由于图像所占用的存储空间和传输时所需的传输量与图像的分辨率正相关,故为降低存储成本和传输成本,有必要对图像数据进行压缩,即进行编码处理,以减少图像的存储量和传输量。相应地,在需要查看图像时,要对图像编码后的数据(即压缩码流)进行解码,才能显示图像画面。
其中,会出现将不同时刻拍摄的多张图像分别存储,并在存储后需要将多张图像拼接成一幅超大图像的情况。例如,在交通行业的视频监控领域中,一般需要借助电子警察所拍下的多张照片来判断车辆是否发生违章行为,此时需要对多张交通图像进行拼接。对于此,都是分别对多张图像进行编码存储,并在需要显示所述超大图像时,再对多张图像进行拼接,其中的编码和拼接过程可以参见图1。如图2和图3所示,目前,将多张JPEG图像进行拼接的方法一般包括:首先,通过JPEG解码器对多张图像的压缩码流进行解码,解码出各图像在空间域的重建图像;然后,通过空间域图像拼接装置将所有重建图像进行拼接,得到一幅超大图像;最后,通过JPEG编码器对所述超大图像进行编码,以生成所述超大图像对应的压缩码流。从而实现在后续需再次查看所述超大图像时,不需要再经过拼接处理,而是直接通过JPEG解码器对所述超大图像对应的压缩码流进行解码。
根据上述拼接方案,必须先对多张图像的压缩码流一一解码,转换成空间域的YUV或RGB等重建图像后,才能将所有重建图像拼接成超大图像。其中,为了方便对所述超大图像的查看或存储,还需要对拼接生成的所述超大图像进行编码形成对应的压缩码流。因此,在目前的多张JPEG图像的拼接过程中,无论是解码、编码,还是空间域图像的拼接,都需要消耗硬件设备较多的内存和运算资源,并增大硬件设备的功耗和运算时间,给硬件设备带来较大负担。而且,所述负担会随着图像的分辨率的提高而增加。
发明内容
有鉴于此,本公开提供一种交通图像的拼接系统及方法。
本公开的第一方面提供一种交通图像的拼接系统,所述系统包括:图像获取装置,用于获取多张交通图像,并向拼接装置传输所述多张交通图像;所述拼接装置,用于对所述多张交通图像的压缩码流进行拼接,以得到至少沿图像宽度方向进行拼接所得的拼接图的目标码流;所述多张交通图像各自的压缩码流按照相同的重启动间隔编码得到。
由此,本公开实施例通过直接对具有相同的重启动间隔的多张交通图像的压缩码流进行拼接得到拼接图对应的目标码流,相对于现有技术,省略了对多张交通图像的压缩 码流进行解码、对解码得到的所有空间域重建图像进行拼接、和对拼接得到的拼接图进行编码等步骤;从而实现对多个压缩码流的快速拼接,并有利于节省硬件设备的内存和运算资源,提高硬件设备运算效率,降低硬件设备功耗和减轻CPU的运算负担;另外,相对于现有技术只能沿图像高度方向对分辨率相同的多张图像进行拼接的方式,本公开实施例还可以适用于分辨率不同的多张交通图像的拼接,且具有非常灵活的拼接方式——既可以实现多张交通图像的横向拼接,也可以实现多张交通图像的纵向拼接,还可以实现多张交通图像的横向和纵向的组合拼接,更能满足对交通图像进行任意拼接的使用需求,尤其是满足了多张交通图像的任意拼接的需求。
可选的,所述多张交通图像由所述图像获取装置在车辆存在违章行为时抓拍得到;所述多张交通图像包括以下中的任一:车辆不按导向车道行驶的至少N张抓拍图像;车辆超速驾驶的至少N张抓拍图像;车辆闯红灯的至少N张抓拍图像;车辆逆行的至少N张抓拍图像;车辆实线变道的至少N张抓拍图像;违法停车的至少N张抓拍图像;其中,N的取值为2,3,4,5,6中的任一。
由此可知,本公开实施例可以实现多种违章行为下的交通图像的拼接,并通过拼接得到的拼接图,可以直观且清楚地的得知拼接图中的车辆发生了何种违章行为。
可选的,所述拼接图中,所述多张交通图像沿所述拼接图宽度方向和高度方向进行排布或者只沿宽度方向进行排布,排布方式包括:所述多张交通图像以对称多宫格的形式排布,或者以非对称多宫格的形式排布。
由此可知,本公开实施例可以实现多张交通图像以多种形式进行排布,可以满足多种拼接需求。
可选的,所述图像获取装置包括图像采集单元和通信单元;所述图像采集单元,用于抓拍所述多张交通图像,并向所述通信单元传输多张交通图像;所述通信单元,用于接收由所述图像采集单元传输的多张交通图像,并通过网络向所述拼接装置传输所述多张交通图像;所述拼接装置,用于接收所述通信单元传输的多张交通图像,并对所述多张交通图像的压缩码流进行拼接,以得到所述目标码流。
可选的,所述图像获取装置和所述拼接装置共同集成为一图像采集装置;所述图像获取装置包括图像采集单元;所述图像采集单元,用于抓拍所述多张交通图像,并向所述拼接装置传输多张交通图像;所述拼接装置,用于接收由所述图像采集单元传输的多张交通图像,并对所述多张交通图像的压缩码流进行拼接,以得到所述目标码流。
由此,本公开实施例通过提供不同类型的图像获取装置,可以让用户选择喜欢的或合适的图像获取装置,方便用户获取图像的操作。
可选的,所述多张交通图像是所述图像采集单元抓拍的违章车辆在违章过程中的多张图像;所述图像采集单元在根据采集的视频图像序列确定车辆存在违章行为时,才抓拍所述多张交通图像;或者所述系统还包括违章分析装置;所述违章分析装置用于接收由所述图像采集单元传输的视频图像序列,并在根据所述视频图像序列确定所述视频图像序列中的车辆存在违章行为时,向所述图像采集单元发送违章抓拍指令;所述图像采集单元在收到所述违章抓拍指令时,才抓拍所述多张交通图像。
由此,本公开实施例通过在确认车辆存在违章行为时才抓拍违章车辆在违章过程的多张交通图像,有利于减少对非违章交通图像的抓拍操作,提高对违章交通图像的获取效率和准确性,使得所需拼接的交通图像具备更好的针对性。
可选的,所述多张交通图像是所述图像采集单元抓拍的交通事故现场的多张图像;所述图像采集单元,还用于在根据采集的视频图像序列确定发生交通事故时,抓拍视角范围包括交通事故现场的多张交通图像;或者所述系统还包括交通事故检测装置;所述交通事故检测装置用于接收由所述图像采集单元传输的视频图像序列,并在根据所述视频图像序列确定发生交通事故时,向所述图像采集单元发送抓拍指令;所述图像采集单元在收到所述抓拍指令时,抓拍视角范围包括交通事故现场的多张交通图像。
由此,本公开实施例通过在发生交通事故时才抓拍多张交通图像,有利于减少对非交通事故的交通图像的抓拍操作,提高对交通事故现场对应的图像的获取效率和准确性,使得所需拼接的交通图像具备更好的针对性。
可选的,所述图像获取装置,用于获取具有拼接需求的多张交通图像,其中,所述多张交通图像来自多个图像采集设备。
由此,可以增加所述多张交通图像的获取途径。
可选的,所述系统还包括显示装置;所述显示装置用于接收由所述拼接装置传输的所述目标码流,并根据所述目标码流显示所述拼接图。
由此,本公开实施例通过进一步提供显示装置,方便用户对拼接图的查看。
可选的,所述拼接装置,还用于在拼接之前,确定所述多张交通图像的初始压缩码流的重启动间隔是否相同;在所述多张图像的初始压缩码流的重启动间隔相同的前提下,直接对所述多张交通图像的初始压缩码流进行拼接;在所述多张交通图像的初始压缩码流的重启动间隔不同的前提下,对所述多张交通图像的全部初始压缩码流进行解码,以得到解码后的多张交通图像,并按照相同的重启动间隔对所述解码后的多张交通图像进行编码,将编码后得到的全部压缩码流进行拼接。
由此,在所需拼接的压缩码流中存在重启动间隔不同的压缩码流时,本公开实施例通过所述拼接装置将所有压缩码流都调整为具有重启动间隔相同的压缩码流,可以解决重启动间隔不同的压缩码流的拼接问题,从而实现重启动间隔不同的压缩码流被调整后也可以进行拼接,保证拼接操作的正常进行。
可选的,所述拼接装置,用于根据所述多张交通图像在拼接图中的预定拼接位置,对所述多张交通图像的所有压缩码流中的所有熵编码段进行重排序;根据重新排序后的所有熵编码段,得到所述多张交通图像的拼接图对应的目标码流。
由此,本公开实施例通过所述拼接装置根据各个图像被指定的拼接位置确定的编码顺序对各个图像压缩码流中对应的码流数据依序进行拼接得到目标码流,可实现多张交通图像沿宽度方向进行拼接,还可以降低不同分辨率图像进行图像拼接时的复杂度和难度,并有利于降低拼接装置的实现难度。
本公开的第二方面提供一种交通图像的拼接方法,所述方法包括:获取多张交通图 像;对所述多张交通图像的压缩码流进行拼接,以得到至少沿图像宽度方向进行拼接所得的拼接图的目标码流;所述多张交通图像各自的压缩码流按照相同的重启动间隔编码得到。
由于本公开实施例所提供的交通图像的拼接方法与本公开所提供的交通图像的拼接系统相对应,故本公开所提供的方法包括所述交通图像的拼接系统的有益技术效果,在此不再赘述。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
图1是现有技术中多张JPEG图像的编码和拼接方法的流程图。
图2是现有技术中对多张JPEG图像进行拼接的方法的流程图。
图3是现有技术所提供的空间域图像拼接装置拼接多张图像的过程示意图。
图4是本公开根据一示例性实施例示出的一种由若干最小编码单元组成的JPEG图像的结构示意图。
图5是本公开根据一示例性实施例示出的图像编码过程中,若干MCU的编码顺序的示意图。
图6是本公开根据一示例性实施例示出的一种JPEG编码器的结构框图。
图7是本公开根据一示例性实施例示出的一种JPEG解码器的结构框图。
图8是本公开根据一示例性实施例示出的JPEG压缩码流的结构示意图。
图9是一种重启动间隔定义标记段的语法结构示意图。
图10是本公开根据一示例性实施例示出的一种交通图像的拼接系统的结构框图。
图11是本公开根据一示例性实施例示出的一种交通图像的拼接系统的结构框图。
图12是本公开根据一示例性实施例示出的另一种交通图像的拼接系统的结构框图。
图13是本公开根据一示例性实施例示出的一种重启动间隔计算过程的流程图。
图14是本公开根据一示例性实施例示出的多个压缩码流的拼接过程的流程图。
图15是本公开根据一示例性实施例示出在电子警察抓拍闯红灯对象的应用场景下,各照片在拼接前所对应的熵编码段的结构示意图。
图16是通过本公开实施例所提供的交通图像的拼接系统对图15所示的多张照片的所有熵编码段进行拼接后,得到的拼接图所对应的熵编码段的结构示意图。
图17a是本公开根据一示例性实施例示出一种以“田字形”的拼接方式对四张交通图像进行拼接后得到的拼接图的示意图。
图17b是本公开根据一示例性实施例示出一种以“田字形”的拼接方式对四张交通 图像进行拼接后得到的另一种拼接图的示意图。
图18a是本公开根据一示例性实施例示出一种以“田字形”的拼接方式对四张交通图像进行拼接后得到的另一种拼接图的示意图。
图18b是本公开根据一示例性实施例示出一种以“田字形”的拼接方式对四张交通图像进行拼接后得到的另一种拼接图的示意图。
图19a是本公开根据一示例性实施例示出的一种非对称多宫格的拼接方式对多张交通图像进行拼接后得到的拼接图的示意图。
图19b是本公开根据一示例性实施例示出的另一种非对称多宫格的拼接方式对多张交通图像进行拼接后得到的拼接图的示意图。
图19c是本公开根据一示例性实施例示出的一种以纵向拼接的方式对多张交通图像进行拼接后得到的拼接图的示意图。
图19d是本公开根据一示例性实施例示出的一种以横向拼接的方式对多张交通图像进行拼接后得到的拼接图的示意图。
图19e是本公开根据一示例性实施例示出的一种以“上一下二”的拼接方式对三张交通图像进行拼接后得到的拼接图的示意图。
图19f是本公开根据一示例性实施例示出的一种以“上二下一”的拼接方式对三张交通图像进行拼接后得到的拼接图的示意图。
图20是本公开根据一示例性实施例示出的一种交通图像的拼接方法的流程图。
图21是本公开根据一示例性实施例示出的电子设备的一种硬件结构图。
具体实施方式
这里将详细对示例性实施例进行说明,其示例表示在附图中,下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。并且,以下示例性实施例中所描述的实施方式并不限制本公开,本领域的普通技术人员根据这些实施方式所做出的结构、方法、或功能上的变换均包含在本公开的保护范围内。
在本公开使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开。在本公开和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本公开可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应该限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释为“在……时”或“当……时”或“响应于确定”。
为了使本公开更清楚简洁,以下对本公开所提及的一些技术术语进行解释:
MCU,全称Minimum Coded Unit,即图像编码中的最小编码单元,其包含了被编码的最小数据单元组。一帧图像可以由若干MCU组成,如图4所示,图像J由若干MCU单元,如MCU0,MCU1,……,MCUn组成。在图像编码过程中,所述若干MCU按照从左到右,从上到下的顺序依次被编码,如图5所示。
MCU行,表示图像中,从左往右的完整的一行中的所有MCU。
JPEG编码器600,用于对JPEG图像进行编码,一般包括离散余弦变换模块601、量化模块602和熵编码模块603。如图6所示,JPEG编码器600对原始图像进行编码时,通过离散余弦变换模块601,量化模块602和熵编码模块603对原始图像进行处理,最终编码得到原始图像的压缩码流。由此可知,对图像进行存储时,存储的是原始图像的压缩码流。
JPEG解码器700,用于对JPEG图像的压缩码流进行解码,一般包括熵解码模块701、反量化模块702和反变换模块703。如图7所示,JPEG解码器700对JPEG图像的压缩码流进行解码时,通过熵解码模块701、反量化模块702和反变换模块703对压缩码流进行处理,最终解码得到重建后的重建图像。由此可知,当需要展示已经存储的图像时,可以通过JPEG解码器700对已被存储的图像对应的压缩码流进行解码,而重建得到对应的图像。
JPEG的压缩码流结构,如图8所示,从图8所示的压缩码流结构的第一层可知,JPEG压缩码流以图像开始标记(SOI,Start of image)开始,包含一帧的压缩码流数据,且最后以图像结束标记(EOI,End of image)结束。从图8所示的压缩码流结构的第二层可知,所述第二层指定了帧以帧头开始,且帧包含一次或多次扫描。帧头前面可以包含作为前缀的一个或多个表说明或其他标记段。在第一次扫描后,可以选择性地出现DNL标记段,以通过DNL标记段标记本帧图像的高度。从图8所示的压缩码流结构的第三层可知,第三层指定了扫描以扫描头开始,且包含一个或多个熵编码段。每个扫描头前面可以包含作为前缀的一个或多个表说明或其他标记段。如果不允许扫描重启动,则此时仅包含一个熵编码段,并且不能出现重启动标记RST,即不出现所述第三层所示的RST0,…,RSTlast-1等重启动标记。图8所示的压缩码流结构的第三层是允许扫描重启动的,此时包含多个熵编码段,且熵编码段的数目由图像大小和事先定义的重启动间隔决定;在这种情形下,除了最后一个熵编码段外,其他熵编码段后面都存在一个重启动标记。其中,由重启动间隔的定义语法决定是否允许扫描重启动。从图8所示的压缩码流的结构的第四层可知,所述第四层指定了每个熵编码段由一个熵编码MCU序列组成,即包括多个MCU。如果允许重启动,且重启动间隔为Ri时,除了最后一个熵编码段外,其他的每个熵编码段都包含Ri个MCU。而最后一个熵编码段包含本次扫描获得的剩余的所有MCU。
SOI,全称Start of Image,用于标记图像开始的一种十六进制的标记代码,被赋值为0xFFD8,其中,最高有效位MSB(Most Significant Bit)出现在压缩数据的有序字节序列的前面。
EOI,全称End of Image,用于标记图像结束的一种十六进制的标记代码,被赋值为0xFFD9,其中,最高有效位MSB出现在压缩数据的有序字节序列的前面。
重启动间隔定义标记段,决定了是否允许本次扫描重启动,以及重启动的间隔Ri。所述重启动间隔定义标记段的语法(即前述的重启动间隔的定义语法)的结构如图9所示,图9中所示的DRI、Lr和Ri的含义请见下述说明。
DRI,全称Define Restart Interval,是用于标识重启动间隔定义标记段的开始的十六进制的标记代码,被赋值为0xFFDD,其中,最高有效位MSB出现在压缩数据的有序字节序列的前面。
Lr,是用于指定重启动间隔定义标记段的长度的十六进制的标记代码,其值恒等于0x0004,其中,最高有效位MSB应该出现在压缩数据的有序字节序列的前面。
Ri,指示重启动间隔。举一个例子,如果Ri的值为0,则表示接下来的这次扫描不允许重启动;如果Ri的值不为0,则表示接下来的这次扫描允许重启动。另外,当存在多个熵编码段时,除了最后的一个熵编码段外,其他的每个熵编码段都应该包含Ri个MCU。而最后一个熵编码段包含本次扫描所剩下的所有MCU。其中,Ri的取值范围为[0,65535]。
RSTm,重启动标记,这是一个条件标记,仅当重启动编码工具使能时,在熵编码段之间才存在该标记。其中,重启动标记RSTm共有8个各不相同的值,即,m=0,1,2,3,4,5,6,7,对应的十六进制标记代码依次为0xFFD0、0xFFD1、0xFFD2、0xFFD3、0xFFD4、0xFFD5、0xFFD6和0xFFD7。对于重启动标记RSTm的各十六进制标记代码,最高有效位MSB应该出现在压缩数据的有序字节序列的前面。在熵编码段的数量达到一定值时,所述重启动标记将循环重复出现,并最终以RSTlast-1结束,即,RST0、RST1、…RST7、RST0、RST1、…RST7、…、RSTlast-1。
以下,对本公开实施例的交通图像的拼接系统进行更具体的描述,但不应以此为限。
本公开实施例提供了一种交通图像的拼接系统,用于对多张JPEG图像的压缩码流直接进行拼接,不需要将多张JPEG图像的压缩码流解码得到空间域的多张重建图像之后,才能进行图像拼接。也就是说,本公开实施例的所述交通图像的拼接系统不需要将多张图像转换成空间域中的YUV或RGB等重建图像,才能完成图像拼接;而是直接基于多张图像的压缩码流进行拼接,就可以得到所述多张图像拼接后的图像的压缩码流,实现图像拼接。具体的,本公开实施例的系统通过直接对具有相同的重启动间隔的多张图像的压缩码流进行拼接得到拼接图对应的目标码流,以实现多张交通图像之间的拼接,由此相对于现有技术,省略了对多张图像的压缩码流进行解码、对解码得到的所有空间域重建图像进行拼接、和对拼接得到的拼接图进行编码等步骤;从而实现对多个压缩码流的快速拼接,并有利于节省硬件设备的内存和运算资源,提高硬件设备运算效率,降低硬件设备功耗和减轻CPU的运算负担;另外,相对于现有技术只能沿图像高度方向对分辨率相同的多张图像进行拼接的方式,本公开实施例还可以适用于分辨率不同的多张图像的拼接,且具有非常灵活的拼接方式——既可以实现多张图像的横向拼接,也可以实现多张图像的纵向拼接,还可以实现多张图像的横向和纵向的组合拼接,更能满足对图像进行任意拼接的使用需求,尤其是满足了多张交通图像的任意拼接的需求。
所述交通图像的拼接系统可以应用于终端,如图像采集设备(电子警察或图像抓拍装置或摄像机)、移动设备、个人助理、平板设备、计算机设备、服务器或与监控场景 相关的设备上,可以用于多张违章交通图像的拼接,以得到用于指示车辆发生何种违章行为的拼接图,但不限于此应用。另外,所述交通图像的拼接系统可以适用于任意类型的图像的拼接,例如多张JPEG图像的拼接,但不限于JPEG图像。
以下,本公开实施例以JPEG图像的拼接标准为例对所述交通图像的拼接系统进行说明,如图10所示,本公开实施例提供的交通图像的拼接系统100包括图像获取装置101和拼接装置102。
所述图像获取装置101,用于获取多张交通图像,并向所述拼接装置102传输所述多张交通图像。所述图像获取装置101向所述拼接装置102所传输的多张交通图像可以为各张交通图像的压缩后的图像。
所述拼接装置102,用于对所述多张交通图像的压缩码流进行拼接,以得到至少沿图像宽度方向进行拼接所得的拼接图的目标码流;所述多张交通图像各自的压缩码流按照相同的重启动间隔编码得到。该目标码流可以理解为目标压缩码流。
上述中,所述拼接装置102对所述多张交通图像的压缩码流的拼接操作可以在收到用户的拼接指令时执行,也可以在收到由所述图像获取装置101传输的多张交通图像时自动执行。
在一个例子中,所述多张交通图像由所述图像获取装置101在车辆存在违章行为时抓拍得到,但需要说明的是,所述多张交通图像可以包括但不限于在车辆存在违章行为时抓拍得到的图像,也可以包括因实际使用需求而在其他场景下抓拍到的图像,例如,在犯罪分子特征比对的场景下,所述多张交通图像也可以包括用于比对犯罪分子的特征的多张图像;在交通事故现场中,所述多张交通图像可以包括在交通事故现场中抓拍得到的多张图像;在路况监控场景中,所述多张交通图像还可以包括在高速路口拥堵时抓拍得到的多张图像。所述交通图像中的所有图像的分辨率可以都相同,也可以存在至少两个图像的分辨率不同。
由此,所述拼接装置102可以对上述各种场景下的多张交通图像的压缩码流进行处理,以得到所述拼接图的目标码流。在得到所述目标码流之后,可以根据所述目标码流显示所述拼接图,从而公安部门可以根据所述拼接图得知拼接图中的车辆发生了何种违章行为、或犯罪分子的特征、或交通事故现场的状况、或道路拥堵状况。
其中,对应于车辆的各种违章行为,所述多张交通图像可以包括以下中的任一种:
第一种:车辆不按导向车道行驶的至少N张抓拍图像;如图17b所示的拼接图中车辆不按导向车道行驶的4张抓拍图像。
第二种:车辆超速驾驶的至少N张抓拍图像;如图19d所示的拼接图中车辆超速驾驶的2张抓拍图像。
第三种:车辆闯红灯的至少N张抓拍图像;如图17a所示的拼接图中车辆闯红灯的4张抓拍图像。
第四种:车辆逆行的至少N张抓拍图像;如图19c所示的拼接图中车辆逆行的2张抓拍图像或如图19e所示的拼接图中车辆逆行的3张抓拍图像。
第五种:车辆实线变道的至少N张抓拍图像;如图18b所示的拼接图中车辆实线变道的4张抓拍图像或如图19f所示的拼接图中车辆实线变道的3张抓拍图像。
第六种:违法停车的至少N张抓拍图像;如图18a所示的拼接图中违法停车的4张抓拍图像。
其中,N的取值为2,3,4,5,6中的任一。
需要说明的是,车辆存在违章行为时抓拍得到的多张交通图像包括但不限于以上六种违章抓拍,上述六种违章抓拍的交通图像仅为示例。
在一个实施例中,所述图像获取装置101可以通过网络向所述拼接装置102传输所述多张交通图像,基于此,所述图像获取装置101可以与所述拼接装置102在物理上分开,例如,所述图像获取装置101可以被应用于需要对车辆的行驶状况进行监控的环境中,而所述拼接装置102可以被应用于公安部门中用于处理信息或进行信息取证的设备中。在此例中,如图11所示,所述图像获取装置101可以包括图像采集单元1011和通信单元1012;所述拼接装置102除了具有拼接图像的功能之外,还可以具有网络通信功能,或者,所述拼接装置102所应用的设备具有网络通信功能。其中,所述图像采集单元1011,用于抓拍所述多张交通图像,并向所述通信单元1012传输多张交通图像。所述通信单元1012,用于接收由所述图像采集单元1011传输的多张交通图像,并通过网络向所述拼接装置102传输所述多张交通图像。所述拼接装置102,具体用于接收所述通信单元1012传输的多张交通图像,并对所述多张交通图像的压缩码流进行拼接,以得到所述目标码流。图像采集单元1011例如是图像传感器,或者是集成有多个图像传感器的摄像机等具有图像采集功能的硬件部件。通信单元1012例如是包括无线传输模块、有线传输模块、控制模块的具有网络通信功能的硬件器件。拼接装置102例如包括处理器以及存储有机器可执行指令的存储介质,处理器通过执行机器可执行指令,能够实现本公开的图像拼接方法。
在另一实施例中,所述图像获取装置101可以不用通过网络向所述拼接装置102传输所述多张交通图像,基于此,所述图像获取装置101可以与所述拼接装置102直接在物理上连接,共同集成为一图像采集装置,可以理解为,所述图像获取装置101和所述拼接装置102属于所述图像采集装置的组成部分。在此例中,如图12所示,所述图像获取装置101和所述拼接装置102共同集成为一图像采集装置,所述图像获取装置101包括图像采集单元。所述图像采集单元,用于抓拍所述多张交通图像,并向所述拼接装置102传输多张交通图像。所述拼接装置102,具体用于接收由所述图像采集单元传输的多张交通图像,并对所述多张交通图像的压缩码流进行拼接,以得到所述目标码流。
上述任一实施例中,在任何情况下,例如未发生交通事故或车辆未发生违章行为时,如果图像获取装置101仍不断地抓拍交通图像,则会导致图像采集单元所损失的能耗较多,且抓拍到的交通图像对交通事故现场的了解或车辆违章行为的确定的意义不大。故为解决上述问题,减少所述图像采集单元对非交通事故的交通图像或非违章交通图像的抓拍操作,提高交通事故图像或违章图像的获取效率和准确性,使得所需拼接的交通图像具备更好的针对性,在一实施例中,在所述多张交通图像是所述图像采集单元抓拍的违章车辆在违章过程中的多张图像的前提下,所述图像采集单元用于在根据采集的视频 图像序列确定车辆存在违章行为时,才抓拍违章车辆在违章过程的多张交通图像。在所述多张交通图像是所述图像采集单元抓拍的交通事故现场的多张图像的前提下,所述图像采集单元用于在根据采集的视频图像序列确定发生交通事故时,才抓拍视角范围包括交通事故现场的多张交通图像。在另一实施例中,可以通过图像采集单元以外的其他装置基于所述视频图像序列确定交通事故是否发生或车辆是否存在违章行为。基于此,在所述多张交通图像是所述图像采集单元抓拍的违章车辆在违章过程中的多张图像的前提下,所述系统还可以包括违章分析装置,所述违章分析装置用于接收由所述图像采集单元传输的视频图像序列,并在根据所述视频图像序列确定所述视频图像序列中的车辆存在违章行为时,向所述图像采集单元发送违章抓拍指令;与此相应,所述图像采集单元在收到所述违章抓拍指令时,才抓拍违章车辆在违章过程的多张交通图像。在所述多张交通图像是所述图像采集单元抓拍的交通事故现场的多张图像的前提下,所述系统还可以包括交通事故检测装置;所述交通事故检测装置用于接收由所述图像采集单元传输的视频图像序列,并在根据所述视频图像序列确定发生交通事故时,向所述图像采集单元发送抓拍指令;所述图像采集单元在收到所述抓拍指令时,抓拍视角范围包括交通事故现场的多张交通图像。
其中,如何根据视频图像序列确定车辆是否存在违章行为和确定交通事故是否发生,可以从相关技术得知,在此不进行赘述。
在一个例子中,所述违章分析装置或所述交通事故检测装置可以为服务器或属于服务器的一部分,也可以属于所述图像获取装置101的一部分。
在一实施例中,所述图像获取装置101可以通过多个图像采集设备获取具有拼接需求的多张交通图像,可以理解为:所述图像获取装置101可以不具备采集图像的功能,但具备获取其他图像采集设备所采集的图像的功能。例如,在高速路口拥堵时,相同或不同道路拥堵情况的交通图像可以由安装在道路上的多个电子警察摄取得到;所述多个电子警察摄取到多张交通图像之后,可以上传到公安系统的服务器中;这么一来,当需要对所述多张交通图像进行拼接时,可以通过所述图像获取装置101向所述公安系统的服务器请求获取对应的图像。
所述拼接装置102收到由所述图像获取装置101传输的多张交通图像之后,由于通过所述图像获取装置101得到的交通图像中所有图像的初始压缩码流的重启动间隔不一定相同,故可能会对拼接装置102的拼接操作造成一定的难度,基于此,有必要解决对重启动间隔不同的压缩码流的拼接问题,以保证拼接操作的正常进行,在一实施例中,所述拼接装置102,还用于在拼接之前,确定所述多张交通图像的初始压缩码流的重启动间隔是否相同;在所述多张交通图像的初始压缩码流的重启动间隔不相同的前提下,对所述多张交通图像的全部初始压缩码流进行解码,以得到解码后的多张交通图像,并按照相同的重启动间隔对所述解码后的多张交通图像进行编码,将编码后得到的全部压缩码流进行拼接。
由此,在所述多张交通图像中存在至少两个图像的初始压缩码流的重启动间隔不同的情况下,所述拼接装置102通过对所述多张交通图像中的全部图像进行重新编码,可以理解为,将全部图像的初始压缩码流进行解码之后,再按照相同的重启动间隔对所述 解码后的全部图像进行编码,以得到重启动间隔都相同的全部压缩码流。随后,所述拼接装置102可以对所述重启动间隔都相同的全部压缩码流进行拼接得到所述目标码流。由此,通过所述拼接装置102将所有压缩码流都调整为重启动间隔都相同的压缩码流,实现了重启动间隔不同的压缩码流被调整后也可以进行拼接,保证了拼接操作的正常进行。其中,每个初始压缩码流的重启动间隔都可由初始压缩码流中的重启动间隔定义标记段中Ri所记录的数据得知,基于此,所述拼接装置102可以通过比较初始压缩码流中的Ri是否相同来判断重启动间隔是否相同。其中,为提高判断效率,所述拼接装置102只要判断得到其中的两个初始压缩码流的重启动间隔不同,即可停止判断操作,并可以得到所述初始压缩码流的重启动间隔不同的判断结果。
与此相应,在所述多张图像的初始压缩码流的重启动间隔相同的前提下,为提高拼接效率,所述拼接装置102可以不用对所述多张交通图像进行重新编码的操作,而是可以直接对所述多张交通图像的初始压缩码流进行拼接。
虽然可以通过所述拼接装置102将重启动间隔不同的所有初始压缩码流调整为重启动间隔都相同的压缩码流,但是,这一重启动间隔的调整过程可能会对所述拼接装置102的拼接效率造成影响,为解决这一技术问题,在一实施例中,考虑到图像获取装置101在获取图像之后,还需要对图像进行编码成对应的初始压缩码流,可以使图像获取装置101在采集到图像之后,按照相同的重启动间隔对所获得的所有图像进行编码,以使被首次编码的多张交通图像的压缩码流的重启动间隔都相同。这么一来,所述拼接装置102可以直接对由所述图像获取装置101传输的所有压缩码流直接进行拼接,不需要进行调整重启动间隔的操作。
在一实施例中,所述拼接装置102按照相同的重启动间隔对所述解码后的多张交通图像进行编码的过程,或者,所述图像获取装置101按照相同的重启动间隔对所获得的所有图像进行编码的过程可以包括:
确定所述多张交通图像的目标重启动间隔;所述目标重启动间隔用于所述多张交通图像进行图像拼接之前的编码;
根据所述目标重启动间隔,将所述多张交通图像分别编码成对应的压缩码流。
在一实施例中,所述拼接装置102或所述图像获取装置101确定所述多张交通图像中的任一图像的目标重启动间隔的过程可以包括:
针对所述多张交通图像中的任一图像,根据所述图像沿水平方向的最大水平采样因子和所述图像的编码块划分信息,确定所述图像的原始重启动间隔;
计算所需拼接的所有交通图像的原始重启动间隔的公约数;
从所述公约数中选取大于1的公约数或最大公约数作为所述目标重启动间隔。
其中,所述编码块划分信息是指在编码过程中,将图像划分成若干图像块以实现编码时,每个图像块的像素信息;例如,所述图像块可以视为一个最小编码单元MCU,相应地,所述编码块划分信息可以指所述MCU的像素单位。需要说明的是,本公开中的图像块不限于最小编码单元,也可以是其他规模的块。
基于上述例子,对所述针对所述多张交通图像中的任一图像,根据所述图像沿水平方向的最大水平采样因子和所述图像的编码块划分信息,确定所述图像的原始重启动间隔的理解可以为:针对任一图像,根据所述最大水平采样因子和所述图像的分辨率,确定所述图像中任一行的最小编码单元MCU的数量,并将所述MCU的数量作为该图像的原始重启动间隔;其中,由于同一图像中不同MCU行的MCU总数相同,所以只需确定其中一MCU行的MCU的数量即可。对所述计算所需拼接的所有交通图像的原始重启动间隔的公约数的理解可以为:计算所述各个交通图像的MCU行的MCU总数的公约数。
以下,举一例子说明一下所述拼接装置102或所述图像获取装置101计算所述目标重启动间隔的过程:
如图13所示,假设交通图像共有(n+1)张,这些图像的宽度分别为Wi,高度分别为Hi,其中,i=0,1,2,…,n;Wi和Hi的单位都为像素。在对这(n+1)张图像进行编码之前,先获取图像的颜色空间不同分量(包括代表亮度信息的Y分量和代表色差信息的UV分量)的采样因子,并确定水平采样因子的最大值和垂直采样因子的最大值,也即,可以得到最大水平采样因子Hmax和最大垂直采样因子Vmax;Hmax和Vmax的单位都为像素。其中,各图像所采用的采样因子都相同。
由于JPEG图像进行量化时是以8×8的矩阵进行的,所以得到的每一图像的最小编码单元MCU的宽为8×Hmax,高为8×Vmax。并由于同一图像中不同行的MCU的数量都相同,那么根据计算所得的最小编码单元MCU的宽,可以进一步计算得到每一图像的水平方向上的任一行所包含的MCU个数RI,即,RI=Wi/(8×Hmax),其中,I=0,1,2,…,n。
上述中,除了拼接位置处于最右侧的图像外,其他图像都满足以下条件:Wi/(8×Hmax)的值为整数。这么一来,除了拼接位置处于最右侧的图像以外的其他图像每行所包含的MCU的个数RI=Wi/(8×Hmax)的值也为整数。对于拼接位置处于最右侧的图像,如果Wi/(8×Hmax)的值为整数,则其水平方向上每行所包含的MCU的个数RI=Wi/(8×Hmax)的值也为整数;如果Wi/(8×Hmax)的值为非整数,则其水平方向上每行所包含的MCU的个数Ri等于Wi/(8×Hmax)的值取整后加1;其中的取整是指取Wi/(8×Hmax)的值的整数部分。
由此所述拼接装置102或所述图像获取装置101便可计算得到各图像任一行所包含的MCU的数量,接下来可以根据计算所得的各图像的任一行的MCU的数量,计算得到所有图像一行中MCU的数量的公约数,例如,假设3张图像一行中MCU的数量分别是2、4、8,则这3张图像一行中的MCU的数量的公约数为1和2。随后就可以将计算所得的公约数1或2作为用于所述多张交通图像进行图像拼接之前的编码的目标重启动间隔。
为提高编码效率,在一实施例中,可以将最大公约数作为所述目标重启动间隔。
所述拼接装置102或所述图像获取装置101得到所述目标重启动间隔之后,即可根据所述目标重启动间隔对所述交通图像进行编码,以生成每个交通图像对应的压缩码流。其中,所述拼接装置102或所述图像获取装置101根据所述目标重启动间隔,对 所述多张交通图像进行编码的过程可以包括:
针对所述多张交通图像中的任一图像,根据所述目标重启动间隔确定所述图像的熵编码段;
根据所述熵编码段对所述图像进行编码,得到所述图像对应的压缩码流。
由上述可知,由于所述多张交通图像的宽度像素可能不同,那么所述拼接装置102依据相同的目标重启动间隔对所述多张交通图像进行编码的过程中,对于宽度像素最小的图像,其一行所对应的熵编码段的数量可能为1;对于宽度像素较大的图像,其一行所对应的熵编码段的数量大于1,且为1的整数倍。并且,每个图像一行所对应的熵编码段的数量会随着所述目标重启动间隔的大小而变化,例如,对于一行有8个MCU的图像,如果所述目标重启动间隔为1,则该图像一行所对应的熵编码段有8个,如果所述目标重启动间隔为8,则该图像一行所对应的熵编码段只有1个。由此可知,每个图像一行所对应的熵编码段的数量与所述目标重启动间隔的大小呈负相关关系。
上述对每个图像进行编码的过程中,先在扫描头配置重启动间隔定义标记段,以使所述重启动间隔定义标记段的重启动间隔Ri被置为所述目标重启动间隔,从而使能JPEG编码的重启动间隔。假设所述目标重启动间隔的值为R0,则将每个图像的重启动间隔Ri置为所述目标重启动间隔后,每一图像在编码时的每个熵编码段都包含R0个MCU。在每相邻两熵编码段之间,都标识有重启动标记RSTm;所述重启动标记RSTm将循环出现,即,RST0、RST1、…RST7、RST0、RST1、…RST7、…、RSTlast-1。其中,除了拼接位置位于最下方的图像外,其他图像的高度Hi都为MCU的高度的整数倍。由此,可以得到各图像的压缩码流。在这一过程中,各图像的编码过程是相对独立的,且得到的各压缩码流也是相对独立的,互不混淆。
得到重启动间隔都相同的所述多张交通图像的压缩码流之后,所述拼接装置102对重启动间隔都相同的全部压缩码流的拼接过程可以包括:
根据所述多张交通图像在拼接图中的预定拼接位置,对所述多张交通图像对应的所有压缩码流中的所有熵编码段进行重排序;
根据重新排序后的所有熵编码段,得到所述多张交通图像的拼接图对应的目标码流。
上述中,交通图像在拼接图中的预定拼接位置可以由用户指定,也可以由所述拼接系统自行根据默认模板确定。其中,用户可以通过采用所述拼接系统自带的拼接模板指定各图像的拼接位置,也可以通过自定义的组合拼接方式指定各图像的拼接位置。例如,在对各图像进行拼接之前,用户可以从所述拼接系统所保存的拼接模板中选取所需模板,这样在后续拼接中,所述拼接系统可以根据被选中的模板确定各图像的预定拼接位置;或者,用户可以通过一一指定各图像的拼接顺序,这样在后续拼接中,所述拼接系统可以根据默认的模板按所述拼接顺序确定各图像的预定拼接位置。
在所述预定拼接位置由用户指定的情况下,在一实施例中,所述系统还可以包括显示装置,所述显示装置用于在所述拼接装置102对所述多张交通图像进行拼接之前,显示拼接设定区域,以使用户通过所述拼接设定区域预定所述多张交通图像的拼接位置。相应地,所述拼接装置102,还可以用于检测所述拼接设定区域的输入信息,并根据输 入信息确定所述多张交通图像的拼接位置。
确定各图像在拼接图中的预定拼接位置之后,所述拼接装置102即可根据各图像的预定拼接位置确定拼接图每一行所对应的熵编码段,并根据从上到下,从左往右的顺序从对应的图像的压缩码流中依序获取对应的熵编码段,以实现对所有图像的所有压缩码流中的所有熵编码段的重新排序。
所述拼接装置102对所有图像的所有压缩码流中的所有熵编码段进行重新排序后,即可根据重新排序后的所有熵编码段,得到所述多张交通图像的拼接图对应的目标码流。在一实施例中,为进一步提高所获得的目标码流的准确性,所述拼接装置102根据重新排序后的所有熵编码段,得到所述多张交通图像的拼接图对应的目标码流的过程可以包括:
在重新排序后的所有熵编码段中,依序修改每相邻两个熵编码段之间的重启动标记,以使得到的目标码流中的重启动标记依序排列;
根据所述多张交通图像在拼接图中的预定拼接位置,确定所述拼接图的实际宽度和实际高度;
将重启动标记依序排序后的目标码流中用于表示图像宽度和图像高度的字节分别修改为所述拼接图的实际宽度和实际高度所对应的字节。
如图14所示,以下简单概括一下所述拼接装置102基于所述交通图像对应的全部压缩码流,生成所述交通图像的拼接图对应的目标码流的过程。
1)首先,对所有熵编码段重新排序:根据每一图像在所需拼接形成的拼接图中的预定拼接位置,对所有图像的压缩码流的所有熵编码段依序排序,从而获得所有图像的所有压缩码流的所有熵编码段的拼接顺序。
2)其次,对所有熵编码段进行拼接:取出对应于所需拼接形成的拼接图中左上角位置的图像(后文简称第一图像)对应的压缩码流(后文简称第一压缩码流)。由于所述第一图像位于所述拼接图中的左上角位置,所以所述第一图像的第一行上的MCU在所述第一压缩码流中对应的熵编码段,必然是所述拼接图对应的目标码流中排在最前面的熵编码段。由此,可以根据上述1)中所得到的拼接排序,依序从各图像的压缩码流中获取对应的熵编码段的码流数据,并依序对获得的码流数据进行拼接,直至拼接完所有熵编码段,以得到目标码流。
3)接着,更新/修改所有重启动标记:通过上述2)得到目标码流后,对所述目标码流中每相邻两个熵编码段之间的重启动标记进行更新操作,也即,依照所述目标码流中所有熵编码段排列的先后顺序,将每相邻两个熵编码段之间的重启动标记依序更新为,RST0、RST1、…RST7、RST0、RST1、…RST7、…、RSTlast-1,即8个重启动标记依次出现并循环重复,但最后一个重启动标记必须要以RSTlast-1标记,以表示结束。由此得到重启动标记修改后的目标码流。
4)最后,修改帧头信息:对所述目标码流的重启动标记进行修改后,进一步修改所述重启动标记修改后的目标码流的帧头信息。具体地,根据所有图像的实际宽度、实际高度和拼接位置,可以计算得到所述拼接图的实际宽度和实际高度。这样一来,就 可以根据所述拼接图的实际宽度和实际高度,将所述重启动标记修改后的目标码流的帧头信息中用于表示图像宽度和高度的字节分别修改为所述拼接图的实际宽度和实际高度所对应的字节。从而得到所述拼接图的JPEG压缩码流。
这么一来,在需要显示所有交通图像拼接形成的拼接图时,可以通过所述显示装置或所述拼接装置102先对所述JPEG压缩码流进行解码操作,以重建在空间域的拼接图,随后由所述显示装置展示所述拼接图即可,由此可知,所述显示装置还可以用于接收由所述拼接装置102传输的所述目标码流,并根据所述目标码流显示所述拼接图。
需要说明的是,上述对拼接图的解码和显示是基于具有解码功能的系统来说的,对于不具有解码功能的系统,要实现对拼接图的展示,可以通过物理接线或网络通信的方式将所述目标码流发送到具有解码功能的装置,以通过具有解码功能的装置对所述目标码流进行解码后,显示解码得到的拼接图。
需要说明的是,本公开所记载的其中一个实施例虽然可以将解码功能、编码功能、拼接功能、以及对拼接设定区域的输入信息的检测功能一同集成于所述拼接装置102,但是,在其他实施例中,所述拼接装置102可以仅具有拼接功能,相应的,所述解码功能、编码功能和检测功能可以由所述拼接装置102以外的其它装置实现。
在另一实施例中,对应于可以同时具有解码功能、编码功能、拼接功能和检测功能的拼接装置102,所述拼接装置102可以包括用于实现对压缩码流进行解码的功能的解码模块(如解码器)、用于实现对图像进行编码的功能的编码模块(如编码器)、用于实现对图像的压缩码流进行拼接的功能的拼接模块、以及用于实现对所述拼接设定区域的输入信息的检测的功能的检测模块。
以下,举例说明一下本公开实施例所提供的交通图像的拼接系统的实际应用场景,但本公开实施例所提供的交通图像的拼接系统并不限于以下应用场景。
在一个例子中,本公开实施例所提供的交通图像的拼接系统可以应用于电子警察抓拍闯红灯对象的场景,如下。
在交通行业的视频监控应用领域中,一般需要借助电子警察所拍下的其中四张照片才能判断车辆是否发生闯红灯行为。所述四张照片中,第一张照片一般显示车辆驶过停止线的场景,第二张照片一般显示车辆行驶在路口中央的场景,第三张照片一般显示车辆到达路口对面的场景,第四张照片一般是清晰记录车辆车牌信息的特写放大照片。由于这四张照片是不同时刻生成的,那么需要依次在不同时刻对这四张照进行编码,而无法先拼接好这四张图像再进行编码。但是,在后续的照片存档中,一般需要将这四张照片进行拼接以合并为一个拼接图的JPEG压缩码流文件,从而方便后期查档时的查看。在这种情况下,一般以“田字形”的拼接方式对这四张照片进行拼接。其中,所述“田字形”的拼接方式可以理解为是一种对称的四宫格拼接方式。
为便于说明,在本例中,假设所述四张照片的分辨率都为1920×1088,MCU的大小为16×16,由此可知,每张照片一行共有120(即1920÷16)个MCU。这么一来,可以通过所述拼接装置102或所述图像获取装置101计算得到所有照片任一行的MCU的数量的最大公约数为120,此时,每张照片的一个重启动间隔(即一个熵编码段) 都是由一行MCU组成,也即,每张照片的每一行对应的熵编码段的总数为1。因此对每张照片进行编码后得到的每张照片的压缩码流都有68(即1088÷16)个熵编码段,如图15所示,此时,每张照片的压缩码流都是相互独立的。在获得每张照片的压缩码流后,通过所述拼接装置102对所有压缩码流的熵编码段进行重新排序、依序更新所述目标码流中每相邻两个熵编码段之间的重启动标记和修改所述目标码流的帧头信息,以得到最终拼接完成的目标码流。与现有技术相比,本公开实施例通过按照预定的拼接顺序直接将具有相同的重启动间隔的4张图像的所有熵编码段进行重新排序和拼接,能同时实现宽度方向和高度方向的拼接,如图16所示,此时,所述四张照片的熵编码段被组合在一起,拼接形成一个拼接图对应的熵编码段。基于此,得到的拼接图的效果可以如图17a、图17b、图18a或图18b所示,4张照片以对称的四宫格的形式排布在拼接图中。
其中,由图17a所示的拼接图可知,拼接图所示的车辆发生了闯红灯的违章行为;由图17b所示的拼接图可知,拼接图所示的车辆发生了不按导向行驶的违章行为;由图18a所示的拼接图可知,拼接图所示的车辆发生了违法停车的违章行为;由图18b所示的拼接图可知,拼接图所示的车辆发生了实线变道的违章行为。
当然,本公开实施例对多张交通图像的拼接方式并不限于所述“田字形”的拼接方式,还可以为其他方式,例如,以不对称且不均匀的多宫格的拼接方式得到图19a或图19b所示的拼接图,图19a中的拼接图上部分的图像的数量少于拼接图下部分的图像的数量,图19b中的拼接图上部分的图像的数量多于拼接图下部分的图像的数量;或者,以纵向拼接的方式得到图19c所示的拼接图,使拼接图中的所有图像从上到下依序排布;或者,以横向拼接的方式得到图19d所示的拼接图,使拼接图中的所有图像从左到右依序排布;或者,以“上一下二”的拼接方式得到图19e所示的拼接图,或以“上二下一”的拼接方式得到图19f所示的拼接图;其中,可以认为所述“上一下二”和所述“上二下一”为一种非对称的三宫格。
由上述可知,本公开不仅可以适用于分辨率不同的多张图像的拼接,而且对多张交通图像的拼接方式灵活,既可以实现多张交通图像的横向拼接,也可以实现多张图像的纵向拼接,还可以实现多张图像的横向和纵向的组合拼接,尤其是满足了多张交通图像的任意拼接的需求。由此,所述拼接图中,所述多张交通图像沿所述拼接图宽度方向和高度方向进行排布或只沿宽度方向进行排布,排布方式可以包括:所述多张交通图像以对称多宫格的形式排布,或者以非对称多宫格的形式排布。
需要说明的是,在上述应用示例中,为了提高编码效率,都将所述目标重启动间隔设置为所有交通图像一行的MUC数量的最大公约数,但在其他实施例中,可以不选取最大公约数作为所述目标重启动间隔,基于此,每个图像一行所对应的熵编码段的数量也会发生变化。
对于系统实施例而言,以上所描述的系统实施例仅仅是示意性的,其中所述作为分离部件说明的装置可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元。
与前述交通图像的拼接系统的实施例相对应,本公开实施例还提供一种交通图 像的拼接方法。所述方法可以应用在图像设备(电子警察或图像抓拍装置或摄像机)、移动设备、个人助理、平板设备、计算机设备、服务器或与监控场景相关的设备上,可以用于多张违章交通图像的拼接,以得到用于指示车辆发生何种违章行为的拼接图,但不限于此应用。另外,所述交通图像的拼接方法可以适用于任意类型的图像的拼接,例如多张JPEG图像的拼接,但不限于JPEG图像。
以下,本公开实施例以JPEG图像的拼接标准为例对所述交通图像的拼接方法进行说明,如图20所示,本公开实施例提供的交通图像的拼接方法包括:
S201,获取多张交通图像;
S203,对所述多张交通图像的压缩码流进行拼接,以得到至少沿图像宽度方向进行拼接所得的拼接图的目标码流;所述多张交通图像各自的压缩码流按照相同的重启动间隔编码得到。
通过上述方法得到的拼接图中,所述多张交通图像沿所述拼接图宽度方向和高度方向进行排布或只沿宽度方向进行排布,排布方式包括:所述多张交通图像以对称多宫格的形式排布,或者以非对称多宫格的形式排布。
所述多张交通图像在车辆存在违章行为时抓拍得到;所述多张交通图像包括以下中的任一,但不限于以下示例:
车辆不按导向车道行驶的至少N张抓拍图像;
车辆超速驾驶的至少N张抓拍图像;
车辆闯红灯的至少N张抓拍图像;
车辆逆行的至少N张抓拍图像;
车辆实线变道的至少N张抓拍图像;
违法停车的至少N张抓拍图像;
其中,N的取值为2,3,4,5,6中的任一。
需要说明的是,所述多张交通图像可以包括但不限于在车辆存在违章行为时抓拍得到的图像,也可以包括因实际使用需求而在其他场景下抓拍到的图像,例如,在犯罪分子特征比对的场景下,所述多张交通图像也可以包括用于比对犯罪分子的特征的多张图像;在交通事故现场中,所述多张交通图像可以包括在交通事故现场中抓拍得到的多张图像;在路况监控场景中,所述多张交通图像还可以包括在高速路口拥堵时抓拍得到的多张图像。所述交通图像中的所有图像的分辨率可以都相同,也可以存在至少两个图像的分辨率不同。
在一实施例中,所述多张交通图像由图像获取装置获得,所述图像获取装置包括图像采集单元和通信单元;所述多张交通图像的压缩码流由拼接装置拼接成所述目标码流。
相应地,所述步骤S201中,获取多张交通图像,包括:
所述图像采集单元抓拍所述多张交通图像,并通过所述通信单元向所述拼接装置传 输所述多张交通图像,以使所述拼接装置对由所述通信单元传输的多张交通图像的压缩码流进行拼接。
在另一实施例中,所述多张交通图像由图像获取装置获得;所述多张交通图像的压缩码流由拼接装置拼接成所述目标码流;所述图像获取装置和所述拼接装置共同集成为一图像采集装置;所述图像获取装置包括图像采集单元;
所述获取多张交通图像,包括:
所述图像采集单元抓拍所述多张交通图像,并向所述拼接装置传输多张交通图像。
在一实施例中,在所述多张交通图像是所述图像采集单元抓拍的违章车辆在违章过程中的多张图像的前提下,所述图像采集单元在根据采集的视频图像序列确定车辆存在违章行为时,才抓拍所述多张交通图像;或者所述图像采集单元在收到抓拍指令时,才抓拍所述多张交通图像;所述抓拍指令由违章分析装置根据所述图像采集单元采集的视频图像序列确定车辆存在违章行为时,向所述图像采集单元发送。
在一实施例中,在所述多张交通图像是所述图像采集单元抓拍的交通事故现场的多张图像的前提下,所述图像采集单元在根据采集的视频图像序列确定发生交通事故时,才抓拍视角范围包括交通事故现场的多张交通图像;或者所述图像采集单元在收到抓拍指令时,才抓拍视角范围包括交通事故现场的多张交通图像;所述抓拍指令由交通事故检测装置根据所述图像采集单元采集的视频图像序列确定发生交通事故时,向所述图像采集单元发送。
在一实施例中,所述多张交通图像可以来自多个图像采集设备。
在一实施例中,所述方法还可以包括:
根据所述目标码流显示所述拼接图。
在一实施例中,由于通过所述步骤S201所获得的所有交通图像的重启动间隔不一定都相同,从而可能会增大拼接难度,故为解决重启动间隔不同的压缩码流的拼接问题,实现重启动间隔不同的压缩码流被调整后也可以进行拼接,保证拼接操作的正常进行,在对所述多张交通图像的压缩码流进行拼接之前,所述方法还可以包括:
S2021,确定所述多张交通图像的初始压缩码流的重启动间隔是否相同;
S2022,在所述多张图像的初始压缩码流的重启动间隔相同的前提下,直接对所述多张图像的初始压缩码流进行拼接;
S2023,在所述多张图像的初始压缩码流的重启动间隔不同的前提下,对所述多张交通图像的全部初始压缩码流进行解码,以得到解码后的多张交通图像;并按照相同的重启动间隔对所述解码后的多张交通图像进行编码,以得到所述多张交通图像的所述压缩码流。
在一实施例中,所述步骤S2023中,按照相同的重启动间隔对所述解码后的多张交通图像进行编码,包括:
S20231,确定所述多张交通图像的目标重启动间隔;所述目标重启动间隔用于所述 多张交通图像进行图像拼接之前的编码;
S20232,根据所述目标重启动间隔,将所述多张交通图像分别编码成对应的压缩码流。
在一实施例中,所述步骤S20231可以包括:
S202311,针对所述多张交通图像中的任一图像,根据所述图像沿水平方向的最大水平采样因子和所述图像的编码块划分信息,确定所述图像的原始重启动间隔;
S202312,计算所需拼接的所有交通图像的原始重启动间隔的公约数;
S202313,从所述公约数中选取大于1的公约数或最大公约数作为所述目标重启动间隔。
在一实施例中,所述步骤S20232可以包括:
S202321,针对所述多张交通图像中的任一图像,根据所述目标重启动间隔确定所述图像的熵编码段;
S202322,根据所述熵编码段对所述图像进行编码,得到所述图像对应的压缩码流。
在一实施例中,所述步骤S203中,所述对所述多张交通图像的压缩码流进行拼接,可以包括:
S2031,根据所述多张交通图像在拼接图中的预定拼接位置,对所述多张图像的所有压缩码流中的所有熵编码段进行重排序;
S2032,根据重新排序后的所有熵编码段,得到所述多张交通图像的拼接图对应的目标码流。
在一实施例中,所述步骤S2032可以包括:
S20321,在重新排序后的所有熵编码段中,依序修改每相邻两个熵编码段之间的重启动标记,以使得到的目标码流中的重启动标记依序排列;
S20322,根据所述多张交通图像在拼接图中的预定拼接位置,确定所述拼接图的实际宽度和实际高度;
S20323,将重启动标记依序排序后的目标码流中用于表示图像宽度和图像高度的字节分别修改为所述拼接图的实际宽度和实际高度所对应的字节。
在一实施例中,所述预定拼接位置的确定过程包括:
在对所述多张交通图像进行拼接之前,显示拼接设定区域,以使用户通过所述拼接设定区域预定所述多张交通图像的拼接位置;
检测所述拼接设定区域的输入信息,并根据所述输入信息确定所述多张交通图像的拼接位置。
上述方法中各个步骤的实现过程具体参见上述系统中对应装置的实现过程,在此不再赘述。
上述各个实施例中所提供的交通图像的拼接方法至少包括以下有益技术效果:
本公开实施例的交通图像的拼接方法通过直接对具有相同的重启动间隔的多张交通图像的压缩码流进行拼接得到拼接图对应的目标码流,相对于现有技术,省略了对多张交通图像的压缩码流进行解码、对解码得到的所有空间域重建图像进行拼接、和对拼接得到的拼接图进行编码等步骤;从而实现对多个压缩码流的快速拼接,并有利于节省硬件设备的内存和运算资源,提高硬件设备运算效率,降低硬件设备功耗和减轻CPU的运算负担;另外,相对于现有技术只能沿图像高度方向对分辨率相同的多张图像进行拼接的方式,本公开实施例还可以适用于分辨率不同的多张交通图像的拼接,且具有非常灵活的拼接方式——既可以实现多张交通图像的横向拼接,也可以实现多张交通图像的纵向拼接,还可以实现多张交通图像的横向和纵向的组合拼接,更能满足对交通图像进行任意拼接的使用需求,尤其是满足了多张交通图像的任意拼接的需求。
与前述交通图像的拼接方法的实施例相对应,本公开实施例还提供了一种电子设备,所述电子设备包括:
处理器;
存储器,用于存储可由所述处理器执行的计算机程序;
其中,所述处理器执行所述程序时实现前述任一方法实施例中的所述交通图像的拼接方法的步骤。
本公开所提供的交通图像的拼接系统的实施例可以应用在电子设备上。以软件实现为例,作为一个逻辑意义上的系统,是通过其所在电子设备的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图21所示,图21是本公开根据一示例性实施例示出的电子设备的一种硬件结构图,除了图21所示的处理器510、内存530、接口520、以及非易失性存储介质540之外,所述电子设备通常根据该电子设备的实际功能,还可以包括其他硬件,对此不再赘述。
由于本公开实施例所提供的上述电子设备与前述任一实施例中的交通图像的拼接方法对应,因此,本公开实施例的电子设备也至少包括以下有益技术效果:
本公开实施例的电子设备通过直接对具有相同的重启动间隔的多张交通图像的压缩码流进行拼接得到拼接图对应的目标码流,相对于现有技术,省略了对多张交通图像的压缩码流进行解码、对解码得到的所有空间域重建图像进行拼接、和对拼接得到的拼接图进行编码等步骤;从而实现对多个压缩码流的快速拼接,并有利于节省硬件设备的内存和运算资源,提高硬件设备运算效率,降低硬件设备功耗和减轻CPU的运算负担;另外,相对于现有技术只能沿图像高度方向对分辨率相同的多张图像进行拼接的方式,本公开实施例还可以适用于分辨率不同的多张交通图像的拼接,且具有非常灵活的拼接方式——既可以实现多张交通图像的横向拼接,也可以实现多张交通图像的纵向拼接,还可以实现多张交通图像的横向和纵向的组合拼接,更能满足对交通图像进行任意拼接的使用需求,尤其是满足了多张交通图像的任意拼接的需求。
与前述交通图像的拼接方法的实施例相对应,本公开实施例还提供一种计算机可读存储介质,其上存储有计算机程序,所述程序被处理器执行时实现前述任一方法实 施例中的交通图像的拼接方法的步骤。
本公开可采用在一个或多个其中包含有程序代码的存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。计算机可读存储介质包括永久性和非永久性、可移动和非可移动媒体,可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机可读存储介质的例子包括但不限于:相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。
由于本公开实施例所提供的上述计算机可读存储介质与前述任一实施例中的交通图像的拼接方法对应,因此,本公开实施例的计算机可读存储介质也至少包括以下有益技术效果:
本公开实施例的计算机可读存储介质通过直接对具有相同的重启动间隔的多张交通图像的压缩码流进行拼接得到拼接图对应的目标码流,相对于现有技术,省略了对多张交通图像的压缩码流进行解码、对解码得到的所有空间域重建图像进行拼接、和对拼接得到的拼接图进行编码等步骤;从而实现对多个压缩码流的快速拼接,并有利于节省硬件设备的内存和运算资源,提高硬件设备运算效率,降低硬件设备功耗和减轻CPU的运算负担;另外,相对于现有技术只能沿图像高度方向对分辨率相同的多张图像进行拼接的方式,本公开实施例还可以适用于分辨率不同的多张交通图像的拼接,且具有非常灵活的拼接方式——既可以实现多张交通图像的横向拼接,也可以实现多张交通图像的纵向拼接,还可以实现多张交通图像的横向和纵向的组合拼接,更能满足对交通图像进行任意拼接的使用需求,尤其是满足了多张交通图像的任意拼接的需求。
以上所述仅为本公开的较佳实施例而已,并不用以限制本公开,凡在本公开的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本公开保护的范围之内。

Claims (27)

  1. 一种交通图像的拼接系统,其特征在于,所述系统包括:
    图像获取装置,用于获取多张交通图像,并向拼接装置传输所述多张交通图像;
    所述拼接装置,用于对所述多张交通图像的压缩码流进行拼接,以得到至少沿图像宽度方向进行拼接所得的拼接图的目标码流;所述多张交通图像各自的压缩码流按照相同的重启动间隔编码得到。
  2. 根据权利要求1所述的系统,其特征在于,所述多张交通图像由所述图像获取装置在车辆存在违章行为时抓拍得到;所述多张交通图像包括以下中的任一:
    车辆不按导向车道行驶的至少N张抓拍图像;
    车辆超速驾驶的至少N张抓拍图像;
    车辆闯红灯的至少N张抓拍图像;
    车辆逆行的至少N张抓拍图像;
    车辆实线变道的至少N张抓拍图像;
    违法停车的至少N张抓拍图像;
    其中,N的取值为2,3,4,5,6中的任一。
  3. 根据权利要求1或2所述的系统,其特征在于,所述拼接图中,所述多张交通图像沿所述拼接图宽度方向和高度方向进行排布或者只沿宽度方向进行排布,排布方式包括:对称排布或非对称排布。
  4. 根据权利要求1或2所述的系统,其特征在于,所述拼接图中,所述多张交通图像沿所述拼接图宽度方向和高度方向进行排布或者只沿宽度方向进行排布,排布方式包括:
    所述多张交通图像以对称多宫格的形式排布,或者以非对称多宫格的形式排布。
  5. 根据权利要求1所述的系统,其特征在于,所述图像获取装置包括图像采集单元和通信单元;
    所述图像采集单元,用于抓拍所述多张交通图像,并向所述通信单元传输多张交通图像;
    所述通信单元,用于接收由所述图像采集单元传输的多张交通图像,并通过网络向所述拼接装置传输所述多张交通图像;
    所述拼接装置,用于接收所述通信单元传输的多张交通图像,并对所述多张交通图像的压缩码流进行拼接,以得到所述目标码流。
  6. 根据权利要求1所述的系统,其特征在于,所述图像获取装置和所述拼接装置共同集成为一图像采集装置;所述图像获取装置包括图像采集单元;
    所述图像采集单元,用于抓拍所述多张交通图像,并向所述拼接装置传输多张交通图像;
    所述拼接装置,用于接收由所述图像采集单元传输的多张交通图像,并对所述多张交通图像的压缩码流进行拼接,以得到所述目标码流。
  7. 根据权利要求5或6所述的系统,其特征在于,
    所述多张交通图像是所述图像采集单元抓拍的违章车辆在违章过程中的多张图像;
    所述图像采集单元,还用于在根据采集的视频图像序列确定车辆存在违章行为时,才抓拍所述多张交通图像;或者所述系统还包括违章分析装置;所述违章分析装置用于 接收由所述图像采集单元传输的视频图像序列,并在根据所述视频图像序列确定所述视频图像序列中的车辆存在违章行为时,向所述图像采集单元发送违章抓拍指令;所述图像采集单元在收到所述违章抓拍指令时,才抓拍所述多张交通图像。
  8. 根据权利要求5或6所述的系统,其特征在于,
    所述多张交通图像是所述图像采集单元抓拍的交通事故现场的多张图像;
    所述图像采集单元,还用于在根据采集的视频图像序列确定发生交通事故时,抓拍视角范围包括交通事故现场的多张交通图像;或者所述系统还包括交通事故检测装置;所述交通事故检测装置用于接收由所述图像采集单元传输的视频图像序列,并在根据所述视频图像序列确定发生交通事故时,向所述图像采集单元发送抓拍指令;所述图像采集单元在收到所述抓拍指令时,抓拍视角范围包括交通事故现场的多张交通图像。
  9. 根据权利要求1所述的系统,其特征在于,所述图像获取装置,用于获取具有拼接需求的多张交通图像,其中,所述多张交通图像来自多个图像采集设备。
  10. 根据权利要求1所述的系统,其特征在于,所述系统还包括显示装置;所述显示装置用于接收由所述拼接装置传输的所述目标码流,并根据所述目标码流显示所述拼接图。
  11. 根据权利要求1所述的系统,其特征在于,所述拼接装置,还用于在拼接之前,确定所述多张交通图像的初始压缩码流的重启动间隔是否相同;在所述多张图像的初始压缩码流的重启动间隔相同的前提下,直接对所述多张交通图像的初始压缩码流进行拼接;在所述多张交通图像的初始压缩码流的重启动间隔不同的前提下,对所述多张交通图像的全部初始压缩码流进行解码,以得到解码后的多张交通图像,并按照相同的重启动间隔对所述解码后的多张交通图像进行编码,将编码后得到的全部压缩码流进行拼接。
  12. 根据权利要求1或11所述的系统,其特征在于,所述拼接装置,用于根据所述多张交通图像在拼接图中的预定拼接位置,对所述多张交通图像的所有压缩码流中的所有熵编码段进行重排序;根据重新排序后的所有熵编码段,得到所述多张交通图像的拼接图对应的目标码流。
  13. 根据权利要求1~12任一项所述的系统,其特征在于,所述相同的重启动间隔通过以下方式获得:
    针对所述多张交通图像的任一图像,根据所述图像沿水平方向的最大水平采样因子和所述图像的编码块划分信息,确定所述图像的原始重启动间隔;
    计算所述多张交通图像的原始重启动间隔的公约数;
    从所述公约数中选取大于1的公约数或最大公约数作为所述相同的重启动间隔。
  14. 一种交通图像的拼接方法,其特征在于,所述方法包括:
    获取多张交通图像;
    对所述多张交通图像的压缩码流进行拼接,以得到至少沿图像宽度方向进行拼接所得的拼接图的目标码流;所述多张交通图像各自的压缩码流按照相同的重启动间隔编码得到。
  15. 根据权利要求14所述的方法,其特征在于,所述多张交通图像在车辆存在违章行为时抓拍得到;所述多张交通图像包括以下中的任一:
    车辆不按导向车道行驶的至少N张抓拍图像;
    车辆超速驾驶的至少N张抓拍图像;
    车辆闯红灯的至少N张抓拍图像;
    车辆逆行的至少N张抓拍图像;
    车辆实线变道的至少N张抓拍图像;
    违法停车的至少N张抓拍图像;
    其中,N的取值为2,3,4,5,6中的任一。
  16. 根据权利要求14或15所述的方法,其特征在于,所述拼接图中,所述多张交通图像沿所述拼接图宽度方向和高度方向进行排布或只沿宽度方向进行排布,排布方式包括:对称排布或非对称排布。
  17. 根据权利要求14或15所述的方法,其特征在于,所述拼接图中,所述多张交通图像沿所述拼接图宽度方向和高度方向进行排布或者只沿宽度方向进行排布,排布方式包括:
    所述多张交通图像以对称多宫格的形式排布,或者以非对称多宫格的形式排布。
  18. 根据权利要求14所述的方法,其特征在于,所述多张交通图像由图像获取装置获得,所述图像获取装置包括图像采集单元和通信单元;所述多张交通图像的压缩码流由拼接装置拼接成所述目标码流;其中,所述拼接装置包括处理器以及存储有机器可执行指令的存储介质,
    所述获取多张交通图像,包括:
    所述图像采集单元抓拍所述多张交通图像,并通过所述通信单元向所述拼接装置传输所述多张交通图像,以使所述拼接装置对由所述通信单元传输的多张交通图像的压缩码流进行拼接。
  19. 根据权利要求14所述的方法,其特征在于,所述多张交通图像由图像获取装置获得;所述多张交通图像的压缩码流由拼接装置拼接成所述目标码流;所述图像获取装置和所述拼接装置共同集成为一图像采集装置;所述图像获取装置包括图像采集单元;
    所述获取多张交通图像,包括:
    所述图像采集单元抓拍所述多张交通图像,并向所述拼接装置传输多张交通图像。
  20. 根据权利要求18或19所述的方法,其特征在于,
    所述多张交通图像是所述图像采集单元抓拍的违章车辆在违章过程中的多张图像;
    所述图像采集单元在根据采集的视频图像序列确定车辆存在违章行为时,才抓拍所述多张交通图像;或者所述图像采集单元在收到抓拍指令时,才抓拍所述多张交通图像;所述抓拍指令由违章分析装置根据所述图像采集单元采集的视频图像序列确定车辆存在违章行为时,向所述图像采集单元发送。
  21. 根据权利要求18或19所述的方法,其特征在于,
    所述多张交通图像是所述图像采集单元抓拍的交通事故现场的多张图像;
    所述图像采集单元在根据采集的视频图像序列确定发生交通事故时,才抓拍视角范围包括交通事故现场的多张交通图像;或者所述图像采集单元在收到抓拍指令时,才抓拍视角范围包括交通事故现场的多张交通图像;所述抓拍指令由交通事故检测装置根据所述图像采集单元采集的视频图像序列确定发生交通事故时,向所述图像采集单元发送。
  22. 根据权利要求14所述的方法,其特征在于,所述多张交通图像来自多个图像采集设备。
  23. 根据权利要求14所述的方法,其特征在于,所述方法还包括:
    根据所述目标码流显示所述拼接图。
  24. 根据权利要14所述的方法,其特征在于,在对所述多张交通图像的压缩码流进行拼接之前,所述方法包括:
    确定所述多张交通图像的初始压缩码流的重启动间隔是否相同;
    在所述多张图像的初始压缩码流的重启动间隔相同的前提下,直接对所述多张图像的初始压缩码流进行拼接;
    在所述多张图像的初始压缩码流的重启动间隔不同的前提下,对所述多张交通图像的全部初始压缩码流进行解码,以得到解码后的多张交通图像;并按照相同的重启动间隔对所述解码后的多张交通图像进行编码,以得到所述多张交通图像的所述压缩码流。
  25. 根据权利要求14或24所述的方法,其特征在于,所述对所述多张交通图像的压缩码流进行拼接,包括:
    根据所述多张交通图像在拼接图中的预定拼接位置,对所述多张图像的所有压缩码流中的所有熵编码段进行重排序;
    根据重新排序后的所有熵编码段,得到所述多张交通图像的拼接图对应的目标码流。
  26. 根据权利要求14~25任一项所述的方法,其特征在于,所述相同的重启动间隔通过以下方式获得:
    针对所述多张交通图像的任一图像,根据所述图像沿水平方向的最大水平采样因子和所述图像的编码块划分信息,确定所述图像的原始重启动间隔;
    计算所述多张交通图像的原始重启动间隔的公约数;
    从所述公约数中选取大于1的公约数或最大公约数作为所述相同的重启动间隔。
  27. 一种电子设备,包括:处理器以及存储有机器可执行指令的存储介质,所述处理器通过执行所述机器可执行指令,实现如权利要求14~26任一项所述的方法。
PCT/CN2020/073762 2019-01-31 2020-01-22 交通图像的拼接 WO2020156420A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910101448.5 2019-01-31
CN201910101448.5A CN111510731B (zh) 2019-01-31 2019-01-31 交通图像的拼接系统及方法

Publications (1)

Publication Number Publication Date
WO2020156420A1 true WO2020156420A1 (zh) 2020-08-06

Family

ID=71840263

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/073762 WO2020156420A1 (zh) 2019-01-31 2020-01-22 交通图像的拼接

Country Status (2)

Country Link
CN (1) CN111510731B (zh)
WO (1) WO2020156420A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115797167A (zh) * 2022-11-02 2023-03-14 慧铁科技有限公司 一种基于轨道交通车辆图像的拼图方法

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112822496B (zh) * 2021-01-28 2023-03-17 浙江大华技术股份有限公司 一种视频分析方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103985254A (zh) * 2014-05-29 2014-08-13 四川川大智胜软件股份有限公司 一种用于大场景交通监视的多视点视频融合及交通参数采集方法
CN104159063A (zh) * 2013-05-14 2014-11-19 杭州海康威视数字技术股份有限公司 实时转码、解码方法及其装置
CN104301677A (zh) * 2014-10-16 2015-01-21 北京十方慧通科技有限公司 面向大场景的全景视频监控的方法及装置
US20180018770A1 (en) * 2016-07-14 2018-01-18 Shanghai United Imaging Healthcare Co., Ltd. System and method for splicing images

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105223767A (zh) * 2015-09-25 2016-01-06 凌云光技术集团有限责任公司 一种5目全景成像系统及方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104159063A (zh) * 2013-05-14 2014-11-19 杭州海康威视数字技术股份有限公司 实时转码、解码方法及其装置
CN103985254A (zh) * 2014-05-29 2014-08-13 四川川大智胜软件股份有限公司 一种用于大场景交通监视的多视点视频融合及交通参数采集方法
CN104301677A (zh) * 2014-10-16 2015-01-21 北京十方慧通科技有限公司 面向大场景的全景视频监控的方法及装置
US20180018770A1 (en) * 2016-07-14 2018-01-18 Shanghai United Imaging Healthcare Co., Ltd. System and method for splicing images

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115797167A (zh) * 2022-11-02 2023-03-14 慧铁科技有限公司 一种基于轨道交通车辆图像的拼图方法

Also Published As

Publication number Publication date
CN111510731A (zh) 2020-08-07
CN111510731B (zh) 2022-03-25

Similar Documents

Publication Publication Date Title
US20190007678A1 (en) Generating heat maps using dynamic vision sensor events
US11432009B2 (en) Techniques for encoding and decoding immersive video
KR102118265B1 (ko) 보조 프레임을 지원하는 비디오 코딩 포맷으로 비디오 스트림을 인코딩하기 위한 방법 및 인코더
JP5502988B2 (ja) 画像を回転させる装置および方法
US8254702B2 (en) Image compression method and image processing apparatus
KR102173107B1 (ko) 클라우드 서버 기반 영상 처리 방법, 단말 및 시스템
WO2020156420A1 (zh) 交通图像的拼接
CN106254868B (zh) 视频编码码率控制方法、装置及系统
US7747097B2 (en) Method for simple hardware implementation of JPEG size limiter
US20120155767A1 (en) Method and apparatus for generating jpeg files suitable for parallel decoding
US20220394283A1 (en) Video encoding and decoding method, apparatus and computer device
CN104081414A (zh) 用于编码和解码光场图像文件的系统及方法
EP3043313A1 (en) Jpeg picture composite method and method and apparatus for superimposing osd information
CN105163127A (zh) 视频分析方法及装置
CN105979189A (zh) 一种视频信号处理与存储方法与系统
CN114257760A (zh) 视频拼接处理方法、智能机器人及系统
CN111510643B (zh) 全景图和特写图的拼接系统及方法
CN111510717B (zh) 图像拼接方法和装置
KR20140075791A (ko) 비디오 분석 인코딩
CN103347170A (zh) 用于智能监控的图像处理方法及其应用的高分辨率摄像头
CN114157870A (zh) 编码方法、介质及电子设备
CN104244000B (zh) 一种jpeg图片快速拼接方法及装置
KR20110016408A (ko) 데이터 처리 장치 및 데이터 처리 방법
CN113727073A (zh) 一种基于云计算实现车载视频监控的方法及系统
KR100487374B1 (ko) 디지털 비디오의 썸네일 영상 생성 장치

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: 20747571

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20747571

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20747571

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20747571

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 10/03/2022)