Semantic Structured Image Encoding and Decoding Methods and Systems Adapted to Different Encoders
By performing object detection and codec indexing on images, the adaptation problem between traditional hybrid codecs and learning-based codecs is solved, achieving better compatibility and flexibility to meet the needs of industry coding standards.
Patent Information
- Application Number
- CN202211215181.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2042-09-30
AI Technical Summary
Existing technologies are difficult to adapt to both traditional hybrid codecs and learning-based codecs, which limits their functionality and applicability, especially for coding standards widely used in the industry such as H.264, H.265 and H.266.
By performing object detection on the input image, the foreground object detection result is determined, and the same codec is used based on the codec identifier. Header information and texture information are processed separately during encoding or decoding, and the indexes of different codecs are adapted to form a semantically structured bitstream.
It achieves compatibility and scalability with different codecs, improves coding efficiency and flexibility, and adapts to current market demands.
Smart Images

Figure CN115604461B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to image compression coding, and more particularly to a semantically structured image coding and decoding method and system adapted to different codecs. Background Technology
[0002] To more efficiently support human-machine hybrid intelligent applications, existing methods have proposed the concept of image semantic structured bitstreams. For example, Chinese invention patent CN110225341B, "A Task-Driven Bitstream Structured Image Encoding Method," introduces a region decision network and alignment module for object detection. It extracts bounding boxes of the object's location based on compressed features and segments the features spatially according to these bounding boxes. The segmented features are then sequentially entropy-encoded to form a structured bitstream.
[0003] However, the aforementioned method segments and structures intermediate features of the learning-based image codec based on the bounding boxes of the extracted object's location. This approach does not yet consider compatibility with traditional hybrid encoders such as H.264, H.265, and H.266, which are currently widely used coding standards in industry and will maintain a high market share for a long time to come. Similarly, this approach struggles to support different learning-based codecs, limiting its functionality and applicability. Summary of the Invention
[0004] The purpose of this invention is to provide a semantic structured image encoding and decoding method and system that adapts to different codecs, and can simultaneously adapt to different types of codecs, thereby having better compatibility and scalability.
[0005] The objective of this invention is achieved through the following technical solution:
[0006] A semantically structured image encoding / decoding method adaptable to different codecs includes:
[0007] Encoding section: Target detection is performed on the input image to determine the foreground target detection result; based on a given identifier indicating whether the same codec is used for all targets, it is determined whether the same codec is used for encoding and decoding of all targets, and the index of the corresponding codec is obtained. All targets include both foreground and background targets. During header information encoding, the size information of the input image, the identifier indicating whether the same codec is used for all targets, and the foreground target detection result are encoded separately, and then concatenated to form the header information. During texture encoding, the corresponding encoder is used, combined with the target detection result, to perform texture encoding on the image corresponding to each target separately. The texture information obtained from encoding all targets is then combined to form the total texture information. Specifically, if the same codec is used for encoding and decoding of all targets, the codec index is encoded and placed in the header information during header information encoding; if the same codec is not used for encoding and decoding of all targets, the index of the corresponding codec is encoded and placed in the texture information corresponding to the target during texture encoding. The header information and the total texture information constitute a semantically structured bitstream.
[0008] Decoding section: The header information is decoded to obtain the size information of the input image, an identifier indicating whether the same codec is used for all targets, and the foreground target detection results. Based on the decoded identifier indicating whether the same codec is used for all targets, it is determined whether the same codec is used for encoding and decoding of all targets. If the same codec is used for encoding and decoding of all targets, the index of the corresponding codec is also obtained during the header information decoding, and the texture information is decoded by calling the corresponding decoder. If the same codec is not used for encoding and decoding of all targets, for the texture information corresponding to each target, the corresponding codec index is first decoded, and then the corresponding decoder is called to decode the image corresponding to each target. According to the size information of the decoded input image and the position of each foreground target in the foreground target detection results, the images corresponding to all foreground targets and background targets are stitched together to obtain the reconstructed image.
[0009] A semantically structured image encoding and decoding system adaptable to different codecs includes:
[0010] An encoding unit is used to perform an encoding section, which includes: performing target detection on the input image to determine the foreground target detection result; determining whether to use the same codec for all targets based on a given identifier indicating whether the same codec is used for all targets, and obtaining the index of the corresponding codec, wherein all targets include all foreground targets and background targets; during header information encoding, the size information of the input image, the identifier indicating whether the same codec is used for all targets, and the foreground target detection result are encoded separately, and then concatenated to form header information; during texture encoding, the corresponding encoder is used, and the images corresponding to each target are texture encoded separately in combination with the target detection result, and the texture information obtained from encoding all targets is combined to form the total texture information; wherein, if the same codec is used for encoding and decoding of all targets, the codec index is encoded and placed in the header information during header information encoding; if the same codec is not used for encoding and decoding of all targets, the index of the corresponding codec is encoded and placed in the texture information corresponding to the corresponding target during texture encoding; the header information and the total texture information constitute a semantically structured bitstream;
[0011] A decoding unit is used to execute a decoding section, which includes: decoding the header information to obtain the size information of the input image, an identifier indicating whether the same codec is used for all targets, and foreground target detection results; determining whether the same codec is used for encoding and decoding of all targets based on the decoded identifier indicating whether the same codec is used for all targets; if the same codec is used for encoding and decoding of all targets, the corresponding codec index is also obtained during header information decoding, and the texture information is decoded by calling the corresponding decoder; if the same codec is not used for encoding and decoding of all targets, the corresponding codec index is first decoded for the texture information corresponding to each target, and then the corresponding decoder is called to decode the image corresponding to each target; and stitching the images corresponding to all foreground targets and background targets according to the size information of the decoded input image and the positions of each foreground target in the foreground target detection results to obtain a reconstructed image.
[0012] A processing device includes: one or more processors; and a memory for storing one or more programs.
[0013] When the one or more programs are executed by the one or more processors, the one or more processors implement the aforementioned method.
[0014] A readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned method.
[0015] As can be seen from the technical solution provided by the present invention, it can be adapted to traditional hybrid codecs, giving it better versatility and scalability, and better meeting current market demands. Furthermore, it allows for the option of using the same codec for all targets and the background of an image, or using different codecs respectively, increasing the flexibility of the solution while ensuring coding efficiency. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart illustrating a semantically structured image encoding / decoding method adapted to different codecs, provided in an embodiment of the present invention;
[0018] Figure 2 A flowchart of encoding and decoding process for using the same codec on various targets, provided for embodiments of the present invention;
[0019] Figure 3 An encoding / decoding flowchart for using multiple codecs to act on various targets, provided for embodiments of the present invention;
[0020] Figure 4 This is a schematic diagram of a semantically structured image encoding and decoding system adapted to different codecs, provided in an embodiment of the present invention.
[0021] Figure 5 This is a schematic diagram of a processing device provided in an embodiment of the present invention. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.
[0023] First, the following explanations are provided for the terms that may be used in this article:
[0024] The term "and / or" means that either or both can be achieved simultaneously. For example, X and / or Y means that it includes both "X" or "Y" as well as the three cases of "X and Y".
[0025] The terms “including,” “comprising,” “containing,” “having,” or other similar semantic descriptions should be interpreted as non-exclusive inclusion. For example, “including a technical feature element (such as raw material, component, ingredient, carrier, dosage form, material, size, part, component, mechanism, device, step, process, method, reaction conditions, processing conditions, parameter, algorithm, signal, data, product or article of manufacture, etc.)” should be interpreted as including not only the expressly listed technical feature element, but also other technical feature elements that are not expressly listed and are well-known in the art.
[0026] The term "composed of" excludes any technical features not expressly listed. When used in a claim, it closes the claim to exclude all technical features other than those expressly listed, except for associated conventional impurities. If the term appears only in a clause of a claim, it limits the claim to the elements expressly listed in that clause; elements recited in other clauses are not excluded from the overall claim.
[0027] The semantically structured image encoding and decoding scheme adapted to different codecs provided by this invention will be described in detail below. Contents not described in detail in the embodiments of this invention are prior art known to those skilled in the art. Where specific conditions are not specified in the embodiments of this invention, they shall be performed according to conventional conditions in the art or conditions recommended by the manufacturer. Reagents or instruments used in the embodiments of this invention whose manufacturers are not specified are all conventional products that can be purchased commercially.
[0028] Example 1
[0029] This invention provides a semantically structured image encoding / decoding method adaptable to different codecs. It improves upon existing semantically structured image coding techniques, enabling adaptation to various codecs, such as different traditional hybrid encoders and different learning-based codecs. Figure 1 As shown, it mainly consists of two parts: encoding and decoding.
[0030] I. Encoding Section.
[0031] 1. Perform object detection on the input image and determine the object detection results.
[0032] In this embodiment of the invention, foreground target detection is performed on the input image using a target detection model to obtain all foreground target detection results. The detection result for each foreground target includes the location and category of the foreground target. The location and category of the k-th foreground target are represented as: {a k ,b k ,h k ,w k ,cls k}, a k ,b k ,h k ,w k ,cls k These represent the horizontal axis position, vertical axis position, height, width, and category of the top-left corner coordinate of the k-th foreground target, respectively.
[0033] In this embodiment of the invention, the portion of the input image after removing all foreground target positions is the background target portion, and all foreground targets and background targets in the input image constitute all targets.
[0034] In this embodiment of the invention, the target detection model can be implemented using existing network models, so it will not be described in detail.
[0035] 2. Header information encoding.
[0036] In this embodiment of the invention, based on a given identifier indicating whether the same codec is used for all targets, it is determined whether the same codec is used for encoding and decoding of all targets, and the index of the corresponding codec is obtained; during header information encoding, the size information of the input image, the identifier indicating whether the same codec is used for all targets, and the foreground target detection results are encoded respectively, and then concatenated to form header information; wherein, if the same codec is used for encoding and decoding of all targets, the index of the codec is encoded and placed in the header information during header information encoding.
[0037] In this embodiment of the invention, when encoding the header information, an existing encoding method can be selected as needed. For example, a fixed-length encoding method can be selected.
[0038] 3. Texture encoding.
[0039] In this embodiment of the invention, during texture encoding, the corresponding encoder is used, and the image corresponding to each target is texture encoded separately in combination with the target detection results. The texture information obtained from encoding all targets is combined to form the total texture information. If the same codec is not used to encode and decode all targets, then during texture encoding, the index of the corresponding codec is encoded and put into the texture information corresponding to the corresponding target.
[0040] In this embodiment of the invention, the foreground target detection result includes the position of each foreground target. Therefore, the image corresponding to each foreground target can be obtained from the input image. After removing the images corresponding to all foreground targets, the remaining image is the image corresponding to the background target. Texture encoding is then performed after determining the image corresponding to each target.
[0041] In this embodiment of the invention, if the same codec is used for encoding and decoding all targets, the structure of the header information includes: the size information of the input image, an identifier indicating whether the same encoder is used for all targets, the index of the codec, the number of foreground targets, and the position and category of each foreground target; the structure of the texture information corresponding to the target includes: the length of the bitstream corresponding to the target texture information; if the same codec is not used for encoding and decoding all targets, the structure of the header information includes: the size information of the input image, an identifier indicating whether the same encoder is used for all targets, the number of foreground targets, and the position and category of each foreground target; the structure of the texture information corresponding to the target includes: the index of the codec corresponding to the target, and the length of the bitstream corresponding to the target texture information.
[0042] In this embodiment of the invention, the header information and the total texture information constitute a semantically structured bitstream.
[0043] In this embodiment of the invention, the identifier indicating whether the same codec is used for all targets can be set by the user. Encoding and decoding a target refers to encoding and decoding the target's image. When using the same encoder, all target images are encoded and decoded using the same codec. This same codec can be varied; depending on the situation, either a traditional hybrid encoder or a learning-based codec can be selected. Encoding and decoding not using the same codec for all targets means that the number of codecs used is at least two and at most equal to the number of targets, i.e., greater than or equal to 2 and less than or equal to K+1, where K represents the number of foreground targets and 1 represents the number of background targets. When the number of codecs is equal to K+1, it means that each foreground and background target image is encoded and decoded using a different codec. When the number of codecs is greater than or equal to 2 and less than K+1, it means that some target images use the same codec. The type of codec can also be either a traditional hybrid encoder or a learning-based codec.
[0044] II. Decoding section.
[0045] 1. Decoding header information.
[0046] The header information is decoded to obtain the size information of the input image, an identifier indicating whether the same codec is used for all targets, and the foreground target detection results.
[0047] 2. Texture information decoding.
[0048] Based on the decoded identifier indicating whether the same codec is used for all targets, it is determined whether the same codec is used for encoding and decoding all targets. If the same codec is used for all targets, the corresponding codec index is also obtained during header information decoding, and the texture information is decoded by calling the corresponding decoder. If the same codec is not used for all targets, for the texture information corresponding to each target, the corresponding codec index is first decoded, and then the corresponding decoder is called to decode the image corresponding to each target. According to the size information of the decoded input image and the position of each foreground target in the foreground target detection result, the images corresponding to all foreground targets and background targets are stitched together to obtain the reconstructed image.
[0049] To facilitate understanding, the following sections provide detailed explanations of the solutions for two scenarios: using the same codec for all targets and not using the same codec for all targets.
[0050] Option 1: Use the same codec for encoding and decoding all targets.
[0051] like Figure 2 The image shows the overall encoding and decoding process. Figure 2 The intermediate global codec index represents the index of the same codec used by all targets. The encoding / decoding process is mainly as follows:
[0052] 1. Coding process.
[0053] Step A1: Object Detection. For the input image x, its size is H×W×C, where H and W represent the height and width of the image, respectively, and C is the number of channels. The image is first processed by an object detection model to obtain the foreground object detection result.
[0054] Step A2: Header Information Encoding. The image height (H), width (W), an identifier indicating whether the same codec is used for all targets (for Scheme 1, this identifier is 1), and the index of the selected codec are encoded. An example of a codec index is shown in Table 1.
[0055] Table 1: Example of Codec Index
[0056] Codec Index codec 0 H.264 1 H.265 2 H.266 3 Neural-1 4 Neural-2 …… …… 255 Expansion preparation
[0057] Next, the number of foreground objects in the image, as well as the location and category information of each foreground object, are encoded. All of the above content is then concatenated into the corresponding bitstreams to form the header information of the semantically structured bitstream, the syntax of which is shown in Table 2.
[0058] Table 2: Syntax Structure of Bitstream Header Information
[0059]
[0060] Wherein, image_height_minus1 represents the height H of the image; image_width_minus1 represents the width W of the image; single_texture_codec_enabled_flag represents the identifier of whether the same encoder is used for all targets; texture_codec_idx represents the index of the selected codec; bounding_boxes_numbers represents the number of foreground targets in the image; bounding_box_x, bounding_box_y, bounding_box_h, bounding_box_w, and bounding_box_category represent the horizontal coordinate of the upper left corner, the vertical coordinate of the upper left corner, the height, the width, and the category information of the current foreground target, respectively. Here, only an example of a single foreground target is provided. The above 5 information of multiple foreground targets are grouped together and arranged in order; u represents an unsigned data type. Taking u(32) as an example, it means that the length of the code stream segment is 32 bits.
[0061] In this embodiment of the invention, the bitstream length is used for subsequent decoding. The principle is as follows: during actual entropy encoding, the length of the data after encoding cannot be known. However, during decoding, the bitstream of the corresponding length needs to be read first before decoding can be performed. Therefore, the corresponding bitstream length needs to be added before storing the bitstream after entropy encoding is completed, so that the decoding end can correctly decode the data.
[0062] Step A3: Texture Information Encoding. Select the corresponding codec based on the codec index, and use this codec and the previous target detection results to perform texture encoding on each target in the image. Fill the bitstream in a user-defined order to finally form the texture information.
[0063] 2. Decoding process.
[0064] Step A4: Decode the header information.
[0065] Decoding obtains the image's size information (height H and width W), an identifier indicating whether the same codec is used for all targets, the index of the selected codec, and the location and category information of foreground targets.
[0066] Step A5: Decode texture information.
[0067] The corresponding decoder is invoked using the selected codec index. The texture portions of each target are decoded using the corresponding decoder, and then the images corresponding to the targets are stitched together according to their positions to form a complete reconstructed image.
[0068] Option 2: The same codec is not used for encoding and decoding all targets.
[0069] 1. Coding process.
[0070] Step B1: Object Detection. This part is the same as step A1 in Solution 1.
[0071] Step B2: Header information encoding and compression.
[0072] The image's height (H), width (W), and an identifier indicating whether the same codec is used for all targets (0 for scheme two) are encoded. Finally, the position and category information of foreground targets in the image are encoded. All of the above content is concatenated into the header information of the semantically structured bitstream. The header information can be found in Table 2 above; the main difference is that the `texture_codec_idx` section indicating the selected codec index is not present here.
[0073] Step B3: Texture encoding.
[0074] For each target, the index of the codec used by the target is encoded, and then the corresponding encoder is selected according to the corresponding codec index to perform texture encoding on the image corresponding to the target. The encoding results are put into the bitstream in a user-defined order to form texture information. Its syntax structure is shown in Table 3.
[0075] Table 3: Syntax Structure of Target Corresponding Texture Information
[0076]
[0077] Where texture_codec_idx represents the codec index corresponding to a single target texture portion, and object_texture_length_minus1 represents the length of the bitstream corresponding to the target texture portion. The main difference between the texture information obtained in step A3 of the aforementioned scheme 1 and Table 3 is that the texture_codec_idx part is not present.
[0078] 2. Decoding process.
[0079] Step B4: Header information decoding. This part is the same as step A4 in Scheme 1.
[0080] Step B5: Decode texture information.
[0081] For each target's corresponding bitstream (texture information), the following process is repeated: First, the index of the codec selected for the target is decoded. Then, the corresponding decoder is called according to the index, and the image corresponding to the target is decoded using the decoder. The images corresponding to the target are then stitched together according to each position to form a complete reconstructed image.
[0082] The above-described solution in the embodiments of the present invention has the following main advantages:
[0083] (1) Based on semantic structured image coding, the traditional codec has been adapted to give it better versatility and scalability, and it can better adapt to the current market demand.
[0084] (2) It realizes the option of using the same codec for each target and background in the image and using different codecs respectively, which increases the flexibility of the scheme while ensuring coding efficiency.
[0085] Example 2
[0086] This invention also provides a semantically structured image encoding and decoding system adaptable to different codecs, which is mainly based on the method provided in the foregoing embodiments, such as... Figure 4 As shown, the system mainly includes:
[0087] An encoding unit is used to perform an encoding section, which includes: performing target detection on the input image to determine the foreground target detection result; determining whether to use the same codec for all targets based on a given identifier indicating whether the same codec is used for all targets, and obtaining the index of the corresponding codec, wherein all targets include all foreground targets and background targets; during header information encoding, the size information of the input image, the identifier indicating whether the same codec is used for all targets, and the foreground target detection result are encoded separately, and then concatenated to form header information; during texture encoding, the corresponding encoder is used, and the images corresponding to each target are texture encoded separately in combination with the target detection result, and the texture information obtained from encoding all targets is combined to form the total texture information; wherein, if the same codec is used for encoding and decoding of all targets, the codec index is encoded and placed in the header information during header information encoding; if the same codec is not used for encoding and decoding of all targets, the index of the corresponding codec is encoded and placed in the texture information corresponding to the corresponding target during texture encoding; the header information and the total texture information constitute a semantically structured bitstream;
[0088] A decoding unit is used to execute a decoding section, which includes: decoding the header information to obtain the size information of the input image, an identifier indicating whether the same codec is used for all targets, and foreground target detection results; determining whether the same codec is used for encoding and decoding of all targets based on the decoded identifier indicating whether the same codec is used for all targets; if the same codec is used for encoding and decoding of all targets, the corresponding codec index is also obtained during header information decoding, and the texture information is decoded by calling the corresponding decoder; if the same codec is not used for encoding and decoding of all targets, the corresponding codec index is first decoded for the texture information corresponding to each target, and then the corresponding decoder is called to decode the image corresponding to each target; and stitching the images corresponding to all foreground targets and background targets according to the size information of the decoded input image and the positions of each foreground target in the foreground target detection results to obtain a reconstructed image.
[0089] In this embodiment of the invention, the step of performing target detection on the input image and determining the foreground target detection result includes:
[0090] The input image is subjected to object detection using an object detection model to obtain the detection results of all foreground objects. The detection result of each foreground object includes the location and category of the foreground object. The location and category of the k-th foreground object are represented as: {a k ,b k ,h k ,w k ,cls k}, a k ,b k ,h k ,w k ,cls k These represent the horizontal axis position, vertical axis position, height, width, and category of the top-left corner coordinate of the k-th foreground target, respectively.
[0091] In this embodiment of the invention, if the same codec is used for encoding and decoding all targets, the structure of the header information includes: the size information of the input image, an identifier indicating whether the same encoder is used for all targets, the index of the codec, the number of foreground targets, and the position and category of each foreground target; the structure of the texture information corresponding to the target includes: the length of the bitstream corresponding to the target texture information; if the same codec is not used for encoding and decoding all targets, the structure of the header information includes: the size information of the input image, an identifier indicating whether the same encoder is used for all targets, the number of foreground targets, and the position and category of each foreground target; the structure of the texture information corresponding to the target includes: the index of the codec corresponding to the target, and the length of the bitstream corresponding to the target texture information.
[0092] In this embodiment of the invention, the codec includes: a learning-based codec and a traditional hybrid codec.
[0093] Those skilled in the art will understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the system can be divided into different functional modules to complete all or part of the functions described above.
[0094] Example 3
[0095] The present invention also provides a processing device, such as Figure 5 As shown, it mainly includes: one or more processors; a memory for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the foregoing embodiments.
[0096] Furthermore, the processing device also includes at least one input device and at least one output device; in the processing device, the processor, memory, input device, and output device are connected via a bus.
[0097] In this embodiment of the invention, the specific types of the memory, input device, and output device are not limited; for example:
[0098] Input devices can be touchscreens, image acquisition devices, physical buttons, or mice, etc.
[0099] The output device can be a display terminal;
[0100] The memory can be random access memory (RAM) or non-volatile memory, such as disk storage.
[0101] Example 4
[0102] The present invention also provides a readable storage medium storing a computer program that, when executed by a processor, implements the method provided in the foregoing embodiments.
[0103] In this embodiment of the invention, the readable storage medium is a computer-readable storage medium and can be disposed in the aforementioned processing device, for example, as a memory in the processing device. Furthermore, the readable storage medium can also be any medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0104] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A semantically structured image encoding and decoding method adaptable to different codecs, characterized in that, include: Encoding section: Performs object detection on the input image and determines the foreground object detection results; Based on the given identifier indicating whether the same codec is used for all targets, determine whether the same codec is used for encoding and decoding of all targets, and obtain the index of the corresponding codec. The "all targets" include all foreground targets and background targets. During header information encoding, the size information of the input image, the identifier indicating whether the same codec is used for all targets, and the foreground target detection results are encoded separately, and then concatenated to form the header information. During texture encoding, the corresponding encoder is used, and the images corresponding to each target are texture encoded separately in combination with the target detection results. The texture information obtained from encoding all targets is combined to form the total texture information. If the same codec is used for encoding and decoding all targets, the codec index is encoded and placed in the header information during header information encoding. If the same codec is not used for encoding and decoding all targets, the index of the corresponding codec is encoded and placed in the texture information corresponding to the corresponding target during texture encoding. The header information and the total texture information constitute a semantically structured bitstream. Decoding section: The header information is decoded to obtain the size information of the input image, an identifier indicating whether the same codec is used for all targets, and the foreground target detection results. Based on the decoded identifier indicating whether the same codec is used for all targets, it is determined whether the same codec is used for encoding and decoding of all targets. If the same codec is used for encoding and decoding of all targets, the index of the corresponding codec is also obtained during header information decoding, and the texture information is decoded by calling the corresponding decoder. If the same codec is not used for encoding and decoding of all targets, for the texture information corresponding to each target, the corresponding codec index is first decoded, and then the corresponding decoder is called to decode the image corresponding to each target. According to the size information of the decoded input image and the position of each foreground target in the foreground target detection results, the images corresponding to all foreground targets and background targets are stitched together to obtain the reconstructed image. The phrase "not using the same codec for all targets" means that the number of codecs used is at least two and at most equal to the number of targets, i.e., greater than or equal to 2 and less than or equal to K+1, where K represents the number of foreground targets and the number of background targets is 1.
2. The semantically structured image encoding and decoding method adapting to different codecs according to claim 1, characterized in that, The step of performing target detection on the input image and determining the foreground target detection result includes: The input image is subjected to foreground object detection using an object detection model, and all foreground object detection results are obtained. The detection result for each foreground object includes the location and category of the foreground object. The location and category of the k-th foreground object are represented as: {a k ,b k ,h k ,w k ,cls k }, a k ,b k ,h k ,w k ,cls k These represent the horizontal axis position, vertical axis position, height, width, and category of the top-left corner coordinate of the k-th foreground target, respectively.
3. The semantic structured image encoding and decoding method adapting to different codecs according to claim 2, characterized in that, If the same codec is used for encoding and decoding all targets, the structure of the header information includes: the size information of the input image, an identifier indicating whether the same encoder is used for all targets, the index of the codec, the number of foreground targets, and the position and category of each foreground target; the structure of the texture information corresponding to the target includes: the length of the bitstream corresponding to the target texture information; If the same codec is not used for encoding and decoding all targets, the structure of the header information includes: the size information of the input image, an identifier indicating whether the same encoder is used for all targets, the number of foreground targets, and the position and category of each foreground target; the structure of the texture information corresponding to the target includes: the index of the codec corresponding to the target, and the length of the bitstream corresponding to the target texture information.
4. The semantically structured image encoding and decoding method adapting to different codecs according to claim 1, characterized in that, The codecs include: learning-based codecs and traditional hybrid codecs.
5. A semantically structured image encoding and decoding system adaptable to different codecs, characterized in that, include: An encoding unit is used to perform an encoding section, which includes: performing target detection on the input image to determine the foreground target detection result; determining whether to use the same codec for all targets based on a given identifier indicating whether the same codec is used for all targets, and obtaining the index of the corresponding codec, wherein all targets include all foreground targets and background targets; during header information encoding, the size information of the input image, the identifier indicating whether the same codec is used for all targets, and the foreground target detection result are encoded separately, and then concatenated to form header information; during texture encoding, the corresponding encoder is used, and the images corresponding to each target are texture encoded separately in combination with the target detection result, and the texture information obtained from encoding all targets is combined to form the total texture information; wherein, if the same codec is used for encoding and decoding of all targets, the codec index is encoded and placed in the header information during header information encoding; if the same codec is not used for encoding and decoding of all targets, the index of the corresponding codec is encoded and placed in the texture information corresponding to the corresponding target during texture encoding; the header information and the total texture information constitute a semantically structured bitstream; A decoding unit is used to execute a decoding section, which includes: decoding the header information to obtain the size information of the input image, an identifier indicating whether the same codec is used for all targets, and foreground target detection results; determining whether the same codec is used for encoding and decoding of all targets based on the decoded identifier indicating whether the same codec is used for all targets; if the same codec is used for encoding and decoding of all targets, the corresponding codec index is also obtained during header information decoding, and the texture information is decoded by calling the corresponding decoder; if the same codec is not used for encoding and decoding of all targets, the corresponding codec index is first decoded for the texture information corresponding to each target, and then the corresponding decoder is called to decode the image corresponding to each target; and stitching the images corresponding to all foreground targets and background targets according to the size information of the decoded input image and the positions of each foreground target in the foreground target detection results to obtain a reconstructed image. The phrase "not using the same codec for all targets" means that the number of codecs used is at least two and at most equal to the number of targets, i.e., greater than or equal to 2 and less than or equal to K+1, where K represents the number of foreground targets and the number of background targets is 1.
6. A semantically structured image encoding and decoding system adaptable to different codecs according to claim 5, characterized in that, The step of performing target detection on the input image and determining the foreground target detection result includes: The input image is subjected to object detection using an object detection model to obtain the detection results of all foreground objects. The detection result of each foreground object includes the location and category of the foreground object. The location and category of the k-th foreground object are represented as: {a k ,b k ,h k ,w k ,cls k }, a k ,b k ,h k ,w k ,cls k These represent the horizontal axis position, vertical axis position, height, width, and category of the top-left corner coordinate of the k-th foreground target, respectively.
7. A semantically structured image encoding and decoding system adaptable to different codecs according to claim 6, characterized in that, If the same codec is used for encoding and decoding all targets, the structure of the header information includes: the size information of the input image, an identifier indicating whether the same encoder is used for all targets, the index of the codec, the number of foreground targets, and the position and category of each foreground target; the structure of the texture information corresponding to the target includes: the length of the bitstream corresponding to the target texture information; If the same codec is not used for encoding and decoding all targets, the structure of the header information includes: the size information of the input image, an identifier indicating whether the same encoder is used for all targets, the number of foreground targets, and the position and category of each foreground target; the structure of the texture information corresponding to the target includes: the index of the codec corresponding to the target, and the length of the bitstream corresponding to the target texture information.
8. A semantically structured image encoding and decoding method adaptable to different codecs according to claim 5, characterized in that, The codecs include: learning-based codecs and traditional hybrid codecs.
9. A processing device, characterized in that, include: One or more processors; Memory, used to store one or more programs; Wherein, when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method as described in any one of claims 1 to 4.
10. A readable storage medium storing a computer program, characterized in that, When a computer program is executed by a processor, it implements the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
A task-driven bitstream structured image coding method
CN110225341B
Coding method and device, decoding method and device, storage medium and electronic equipment
CN112954398A
Hybridized image encoding based on region volatility
US8606029B1