Image coding method and device, storage medium and electronic equipment

By loading the recognition model in the NPU, identifying the hot spot areas in the image in real time and adjusting the encoding parameters, the shortcomings of the coding method of fixed area of ​​interest in the existing technology in real-time change scenarios are solved, and image quality and code rate allocation are improved, so as to achieve A clearer hot spot area code.

CN119232939AActive Publication Date: 2024-12-31XIAN WANXIANG ELECTRONICS TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411427135.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2024-12-31
Estimated Expiration
2044-10-14

AI Technical Summary

Technical Problem

When the prior art deals with real-time changing scenarios, the encoding method of fixed areas of interest cannot effectively improve image quality, but may instead lead to an increase in the code stream.

Method used

By loading the recognition model in the NPU, the hot spot areas in the image are identified in real time, and the encoding parameters are adjusted according to the hot spot areas generation coordinate information to realize real-time encoding of the hot spot areas.

Benefits of technology

Real-time identification and coding parameter adjustment of hot spot areas are realized, the image quality of hot spot areas is improved, the code rate allocation is reduced, and the image clarity is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232939A_ABST
    Figure CN119232939A_ABST
Patent Text Reader

Abstract

The invention relates to an image coding method and device, a storage medium and electronic equipment. The method comprises the following steps: applying for a code storage space; loading the identification model into the NPU, and judging whether the image data is read or not; if the image data is read, storing the image data in a storage space; an identification image data source and an address space are configured for the NPU, so that the NPU can identify a storage space; starting an NPU (Network Processing Unit), identifying a hot spot area of the image data in the storage space by utilizing the loaded identification model, and judging whether the hot spot area is identified or not; and if the hot spot area is identified, hot spot area coordinate information is generated according to the hot spot area, and the hot spot area coordinate information is sent to an encoder so as to adjust encoding parameters of the hot spot area. According to the method and the device, the hot spot region can be identified in real time, and the coding parameter of the hot spot region can be adjusted in real time, so that more code rates are allocated to the hot spot region, and the image of the hot spot region is clearer.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In the related art, the encoding method is mainly to uniformly encode the entire frame, or, after determining the region of interest in advance, set the encoding parameters of the region of interest to be smaller when encoding, so that the encoding instructions of this part are better. This encoding method with a fixed region of interest is beneficial for some fixed scenes, but for real-time changing scenes, the region of interest of people will change with the scene because the scene is changing in real time, so this encoding method with a fixed region of interest will no longer be applicable, because it cannot effectively improve the quality of the encoded image of the region of interest, and sometimes it will be counterproductive and increase the bit rate.

[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 the present application, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0005] The purpose of the present application is to provide an image encoding method, device, storage medium and electronic device, thereby overcoming one or more problems caused by 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 coding storage space;

[0008] Loading a recognition model into the NPU; wherein the recognition model is a model trained according to 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 hot spot 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 step further includes:

[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 step is 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 following step further includes:

[0019] Continue to read the image data, and determine whether the image data is read;

[0020] If the image data is read, the NPU is started up again, 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 hot spot area according to the adjusted encoding parameters, the step further includes:

[0022] Continue to read the image data, and determine whether the image data is read;

[0023] If the image data is read, the NPU is started up again, 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 encoding storage space;

[0026] A loading module, used to load the recognition model into the NPU; wherein the recognition model is a model trained according to the 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 used for storing the image data in the storage space if the image data is read, and configuring 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, used to start the NPU, use the loaded identification model to identify the hotspot area of ​​the image data in the storage space, and determine whether the hotspot area is identified;

[0030] A first identification and judgment submodule is used to generate hot spot area coordinate information according to the hot spot area if the hot spot area is identified, and send the hot spot area coordinate information to the encoder to adjust the encoding parameters of the hot spot area;

[0031] The encoding module is used to encode the image data of the hot spot 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 used to end 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 an embodiment of the present application, there is provided an electronic device, including:

[0036] Processor; and

[0037] A memory, configured to store 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 solution 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 can adjust the encoding parameters of the hotspot area in real time, thereby allocating more bit rate to the hotspot area, 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 drawings herein are incorporated into the specification 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 for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0043] Figure 1 A flowchart schematically showing a method for encoding an image in an exemplary embodiment of the present application;

[0044] Figure 2 A block diagram schematically shows an image encoding device in an exemplary embodiment of the present application;

[0045] Figure 3 A schematic diagram of a program product in an exemplary embodiment of the present application is schematically shown;

[0046] Figure 4 A schematic diagram of an electronic device in an exemplary embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0047] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and 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 only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0049] In this example implementation, a method for encoding an image is first provided. Figure 1 As shown in , the method includes: steps S101 to S107.

[0050] Wherein, step S101: applying for encoding storage space.

[0051] Step S102: Load the recognition model into the NPU; wherein the recognition model is a model trained according to 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 hot spot 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 can adjust the encoding parameters of the hotspot area in real time, thereby allocating more bit rate to the hotspot area, making the image of the hotspot area clearer.

[0058] Next, we will refer to Figure 1 Each step of the above method in this example implementation is described in more detail.

[0059] In step S101, the CPU applies for a storage space, which is used to store image data to be read subsequently.

[0060] After the CPU has applied for storage space, it creates an encoder for encoding image data. In addition to encoding image data, the encoder can also configure encoding parameters.

[0061] In step S102, the recognition model is a model trained based on the hotspot feature information of the hotspot area. Specifically, AI technology is used to train in advance in combination with the hotspot feature information of the hotspot area, and then the format of the trained recognition model is converted into a format that can be processed by the NPU (Neural network Processing Unit). After the format conversion is completed, the recognition model after the format conversion is imported into the NPU for the purpose of subsequent identification of the hotspot area.

[0062] It should be noted that the hotspot feature information refers to the text editing area feature or other image features that you want to focus on. When reading image data, it can be read from a collection storage space that specifically stores 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 the image data is read. In the process of reading the image data, two situations may occur: the image data is read and the image data is not read. Therefore, in the process of reading the image data, it is necessary to determine whether the image data is read, so as to perform subsequent operations 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 for storing the image data.

[0066] It should be noted that, in the process of reading image data, if no image data is read from the acquisition storage space, it proves that there is no image data in the acquisition storage space. In this case, the encoding can be terminated.

[0067] In step S105, after configuring the NPU to identify the image data source and address space, it is necessary to identify the hotspot area of ​​the image data stored in the storage space in real time. Specifically, the NPU is started, and the hotspot area is 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 as to perform subsequent operations 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 more bit rates need to be allocated to the hotspot area when encoding the image data of 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 down. Reducing the value of the encoding parameter can achieve allocating more bit rates 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 the hotspot area is not 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 code rate to the hotspot area, so as to make the image of the hotspot area clearer.

[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, in the process of reading image data, if no image data is read, encoding is not required at this time.

[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 default encoding parameters.

[0076] It should be noted that, in the process of identifying hotspot areas, if the loaded and running 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 it is determined whether the hotspot area is identified.

[0080] It is understandable that when no hotspot area is identified, after the encoder normally encodes the image data not containing the hotspot area according to the default encoding parameters, it needs to perform cyclic encoding, 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 is read, in addition to the case where image data is read, the case where image data is not read is also included. If the image data is still not read, the steps to be performed have been described in the above embodiment, and this application will not repeat them.

[0083] In one embodiment, after the step of encoding the image data of the hot spot 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 it is determined 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 in the present 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 the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution, etc. In addition, it is also easy to understand that these steps may be, for example, executed synchronously or asynchronously in multiple modules / processes / threads.

[0088] Furthermore, in this exemplary embodiment, an image encoding device is also provided. Figure 2 As shown in , the device 200 includes an application module 210, a loading module 220, a judgment module 230, a first judgment submodule 231, an identification judgment module 240, a first identification judgment submodule 241, and an encoding module 250. Among them, the application module 210 is used to apply for encoding storage space. The loading module 220 is used to load the recognition model into the NPU; wherein the recognition model is a model trained according to the hotspot feature information of the hotspot area. The judgment module 230 is used to determine whether the image data is read. The first judgment submodule 231 is used 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. The identification judgment module 240 is used 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. The first identification judgment submodule 241 is used to generate the hotspot area coordinate information according to the hotspot area if the hotspot area is identified, and send the hotspot area coordinate information to the encoder to adjust the encoding parameters of the hotspot area. The encoding module 250 is used to encode the image data of the hot spot area according to the adjusted encoding parameters.

[0089] In one embodiment, after the step of the determination module 230, the method further includes:

[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 identifying and determining the module 240, the method further includes:

[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 the hotspot area is not identified.

[0093] In one embodiment, after the step of the second determination submodule, the method further includes:

[0094] A reading judgment module is used to continue reading the image data and judge whether the image data is read;

[0095] And, if the image data is read, the NPU is started up again, the hot spot area of ​​the image data in the storage space is identified using the loaded recognition model, and it is determined whether the hot spot area is identified.

[0096] In one embodiment, after the step of encoding module 250, the following steps are further included:

[0097] A reading judgment module is used to continue reading the image data and judge whether the image data is read;

[0098] And, if the image data is read, the NPU is started up again, the hot spot area of ​​the image data in the storage space is identified using the loaded recognition model, and it is determined whether the hot spot area is identified.

[0099] Regarding the device 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 on 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 creative work.

[0101] In an exemplary embodiment of the present application, a computer-readable storage medium is also provided, on which a computer program is stored, and when the program is included in a processor and executed, the steps of the image encoding method described in any of the above embodiments can be implemented. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary embodiments of the present invention described in the above image encoding 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, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can 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 can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a 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 device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with 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 of the above.

[0104] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. 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 an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0105] 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++, etc., and 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 separate software package, partially on the user computing device, 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 through 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., through 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] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".

[0108] Refer to the following Figure 4 The electronic device 600 according to this embodiment of the present invention is described. Figure 4 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0109] like Figure 4 As shown, the electronic device 600 is in the form of a general computing device. The components of the 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 different system components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.

[0110] The storage unit stores a program code, 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 encoding 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 the implementation of a network environment.

[0113] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit 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 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also 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 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may 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 implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method 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, including 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 implementation method of the present application.

[0116] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.

Claims

1. An image coding method, characterized in that: include: Apply for coding storage space; Loading a recognition model into the NPU; wherein the recognition model is a model trained according to 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 hot spot area is encoded according to the adjusted encoding parameters.

2. The image encoding method according to claim 1, characterized in that 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, characterized in that: 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, characterized in that: 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: Continue to read the image data, and determine whether the image data is read; If the image data is read, the NPU is started up again, 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, characterized in that: After the step of encoding the image data of the hot spot area according to the adjusted encoding parameters, the method further includes: Continue to read the image data, and determine whether the image data is read; If the image data is read, the NPU is started up again, 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 encoding storage space; A loading module, used to load the recognition model into the NPU; wherein the recognition model is a model trained according to the hotspot feature information of the hotspot area; A judgment module, used to judge whether the image data is read; A first judgment submodule is used for storing the image data in the storage space if the image data is read, and configuring 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, used to start the NPU, use the loaded identification model to identify the hotspot area of ​​the image data in the storage space, and determine whether the hotspot area is identified; A first identification and judgment submodule is used to generate hot spot area coordinate information according to the hot spot area if the hot spot area is identified, and send the hot spot area coordinate information to the encoder to adjust the encoding parameters of the hot spot area; The encoding module is used to encode the image data of the hot spot area according to the adjusted encoding parameters.

7. The image encoding device according to claim 6, characterized in that The device also includes: The second judgment submodule is used to end 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 encoding 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, configured to store 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

  • Image processing method and device

    CN114913063A

  • Neural image compression with controllable spatial bit allocation

    US20230156207A1