An image coding method, apparatus, storage medium, and electronic device
By loading the recognition model into the NPU and identifying and adjusting the encoding parameters in real time, the image quality and bitrate issues of the fixed region of interest encoding method in real-time changing scenarios are solved, and efficient encoding of hot spots is achieved.
Patent Information
- Application Number
- CN202411427135.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2044-10-14
AI Technical Summary
In the prior art, the encoding method of a fixed region of interest cannot adapt to the real-time changing scene, resulting in a decrease in image quality and an increase in bit rate.
By loading the recognition model into the neural network processor (NPU), the hotspot areas in the image can be identified in real time, and the encoding parameters can be adjusted based on the coordinate information generated by the hotspot areas to optimize the encoding of the hotspot areas in real time.
It realizes real-time identification of hotspot areas and adjustment of encoding parameters, improves the image quality of hotspot areas, optimizes bit rate allocation, and enhances image encoding effects.
Smart Images

Figure CN119232939B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image encoding method, device, storage medium and electronic device. Background Art
[0002] Related art encoding methods typically perform unified encoding for the entire frame, or pre-define a region of interest (ROI) and then set smaller encoding parameters for that region to optimize the encoding instructions for that region. This fixed ROI encoding method is beneficial for some fixed scenes, but for scenes that change in real time, the region of interest changes with the scene. Therefore, this fixed ROI encoding method is no longer suitable because it cannot effectively improve the image quality of the ROI and can even be counterproductive, increasing the bitrate.
[0003] Therefore, it is necessary to provide a new technical solution to improve one or more problems existing in the above solutions.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to ordinary technicians in this field. Summary of the Invention
[0005] The purpose of this application is to provide an image encoding method, device, storage medium and electronic device, thereby overcoming one or more problems caused by the limitations and defects of related technologies, at least to a certain extent.
[0006] According to a first aspect of an embodiment of the present application, there is provided an image encoding method, comprising:
[0007] Apply for code storage space;
[0008] Loading a recognition model into the NPU; wherein the recognition model is a model trained based on hotspot feature information of the hotspot area;
[0009] Determine whether image data is read;
[0010] If the image data is read, the image data is stored in the storage space, and the NPU is configured to identify the image data source and address space so that the NPU can identify the storage space;
[0011] Starting the NPU, using the loaded recognition model to identify hotspot areas of the image data in the storage space, and determining whether the hotspot areas are identified;
[0012] If the hotspot area is identified, hotspot area coordinate information is generated according to the hotspot area, and the hotspot area coordinate information is sent to the encoder to adjust the encoding parameters of the hotspot area;
[0013] The image data of the hotspot area is encoded according to the adjusted encoding parameters.
[0014] In an embodiment of the present application, after the step of determining whether the image data is read, the following step is further included:
[0015] If the image data is not read, the encoding ends.
[0016] In an embodiment of the present application, after the step of determining whether the hotspot area is identified, the following steps are further included:
[0017] If the hotspot area is not identified, the image data not including the hotspot area is encoded according to default encoding parameters.
[0018] In an embodiment of the present application, after the step of encoding the image data not containing the hotspot area according to the default encoding parameters if the hotspot area is not identified, the method further includes:
[0019] Continuing to read the image data, and determining whether the image data is read;
[0020] If the image data is read, the NPU is started, and the loaded recognition model is used to identify the hotspot area of the image data in the storage space, and it is determined whether the hotspot area is identified.
[0021] In an embodiment of the present application, after the step of encoding the image data of the hotspot area according to the adjusted encoding parameters, the method further includes:
[0022] Continuing to read the image data, and determining whether the image data is read;
[0023] If the image data is read, the NPU is started, and the loaded recognition model is used to identify the hotspot area of the image data in the storage space, and it is determined whether the hotspot area is identified.
[0024] According to a second aspect of an embodiment of the present application, there is provided an image encoding apparatus, including:
[0025] Application module, used to apply for code storage space;
[0026] A loading module, configured to load a recognition model into the NPU; wherein the recognition model is a model trained based on hotspot feature information of the hotspot area;
[0027] A judgment module, used to judge whether the image data is read;
[0028] A first judgment submodule is configured to store the image data in the storage space if the image data is read, and configure the NPU to identify the image data source and address space so that the NPU can identify the storage space;
[0029] an identification and judgment module, configured to start the NPU, identify a hotspot area of the image data in the storage space using the loaded recognition model, and determine whether the hotspot area is identified;
[0030] A first identification and judgment submodule is configured to generate hotspot area coordinate information according to the hotspot area if the hotspot area is identified, and send the hotspot area coordinate information to an encoder to adjust encoding parameters of the hotspot area;
[0031] An encoding module is used to encode the image data of the hotspot area according to the adjusted encoding parameters.
[0032] In an embodiment of the present application, the device further includes:
[0033] The second judgment submodule is configured to terminate the encoding if the image data is not read.
[0034] According to a third aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the steps of the image encoding method described in any one of the above embodiments are implemented.
[0035] According to a fourth aspect of the embodiments of the present application, there is provided an electronic device, including:
[0036] processor; and
[0037] a memory for storing executable instructions of the processor;
[0038] The processor is configured to execute the steps of the image encoding method in any one of the above embodiments by executing the executable instructions.
[0039] The technical solutions provided by the embodiments of the present application may have the following beneficial effects:
[0040] In one embodiment of the present application, the above method is used to utilize NPU technology to identify hotspot areas of image data in real time. When a hotspot area is identified, hotspot area coordinate information is generated based on the hotspot area, so that the encoder can make real-time adjustments to the encoding parameters of the hotspot area and encode the image data of the hotspot area based on the adjusted encoding parameters. When encoding, the encoder of the present application can identify the hotspot area in real time and adjust the encoding parameters of the hotspot area in real time, thereby allocating more bit rate to the hotspot area and making the image of the hotspot area clearer.
[0041] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0043] Figure 1 A flowchart schematically illustrates the steps of an image encoding method in an exemplary embodiment of the present application;
[0044] Figure 2 A block diagram schematically illustrates an image encoding device in an exemplary embodiment of the present application;
[0045] Figure 3 Schematically illustrates a program product diagram in an exemplary embodiment of the present application;
[0046] Figure 4 The figure schematically shows a schematic diagram of an electronic device in an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0047] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be embodied in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0048] In addition, the accompanying drawings are merely schematic illustrations of the present application and are not necessarily drawn to scale. Identical reference numerals in the figures denote identical or similar parts, and thus repetitive descriptions thereof will be omitted. Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0049] In this exemplary embodiment, an image encoding method is first provided. Figure 1 As shown in , the method includes: steps S101 to S107.
[0050] Wherein, step S101: applying for code storage space.
[0051] Step S102: Loading the recognition model into the NPU; wherein the recognition model is a model trained based on the hotspot feature information of the hotspot area.
[0052] Step S103: Determine whether image data is read.
[0053] Step S104: If the image data is read, the image data is stored in the storage space, and the NPU is configured to identify the image data source and address space so that the NPU can identify the storage space.
[0054] Step S105: Start the NPU, use the loaded recognition model to identify the hotspot area of the image data in the storage space, and determine whether the hotspot area is identified.
[0055] Step S106: If a hotspot area is identified, hotspot area coordinate information is generated according to the hotspot area, and the hotspot area coordinate information is sent to the encoder to adjust the encoding parameters of the hotspot area.
[0056] Step S107: Encode the image data of the hotspot area according to the adjusted encoding parameters.
[0057] In one embodiment of the present application, the above method is used to utilize NPU technology to identify hotspot areas of image data in real time. When a hotspot area is identified, hotspot area coordinate information is generated based on the hotspot area, so that the encoder can make real-time adjustments to the encoding parameters of the hotspot area and encode the image data of the hotspot area based on the adjusted encoding parameters. When encoding, the encoder of the present application can identify the hotspot area in real time and adjust the encoding parameters of the hotspot area in real time, thereby allocating more bit rate to the hotspot area and making the image of the hotspot area clearer.
[0058] Below, we will refer to Figure 1 Each step of the above method in this exemplary embodiment is described in more detail.
[0059] In step S101 , the CPU applies for storage space, which is used to store image data to be read subsequently.
[0060] After the CPU has allocated storage space, it creates an encoder to encode the image data. In addition to encoding the image data, the encoder can also configure encoding parameters.
[0061] In step S102, the recognition model is trained based on the hotspot feature information of the hotspot area. Specifically, AI technology is used to train the model in advance based on the hotspot feature information of the hotspot area. The trained recognition model is then converted into a format that can be processed by the NPU (Neural Network Processing Unit). After the conversion, the converted recognition model is imported into the NPU for subsequent identification of hotspot areas.
[0062] It should be noted that the hotspot feature information refers to text editing area features or other image features that you want to focus on. When reading image data, you can read it from a collection storage space specifically used to store collected data. The collection storage space is used to store collected data.
[0063] It should also be noted that if different hotspot areas need to be identified, it will be helpful to train other corresponding device models. At the same time, combined with the NPU computing power used, multiple hotspot areas can also be identified and image encoding of multiple hotspot areas can be performed.
[0064] In step S103, after the recognition model is loaded into the NPU, it is necessary to further determine whether image data has been read. During the image data reading process, two situations may occur: whether image data has been read or not. Therefore, during the image data reading process, it is necessary to determine whether image data has been read so that subsequent operations can be performed according to the corresponding situation.
[0065] In step S104, during the process of reading image data, if image data is read from the acquisition storage space, the read image data is stored in the storage space, and at the same time, the NPU is configured to identify the image data source and address space so that the NPU can identify the storage space where the image data is stored.
[0066] It should be noted that, during the process of reading image data, if no image data is read from the acquisition storage space, it means that there is no image data in the acquisition storage space. In this case, the encoding can be terminated.
[0067] In step S105, after the NPU is configured to identify the image data source and address space, it is necessary to perform real-time identification of hotspot areas on the image data stored in the storage space. Specifically, the NPU is started, and the hotspot areas are identified in real time by loading and running the recognition model. In the process of identifying the hotspot area, two situations may occur: the hotspot area is identified and the hotspot area is not identified. Therefore, in the process of identifying the hotspot area, it is necessary to determine whether the hotspot area is identified so that subsequent operations can be performed according to the corresponding situation.
[0068] In step S106, if a hotspot area is identified, the hotspot area coordinate information is generated, and then the hotspot area coordinate information is sent to the encoder. Since when encoding the image data of the hotspot area, more bit rate needs to be allocated to the hotspot area to make the image of the hotspot area clearer. Therefore, when the encoder obtains the hotspot area coordinate information, it is necessary to adjust the encoding parameters of the hotspot area in real time to encode the hotspot area in a targeted manner. Among them, when the encoding parameters of the hotspot area are adjusted in real time, specifically, the value of the encoding parameter is adjusted to a smaller value. Reducing the value of the encoding parameter can achieve allocating more bit rate to the hotspot area, making the image of the hotspot area clearer.
[0069] It should be noted that, in the process of identifying the hotspot area, if no hotspot area is identified from the read image data, then at this time, the encoder normally encodes the read image data according to the default encoding parameters.
[0070] In step S107 , the encoder encodes the image data of the hotspot area according to the adjusted encoding parameters, so as to allocate more bit rate to the hotspot area, thereby achieving clearer images in the hotspot area.
[0071] In one embodiment, after the step of determining whether the image data is read, the method further includes:
[0072] If no image data is read, the encoding ends.
[0073] It should be noted that, during the process of reading image data, if no image data is read, encoding is not required.
[0074] In one embodiment, after the step of determining whether a hotspot area is identified, the method further includes:
[0075] If no hotspot area is identified, the image data not containing the hotspot area is encoded according to the default encoding parameters.
[0076] It should be noted that in the process of identifying hotspot areas, if the loaded recognition model does not identify the hotspot area from the image data in the storage space, it is only necessary to perform conventional encoding on the image data that does not contain the hotspot area using the default encoding parameters.
[0077] In one embodiment, if no hotspot area is identified, after the step of encoding the image data not containing the hotspot area according to the default encoding parameters, the method further includes:
[0078] Continue to read the image data and determine whether the image data is read;
[0079] If the image data is read, the NPU is started and the loaded recognition model is used to identify the hotspot area of the image data in the storage space and determine whether the hotspot area is identified.
[0080] It is understandable that when no hotspot area is identified, the encoder needs to perform cyclic encoding after normally encoding the image data that does not contain the hotspot area according to the default encoding parameters, that is, continue to read the image data and determine whether the image data is read.
[0081] Because when configuring the NPU, the NPU is configured to identify the image data source and address space only after the image data is read for the first time. Therefore, if the image data is read again subsequently, there is no need to configure the NPU to identify the image data source and address space. And if the image data is read again subsequently, enter the step of "starting the NPU, using the loaded recognition model to identify the hotspot area of the image data in the storage space, and determining whether the hotspot area is identified". The description of the step of determining whether the hotspot area is identified and the subsequent steps have been explained in the above embodiments, and this application will not repeat them.
[0082] As described in the above embodiment, when determining whether image data has been read, in addition to the case where image data has been read, the case where image data has not been read is also included. The steps to be performed if image data has still not been read have been described in the above embodiment and will not be repeated in this application.
[0083] In one embodiment, after the step of encoding the image data of the hotspot area according to the adjusted encoding parameters, the method further includes:
[0084] Continue to read the image data and determine whether the image data is read;
[0085] If the image data is read, the NPU is started and the loaded recognition model is used to identify the hotspot area of the image data in the storage space and determine whether the hotspot area is identified.
[0086] It is understandable that after the encoder encodes the image data of the hotspot area according to the adjusted encoding parameters, it is still necessary to perform cyclic encoding, that is, continue to read the image data and determine whether the image data is read. Then enter the step of "If the image data is read, continue to start the NPU, use the loaded recognition model to identify the hotspot area of the image data in the storage space, and determine whether the hotspot area is identified", and then enter the subsequent related steps. The relevant description of this has been explained in the above embodiment, and this application will not repeat it.
[0087] It should be noted that although the steps of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in this specific order, or that all steps must be performed to achieve the desired results. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into a single step, and / or a single step may be decomposed into multiple steps. In addition, it is also easy to understand that these steps may be executed synchronously or asynchronously, for example, in multiple modules / processes / threads.
[0088] Furthermore, in this exemplary embodiment, an image encoding device is also provided. Figure 2 As shown in FIG, apparatus 200 includes an application module 210, a loading module 220, a judgment module 230, a first judgment submodule 231, an identification and judgment module 240, a first identification and judgment submodule 241, and an encoding module 250. Application module 210 is used to apply for encoding storage space. Loading module 220 is used to load a recognition model into the NPU; the recognition model is a model trained based on hotspot feature information of a hotspot area. Judgment module 230 is used to determine whether image data has been read. If image data has been read, first judgment submodule 231 is used to store the image data in the storage space and configure the NPU with an image data source and address space to enable the NPU to identify the storage space. Identification and judgment module 240 is used to start the NPU, use the loaded recognition model to identify hotspot areas in the image data in the storage space, and determine whether a hotspot area has been identified. If a hotspot area has been identified, first identification and judgment submodule 241 is used to generate hotspot area coordinate information based on the hotspot area and send the hotspot area coordinate information to the encoder to adjust the encoding parameters of the hotspot area. The encoding module 250 is configured to encode the image data of the hotspot area according to the adjusted encoding parameters.
[0089] In one embodiment, after the step of the determination module 230, the following steps are further included:
[0090] The second judgment submodule is used to end the encoding if no image data is read.
[0091] In one embodiment, after the step of the identification and judgment module 240, the following steps are further included:
[0092] The second identification and judgment submodule is used to encode the image data not containing the hotspot area according to the default encoding parameters if no hotspot area is identified.
[0093] In one embodiment, after the step of the second judgment submodule, the method further includes:
[0094] A reading judgment module is used to continue reading image data and judge whether the image data is read;
[0095] And, if the image data is read, the NPU is started again, the loaded recognition model is used to identify the hotspot area of the image data in the storage space, and whether the hotspot area is identified.
[0096] In one embodiment, after the step of the encoding module 250, the following steps are further included:
[0097] A reading judgment module is used to continue reading image data and judge whether the image data is read;
[0098] And, if the image data is read, the NPU is started again, the loaded recognition model is used to identify the hotspot area of the image data in the storage space, and whether the hotspot area is identified.
[0099] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0100] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the implementation mode of the present application, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of a module or unit described above can be further divided into multiple modules or units for concretization. The components displayed as modules or units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the present application scheme. Those of ordinary skill in the art can understand and implement it without paying any creative work.
[0101] In exemplary embodiments of the present application, a computer-readable storage medium is also provided, storing a computer program. When executed by a processor, this program can implement the steps of the image coding method described in any of the aforementioned embodiments. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes program code. When the program product is executed on a terminal device, the program code is configured to cause the terminal device to execute the steps according to the various exemplary embodiments of the present invention described in the aforementioned image coding method section of this specification.
[0102] refer to Figure 3 As shown, a program product 300 for implementing the above method according to an embodiment of the present invention is described. The program product 300 may be a portable compact disc read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0103] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0104] The computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein the readable program code is carried. The data signal propagated may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or component. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0105] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0106] In an exemplary embodiment of the present application, an electronic device is further provided, which may include a processor and a memory for storing executable instructions of the processor, wherein the processor is configured to execute the steps of the image encoding method described in any one of the above embodiments by executing the executable instructions.
[0107] Those skilled in the art will appreciate that various aspects of the present invention may be implemented as systems, methods, or program products. Therefore, various aspects of the present invention may be implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits," "modules," or "systems."
[0108] Refer to the following Figure 4 An electronic device 600 according to this embodiment of the present invention will be described. Figure 4 The electronic device 600 shown is merely an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0109] like Figure 4 As shown, electronic device 600 is implemented as a general-purpose computing device. Components of electronic device 600 may include, but are not limited to, at least one processing unit 610, at least one storage unit 620, a bus 630 connecting various system components (including storage unit 620 and processing unit 610), a display unit 640, and the like.
[0110] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present invention described in the above image coding method section of this specification. For example, the processing unit 610 can perform the following steps: Figure 1Follow the steps shown in .
[0111] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0112] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.
[0113] Bus 630 may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0114] The electronic device 600 can also communicate with one or more external devices 700 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.), one or more devices that enable a user to interact with the electronic device 600, and / or any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication can occur via an input / output (I / O) interface 650. Furthermore, the electronic device 600 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 660. The network adapter 660 can communicate with other modules of the electronic device 600 via the bus 630. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with the electronic device 600, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0115] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above-mentioned image encoding method according to the embodiments of the present application.
[0116] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of this application and include common knowledge or customary techniques in the art that are not disclosed herein.
Claims
1. An image coding method, characterized in that: include: Apply for code storage space; Loading a recognition model into the NPU; wherein the recognition model is a model trained based on hotspot feature information of the hotspot area; Determine whether image data is read; If the image data is read, the image data is stored in the storage space, and the NPU is configured to identify the image data source and address space so that the NPU can identify the storage space; Starting the NPU, using the loaded recognition model to identify hotspot areas of the image data in the storage space, and determining whether the hotspot areas are identified; If the hotspot area is identified, hotspot area coordinate information is generated according to the hotspot area, and the hotspot area coordinate information is sent to the encoder to adjust the encoding parameters of the hotspot area; The image data of the hotspot area is encoded according to the adjusted encoding parameters.
2. The image encoding method according to claim 1, wherein After the step of determining whether the image data is read, the method further includes: If the image data is not read, the encoding ends.
3. The image encoding method according to claim 1, wherein After the step of determining whether the hotspot area is identified, the method further includes: If the hotspot area is not identified, the image data not including the hotspot area is encoded according to default encoding parameters.
4. The image encoding method according to claim 3, wherein: After the step of encoding the image data not containing the hotspot area according to the default encoding parameters if the hotspot area is not identified, the method further includes: Continuing to read the image data, and determining whether the image data is read; If the image data is read, the NPU is started, and the loaded recognition model is used to identify the hotspot area of the image data in the storage space, and it is determined whether the hotspot area is identified.
5. The image encoding method according to claim 1, wherein After the step of encoding the image data of the hotspot area according to the adjusted encoding parameters, the method further includes: Continuing to read the image data, and determining whether the image data is read; If the image data is read, the NPU is started, and the loaded recognition model is used to identify the hotspot area of the image data in the storage space, and it is determined whether the hotspot area is identified.
6. An image encoding device, characterized in that include: Application module, used to apply for code storage space; A loading module, configured to load a recognition model into the NPU; wherein the recognition model is a model trained based on hotspot feature information of the hotspot area; A judgment module, used to judge whether the image data is read; A first judgment submodule is configured to store the image data in the storage space if the image data is read, and configure the NPU to identify the image data source and address space so that the NPU can identify the storage space; an identification and judgment module, configured to start the NPU, identify a hotspot area of the image data in the storage space using the loaded recognition model, and determine whether the hotspot area is identified; A first identification and judgment submodule is configured to generate hotspot area coordinate information according to the hotspot area if the hotspot area is identified, and send the hotspot area coordinate information to an encoder to adjust encoding parameters of the hotspot area; An encoding module is used to encode the image data of the hotspot area according to the adjusted encoding parameters.
7. The image encoding device according to claim 6, wherein The device also includes: The second judgment submodule is configured to terminate the encoding if the image data is not read.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the image coding method according to any one of claims 1 to 5 are implemented.
9. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to execute the steps of the image encoding method according to any one of claims 1 to 5 by executing the executable instructions.
Citation Information
Patent Citations
Method for improving H264 coding efficiency of monitoring scene
CN113453007A
Image encoding method, image decoding method, electronic equipment and storage medium
CN113766274A