Decoding optimization method and related products
Patent Information
- Application Number
- CN202510702320.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2045-05-28
AI Technical Summary
[0002]当保密场所内出现解码问题时,由于原始图像中可能包含保密信息,无法将原始图像传输出保密场所
[0021] The beneficial effects of the technical solutions in the second to fifth aspects can be found in the technical effects of the technical solution in the first aspect, and will not be repeated here.
Smart Images

Figure CN120499399B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image decoding technology, and in particular to a decoding optimization method and related products. Background Technology
[0002] When decoding problems occur within a secure location, the original image cannot be transmitted out of the secure location because it may contain confidential information. Current technology requires researchers to apply for access to the secure location to optimize the decoding algorithm, resulting in low optimization efficiency and inefficient resolution of decoding anomalies. Summary of the Invention
[0003] This application proposes a decoding optimization method and related products, which can improve the optimization efficiency of decoding algorithms and the efficiency of solving decoding anomaly problems.
[0004] This application adopts the following technical solution.
[0005] In a first aspect, embodiments of this application provide a decoding optimization method, including:
[0006] The code region is extracted from the first image to obtain the first code region image, where the first image is an image that failed to be decoded;
[0007] Based on the first code region image, determine the style feature information of the first code region image;
[0008] Obtain first encoded information, which is the same as the encoded information of the information in the code region in the first code region image;
[0009] Based on the style feature information and the first encoding information, a second image is generated;
[0010] The decoding method is optimized based on the second image.
[0011] As can be seen, by extracting the code region from the first image and removing the background portion, any potentially confidential information contained in the background is eliminated. Then, the style feature information of the first code region image and the first encoding information, identical to the encoding information within the code region of the first code region image, are determined. Using the style feature information and the first encoding information, a second image is generated that is style-consistent with the first code region image but does not contain the encoded information within the code region of the first code region image. Finally, the decoding method is optimized based on the second image. Thus, by highly restoring the first image that failed to decode using the style feature information and the first encoding information, and simultaneously removing the confidential information from the first image, a second image is obtained that contains no confidential information and is highly consistent with the first image in terms of encoding and style. Consequently, this second image has no transmission restrictions and can be transmitted out of confidential locations. Based on this, optimizing the decoding method based on this second image is not limited to confidential locations, greatly improving the optimization efficiency of the decoding algorithm and further enhancing the efficiency of resolving decoding anomaly problems.
[0012] Secondly, embodiments of this application provide a decoding optimization apparatus, comprising:
[0013] The extraction module is used to extract the code region from the first image to obtain the first code region image, wherein the first image is an image that failed to be decoded;
[0014] A style module is used to determine the style feature information of the first code region image based on the first code region image;
[0015] The acquisition module is used to acquire first encoded information, which is the same as the encoded information of the information in the code region in the first code region image;
[0016] A generation module is used to generate a second image based on the style feature information and the first encoding information;
[0017] An optimization module is used to optimize the decoding method based on the second image.
[0018] Thirdly, a computer device provided for embodiments of this application includes a processor, a memory, and a computer program or instructions stored in the memory, wherein the processor executes the computer program or instructions to implement the steps in the method designed in the first aspect above.
[0019] Fourthly, an embodiment of this application provides a computer-readable storage medium storing a computer program or instructions that, when executed, implement the steps of the method designed in the first aspect. For example, the computer program or instructions are executed by a processor.
[0020] Fifthly, a computer program product provided for embodiments of this application includes a computer program or instructions, wherein when the computer program or instructions are executed, the steps in the method designed in the first aspect described above are performed. For example, the computer program or instructions are executed by a processor.
[0021] The beneficial effects of the technical solutions in the second to fifth aspects can be found in the technical effects of the technical solution in the first aspect, and will not be repeated here. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0023] Figure 1 A schematic diagram of a decoding optimization system provided for an embodiment of this application;
[0024] Figure 2 A flowchart illustrating a decoding optimization method provided for an embodiment of this application;
[0025] Figure 3 A schematic diagram of a third candidate region provided for an embodiment of this application;
[0026] Figure 4 A schematic diagram of a first candidate region provided for an embodiment of this application;
[0027] Figure 5 A flowchart illustrating a method for obtaining an attention heatmap of a first image, provided for an embodiment of this application;
[0028] Figure 6 A functional module block diagram of a decoding optimization device provided for embodiments of this application;
[0029] Figure 7 An internal structural diagram of a computer device provided for an embodiment of this application;
[0030] Figure 8 An internal structural diagram of another computer device provided for an embodiment of this application;
[0031] Figure 9 An internal structural diagram of a computer-readable storage medium provided for an embodiment of this application. Detailed Implementation
[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0033] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “the,” and “the” used in the embodiments, descriptions, and claims of this application are also intended to include the plural forms unless the context clearly indicates otherwise. It should be understood that the term “and / or” as used herein is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Additionally, the character “ / ” in this document generally indicates that the preceding and following related objects are in an “or” relationship. It should be understood that although the terms “first,” “second,” and similar words may be used in the embodiments of this application, they do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Similarly, “a” or “one,” and similar words do not indicate a quantity limitation, but rather indicate the existence of at least one. “A plurality” in the embodiments of this application refers to two or more.
[0034] To facilitate understanding of the technical solution of this application, the reasons for the low optimization efficiency of the decoding algorithm and the low efficiency of solving decoding anomalies when decoding problems occur in confidential locations will be explained below.
[0035] When decoding problems occur within a secure location, the original image cannot be transmitted out of the secure location because it may contain confidential information. The current approach is for researchers to request access to the secure location to optimize the decoding algorithm and resolve the decoding anomaly.
[0036] Specifically, one model involves researchers requesting access to a secure location to analyze the original images and optimize the decoding algorithm. Another model involves researchers requesting access to a secure location to observe the original images, then leaving and optimizing the decoding algorithm based on their memory of the observations.
[0037] However, the former approach, which can only be optimized in a secure environment lacking sufficient debugging equipment, and which may be a production environment with interference such as high temperatures and noise, also prevents on-site discussions with external team members. This results in low optimization efficiency for the decoding algorithm and low efficiency in resolving decoding anomalies. Furthermore, even after successful optimization, the optimized decoding algorithm cannot be taken out of the secure environment, making it difficult to reuse previous solutions when encountering similar problems in the future. The latter approach, while solving the problems of the optimized environment and the inability to take the optimized algorithm out of the secure environment, still suffers from low optimization efficiency and low efficiency in resolving decoding anomalies because the original image cannot be retrieved and simulations must be performed from memory. Moreover, the approval and authorization process for R&D personnel to enter the secure environment is lengthy, further reducing the efficiency of resolving decoding anomalies.
[0038] First, refer to Figure 1 , Figure 1 This is a schematic diagram of a decoding optimization system proposed in an embodiment of this application. For example... Figure 1 As shown, the decoding optimization system may include optimization devices and a database.
[0039] In this embodiment, after receiving a first image that failed to decode, the optimization device extracts the code region from the first image to remove image backgrounds that may contain confidential information, obtaining a first code region image. Then, it determines the style feature information of the first code region image, such as image noise, image blur level, image reflectivity, image contrast, and image distortion. Next, the optimization device obtains first encoding information, which is identical to the encoding information within the code region of the first code region image. Finally, based on the style feature information and the first encoding information, the optimization device generates a second image with the same encoding features and style characteristics as the first code region image, and optimizes the decoding method based on this second image. Alternatively, the optimization device can store the second image in a database, allowing researchers to access the database to retrieve the second image and optimize the decoding method.
[0040] Therefore, by highly reconstructing the first image that failed to decode using style feature information and first encoding information, and simultaneously removing the confidential information from the first image, a second image is obtained that contains no confidential information and is highly consistent with the first image in terms of encoding and style. This second image has no transmission restrictions and can be transmitted out of confidential locations. Optimizing the decoding method based on this second image is not limited by the restrictions of confidential locations, greatly improving the optimization efficiency of the decoding algorithm, and further improving the efficiency of solving decoding anomaly problems.
[0041] Understandable Figure 1 The form and quantity of the optimization devices and databases shown are for illustrative purposes only and do not constitute a limitation on the implementation of this application.
[0042] In this embodiment, the optimization device can be a device with communication capabilities, and may be referred to as a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), access terminal device, vehicle-mounted terminal device, industrial control terminal device, UE unit, UE station, mobile station, remote station, remote terminal device, mobile device, UE terminal device, wireless communication device, UE agent, or UE device, etc. The terminal device can be fixed or mobile. It should be noted that the optimization device can support at least one wireless communication technology, such as LTE, New Radio (NR), and Wideband Code Division Multiple Access (WCDMA). For example, training equipment and terminal equipment can be mobile phones, tablets, desktop computers, laptops, all-in-one computers, in-vehicle terminals, virtual reality (VR) terminal equipment, augmented reality (AR) terminal equipment, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, cellular phones, cordless phones, session initiation protocol (SIP) phones, wireless local loop (WLL) stations, personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices or other processing devices connected to wireless modems, wearable devices, terminal equipment in future mobile communication networks, or terminal equipment in future evolved public land mobile networks (PLMNs), etc. In some embodiments of this application, the optimized device may also be a device with transceiver functions, such as a chip system. The chip system may include a chip, and may also include other discrete devices.
[0043] In this embodiment, the optimization device can also be a server. For example, it can be a standalone server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. This application does not specifically limit it in this regard.
[0044] In this embodiment, the database may also be a server, or a storage device that provides data storage services, such as: read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. This application does not specifically limit this as well.
[0045] In this embodiment, the database may also be a storage unit integrated into the optimization device, and is a component of the optimization device.
[0046] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the above content and the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. At the same time, these embodiments can be related to each other or independent of each other, and the same content between different embodiments can be referenced by each other, which will not be elaborated here.
[0047] See Figure 2 , Figure 2 This is a flowchart illustrating a decoding optimization method proposed in an embodiment of this application. The method is applied to... Figure 1 The decoding optimization system shown can be implemented by optimization devices within the decoding optimization system. For example... Figure 2As shown, the method includes:
[0048] S201: Extract the code region from the first image to obtain the first code region image.
[0049] In this embodiment, the first image is an image that failed to be decoded, and the code area in the first image can be a QR code, barcode, etc. Specifically, when the first image fails to be decoded, the device that decoded the first image can save the first image to a database. This database can be a local offline database or a database with access restrictions to ensure that the first image is not accessed or transmitted arbitrarily. The optimization device can periodically access the database to obtain the first image; or, the database can actively send the first image to the optimization device after receiving it; or, the database can send a prompt message to the optimization device after receiving the first image, prompting the optimization device to access the database to obtain the first image; this application does not impose any restrictions on this.
[0050] It should be noted that if the decoding of the first image fails, the device that decodes the first image can also directly transmit the first image to the optimization device; or, the device that decodes the first image and the optimization device can be the same device, and then the optimization device can directly obtain the first image.
[0051] After acquiring the first image, the optimization device can identify the location of the code region in the first image, and then extract the code region from the first image to obtain the first code region image. For example, the optimization device can extract the code region using the following method:
[0052] First, the optimization device can determine a first candidate region in the first image. This first candidate region can be understood as a region in the first image where code regions may exist. For example, the background of the first image can first be reconstructed to obtain a third image, and then the different regions in the first and third images can be used as the third candidate regions. Specifically, as... Figure 3 As shown, the code region in an image often has a clear boundary with the background and can be considered as an area that partially occludes the background. Therefore, background reconstruction can identify the areas in the first image that occlude the background, i.e., the third candidate regions. These regions are all areas where code regions may exist.
[0053] In this embodiment, a background reconstruction model can be trained to reconstruct the background of the first image. Specifically, a large number of images without code regions are first acquired as raw materials. Then, code regions are added to each raw material to obtain a training set, while the original raw materials serve as a validation set for model training. The purpose of training is to reconstruct the background of the images in the training set that contain code regions, restoring them to the images before the code regions were added. The trained model can employ models such as U-Net, ContextualAttention GAN (CA-GAN), or Image Completion Transformer (ICT). By inputting the images in the training set that contain code regions into the model, the model's output is compared with the original material corresponding to the image containing the code region. The model is trained based on the differences in the comparison to obtain the final background reconstruction model.
[0054] In this embodiment, in order to obtain a more accurate region where the code area may exist, such as Figure 4 As shown, an attention heatmap of the first image can also be determined. Thresholding and connected component extraction are performed on the attention heatmap to identify a fourth candidate region. The third and fourth candidate regions are then considered as regions where code regions may exist, i.e., the first candidate region. Specifically, the attention heatmap reflects the attention intensity of each region in the image during processing. Higher attention intensity indicates greater importance of the region in image processing. Code regions, relative to the image background, often contain more image information, thus their importance and attention intensity are higher. By obtaining the attention heatmap, regions with high attention intensity in the first image can be identified; these regions are potential locations for code regions. Merging these high-attention-intensity regions (the fourth candidate region) with the regions obscuring the background (the third candidate region) determines all possible locations for code regions in the first image, i.e., the first candidate region.
[0055] In this embodiment, an attention mechanism can be introduced into the training background reconstruction model, such as adding a Convolutional Block Attention Module (CBAM) or a Squeeze-and-Excitation Module (SE). Then, while reconstructing the background of the first image using the background reconstruction model, the attention heatmap is output.
[0056] Furthermore, this application also provides a method for obtaining an attention heatmap of a first image, specifically as follows: Figure 5 As shown, the method includes:
[0057] S501: Perform edge detection on the first image to obtain the fourth image.
[0058] In this embodiment, the first image can be converted into a grayscale image, and Gaussian filtering can be applied to the grayscale image to reduce the influence of noise. Then, an edge detection algorithm, such as the Canny algorithm, is used to detect edges, and a binary edge image is output as the fourth image.
[0059] S502: Perform contrast analysis on the first image to obtain the fifth image.
[0060] In this embodiment, the first image can be converted into a grayscale image. For each pixel in the grayscale image, a window is defined centered on that pixel, for example, an 11x11 window. Then, the standard deviation of the pixels within the window is calculated, and the calculated standard deviation value is assigned to the corresponding pixel of the window to obtain the fifth image.
[0061] S503: Calculate the information entropy of the first image to obtain the sixth image.
[0062] In this embodiment, the first image can be converted into a grayscale image. For each pixel in the grayscale image, a window is defined centered on that pixel, for example, an 11x11 window. Then, the grayscale histogram within the window is statistically analyzed, and the information entropy of the window region is calculated. This information entropy can be expressed by formula ①:
[0063]
[0064] Where H represents the information entropy of the window region, L represents the number of gray levels in the grayscale image, i represents the grayscale value, and p i This represents the proportion of pixels with grayscale value i within the window area.
[0065] Finally, the calculated information entropy value is assigned to the corresponding pixel of the window to obtain the sixth image.
[0066] S504: Based on preset weights, the normalized fourth, fifth, and sixth images are weighted and fused to obtain an attention heatmap.
[0067] In this embodiment, after weighted fusion of the normalized fourth, fifth, and sixth images, the resulting image can be binarized based on a preset threshold to obtain an attention heatmap. Specifically, pixels with values less than the threshold can be set to 0, and pixels with values greater than or equal to the threshold can be set to 1, resulting in a binary image that more intuitively identifies regions with high attention intensity in the attention heatmap.
[0068] In this embodiment, after determining the first candidate region, edge detection can be performed on the image within the first candidate region to determine at least one second candidate region. As described above, the code area mentioned in this embodiment can be a QR code, barcode, etc., which often have a clear boundary with the background in the image. Specifically, in the first image, the boundary of the code area may be a closed rectangle; due to different shooting angles, this rectangle may be an irregular trapezoid or rhombus. Based on this, edge detection can be performed on the image within the first candidate region, and the edge features of regions satisfying the above conditions will be used as the second candidate region.
[0069] Then, feature extraction is performed on the image in each second candidate region to obtain at least one image feature corresponding one-to-one with the at least one second candidate region. Thus, the location of the code area is determined within at least one second candidate region. Specifically, code areas such as QR codes, barcodes, etc., each have their own specific image features. For example, for a QR code, the finder patterns at its three corners are large square targets with alternating black and white lines, containing concentric black and white boxes, with regular shapes and clear boundaries. Furthermore, the QR code as a whole is a square, with strict matrix division, a regular dot matrix structure, and auxiliary structures such as format information areas, alignment patterns, and clock lines. Therefore, by comparing at least one image feature with the image features of various code areas, the location of the code area can be determined within at least one second candidate region.
[0070] Therefore, by screening the first candidate region, the regions in the first image that are highly likely to contain code regions can be selected. Then, when performing code region recognition, it is only necessary to analyze and compare the images in the first candidate region, which greatly reduces the computational cost and improves the recognition efficiency.
[0071] Finally, image extraction is performed based on the location of the code region to obtain the image of the first code region.
[0072] S202: Based on the first code region image, determine the style feature information of the first code region image.
[0073] In this embodiment, the style feature information includes at least one of the following: image noise, image blur level, image reflectivity, image contrast level, and image distortion level.
[0074] S203: Obtain the first encoded information.
[0075] In this embodiment, the first encoding information is the same as the encoding information of the information within the code area in the first code area image. For example, the first encoding information may include the encoding length, encoding rules, polarity, encoding version, etc. The encoding length can be understood as the character length of the encoded information. For example, if the encoded information in the first code area image is "000101110011001", then its encoding length is 15.
[0076] In this embodiment, the first encoding information must include at least the encoding length and encoding rules.
[0077] S204: Generate a second image based on style feature information and first encoding information.
[0078] In this embodiment, the optimization device can generate a random string of equal length based on the first encoding information, which serves as the information to be encoded within the code area of the second image. Then, based on the encoding rules in the first encoding information, the random string is encoded to obtain the second code area image. Since the encoding length of the random string is consistent with the encoding length of the information encoded within the code area of the first code area image, and the encoding rules for generating the second code area image are also consistent with the encoding rules of the code area in the first code area image, the second code area image is highly consistent in all aspects except for the specific content of the random string encoded within the code area, which differs from the information encoded within the code area of the first code area image.
[0079] Then, based on the style feature information, the second code region image is processed to obtain a second image, whose style is the same as the style corresponding to the style feature information. Specifically, the second code region image can be processed using a style transfer algorithm combined with style feature information to obtain the second image. Thus, since the second code region image maintains a high degree of consistency with the first code region image except for the specific content of the random string encoded in the code region, its external image features and visual features are also highly consistent with the first code region image through style transfer.
[0080] S205: Optimize the decoding method based on the second image.
[0081] In this embodiment, the obtained second image is a simulated image of the first code area image, which is highly consistent with the first code area image in terms of encoding, image features, and visual features. The decoding method is then optimized based on this second image. Since the second image does not contain any confidential information, it is not limited by the constraints of confidential locations, greatly improving the optimization efficiency of the decoding algorithm, and further improving the efficiency of solving decoding anomaly problems.
[0082] In one possible implementation, after obtaining the second image, it can be further judged to determine whether it is close to the first code region image. The second image that passes the judgment is then used as the benchmark for optimizing the decoding method. This judgment can be made by training a relevant model to compare the second image and the first code region image across various feature dimensions, such as edge structure, local contrast distribution, grayscale histogram, information entropy, and frequency domain energy distribution. The similarity between the two images is then determined, and if the similarity exceeds a preset threshold, the judgment is considered successful.
[0083] Optionally, the above determination can also be made manually, and this application does not restrict this.
[0084] As can be seen, in the scheme of this application, the first image is extracted by removing the code region, and the background portion is stripped to remove any confidential information that may be contained in the background. Then, the style feature information of the first code region image and the first encoding information that is identical to the encoding information within the code region of the first code region image are determined. Using the style feature information and the first encoding information, a second image is generated that is consistent in style with the first code region image and does not contain the encoded information within the code region of the first code region image. Finally, the decoding method is optimized based on the second image. Thus, the first image that failed to be decoded is highly restored by using the style feature information and the first encoding information. At the same time, the confidential information in the first image is removed, resulting in a second image that does not contain confidential information and is highly consistent with the first image in terms of encoding and style. Consequently, the second image has no transmission restrictions and can be transmitted out of the confidential location. Based on this, the optimization of the decoding method based on the second image is not limited to the restrictions of the confidential location, greatly improving the optimization efficiency of the decoding algorithm, and further improving the efficiency of solving decoding anomaly problems.
[0085] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.
[0086] The above primarily describes the implementation scheme of this application from a methodological perspective. It is understood that the decoding optimization device, in order to achieve the above functions, includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software-driven hardware manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0087] The embodiments of this application can divide the terminal device into functional units according to the above method examples. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one functional module. The integrated module can be implemented in hardware or as a software program module. It should be noted that the module division in the embodiments of this application is illustrative and is only a logical functional division, while other division methods may be used in actual implementation.
[0088] When using integrated modules, Figure 6 This is a block diagram of the functional modules of a decoding optimization device proposed in an embodiment of this application. The decoding optimization device 600 includes an extraction module 601, a style module 602, an acquisition module 603, a generation module 604, and an optimization module 605.
[0089] In this embodiment, the extraction module 601, style module 602, acquisition module 603, generation module 604, and optimization module 605 included in the decoding optimization device 600 can be any module used for receiving and processing signals, information, etc., or for determining monitoring mechanisms, and no specific limitations are imposed on them.
[0090] In this embodiment, the decoding optimization device 600 may further include a storage module for decoding the computer program code or instructions executed by the decoding optimization device 600. The storage module may be a memory.
[0091] In this embodiment, the decoding optimization device 600 may be a chip or a chip module.
[0092] In this embodiment, the extraction module 601, style module 602, acquisition module 603, generation module 604, and optimization module 605 included in the decoding optimization device 600 can be integrated into the communication module. The communication module can be a communication interface, transceiver, transceiver circuit, etc.
[0093] In this embodiment, the extraction module 601, style module 602, acquisition module 603, generation module 604 and optimization module 605 included in the decoding optimization device 600 can be integrated into the processor.
[0094] It should be noted that the processor can be a baseband processor, baseband chip, central processing unit (CPU), general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. A processing module can also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0095] In this embodiment, the decoding optimization device 600 is used to perform any of the steps performed by the terminal device / chip / chip module, etc., as described in the above method embodiments.
[0096] In specific implementation, the decoding optimization device 600 includes an extraction module 601, a style module 602, an acquisition module 603, a generation module 604, and an optimization module 605, which are used to perform any of the steps in the above method implementation. When performing actions such as sending, other modules can be selectively called to complete the corresponding operations. A detailed description follows.
[0097] Extraction module 601 is used to extract the code region from the first image to obtain the first code region image, wherein the first image is an image that failed to be decoded;
[0098] Style module 602 is used to determine the style feature information of the first code region image based on the first code region image;
[0099] The acquisition module 603 is used to acquire first encoded information, which is the same as the encoded information of the information in the code area in the first code area image;
[0100] The generation module 604 is used to generate a second image based on style feature information and first encoding information;
[0101] The optimization module 605 is used to optimize the decoding method based on the second image.
[0102] In this embodiment, the first encoding information includes at least the encoding length and encoding rules.
[0103] In this embodiment, in generating the second image based on style feature information and first encoding information, the generation module 604 is specifically used for:
[0104] Generate a string with the same encoding length as the encoding length;
[0105] Based on the encoding rules, the string is encoded to obtain the second code area image;
[0106] Based on style feature information, the second code region image is processed to obtain a second image, and the style of the second image is the same as the style corresponding to the style feature information.
[0107] In this embodiment, the style feature information includes at least one of the following:
[0108] Image noise, image blur, image reflectivity, image contrast, and image distortion.
[0109] In this embodiment, the extraction module 601, in extracting the code region from the first image to obtain the first code region image, is specifically used for:
[0110] In the first image, determine the first candidate region;
[0111] Perform edge detection on the image in the first candidate region to determine at least one second candidate region;
[0112] Feature extraction is performed on the image in each second candidate region to obtain at least one image feature, and at least one image feature corresponds one-to-one with at least one second candidate region;
[0113] Based on the image features corresponding to each second candidate region, the location of the code region is determined in at least one second candidate region;
[0114] Image extraction is performed based on location to obtain the first code region image.
[0115] In this embodiment, in determining the first candidate region in the first image, the extraction module 601 is specifically used for:
[0116] The background of the first image is reconstructed to obtain the third image;
[0117] Based on the third image and the first image, a third candidate region is determined, which is a different region in the first image and the third image.
[0118] Determine the attention heatmap of the first image;
[0119] Thresholding and connected component extraction are performed on the attention heatmap to determine the fourth candidate region;
[0120] The third and fourth candidate regions are selected as the first candidate regions.
[0121] In this embodiment, the extraction module 601, in determining the attention heatmap of the first image, is specifically used for:
[0122] Edge detection is performed on the first image to obtain the fourth image;
[0123] Perform contrast analysis on the first image to obtain the fifth image;
[0124] The information entropy of the first image is calculated to obtain the sixth image;
[0125] Based on preset weights, the normalized fourth, fifth, and sixth images are weighted and fused to obtain an attention heatmap.
[0126] Each module in the aforementioned decoding optimization device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0127] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The database stores the steps described in the above-described method embodiments. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps described in the above-described method embodiments.
[0128] In some embodiments, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements the steps in the above-described method embodiments. The display unit of the computer device forms a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen; the input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs or touchpads set on the casing of the computer device, or external keyboards, touchpads or mice, etc.
[0129] Those skilled in the art will understand that Figure 7 or Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0130] In some embodiments, a computer device is provided, the computer device including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps in the above-described method embodiments.
[0131] In some implementations, such as Figure 9 The diagram shows the internal structure of a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the above-described method embodiments.
[0132] In some embodiments, a computer program product is provided, which includes a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0133] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0134] Those skilled in the art will understand that all or part of the processes in the above-described embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0135] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0136] The above embodiments are merely illustrative of several implementations of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A decoding optimization method, characterized in that, The method includes: The code region is extracted from the first image to obtain the first code region image, where the first image is an image that failed to be decoded; Based on the first code region image, determine the style feature information of the first code region image; Obtain first encoding information, which is the same as the encoding information of the information in the code region in the first code region image, and the first encoding information includes at least encoding length and encoding rule; Based on the encoded length, generate a string with the same encoded length; Based on the encoding rules and the string, a second code area image is generated; Based on the style feature information, the second code area image is processed to obtain a second image. The style of the second image is the same as the style corresponding to the style feature information. The style feature information includes at least one of the following: image noise, image blur, image reflectivity, image contrast, and image distortion. The decoding method is optimized based on the second image.
2. The method according to claim 1, characterized in that, The step of extracting code regions from the first image to obtain a first code region image includes: In the first image, a first candidate region is determined; Edge detection is performed on the image in the first candidate region to determine at least one second candidate region; Feature extraction is performed on the image in each second candidate region to obtain at least one image feature, and the at least one image feature corresponds one-to-one with the at least one second candidate region; Based on the image features corresponding to each second candidate region, the location of the code region is determined in the at least one second candidate region; Image extraction is performed based on the location to obtain the first code region image.
3. The method according to claim 2, characterized in that, Determining the first candidate region in the first image includes: The background of the first image is reconstructed to obtain the third image; Based on the third image and the first image, a third candidate region is determined, wherein the third candidate region is a different region in the first image and the third image; Determine the attention heatmap of the first image; The attention heatmap is subjected to thresholding and connected component extraction to determine the fourth candidate region; The third candidate region and the fourth candidate region are used as the first candidate region.
4. The method according to claim 3, characterized in that, Determining the attention heatmap of the first image includes: Edge detection is performed on the first image to obtain the fourth image; Perform contrast analysis on the first image to obtain the fifth image; The information entropy of the first image is calculated to obtain the sixth image; Based on preset weights, the normalized fourth image, the fifth image, and the sixth image are weighted and fused to obtain the attention heatmap.
5. A decoding optimization device, characterized in that, The device includes: The extraction module is used to extract the code region from the first image to obtain the first code region image, wherein the first image is an image that failed to be decoded; A style module is used to determine the style feature information of the first code region image based on the first code region image; The acquisition module is used to acquire first encoded information, which is the same as the encoded information of the information in the code region in the first code region image. The first encoded information includes at least the encoding length and the encoding rule. A generation module is used to generate a string with the same encoding length as the encoding length; generate a second code area image based on the encoding rule and the string; and process the second code area image based on the style feature information to obtain a second image, wherein the style of the second image is the same as the style corresponding to the style feature information, and the style feature information includes at least one of the following: image noise, image blur level, image reflectivity, image contrast level, and image distortion level. An optimization module is used to optimize the decoding method based on the second image.
6. A computer device, comprising a processor, a memory, and a computer program or instructions stored in the memory, characterized in that, The processor executes the computer program or instructions to implement the steps of the method according to any one of claims 1-4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to implement the method as described in any one of claims 1-4.
Citation Information
Patent Citations
Two-dimensional code information hiding method based on run-length coding
CN109657769A
Two-dimensional code information processing method and device, electronic equipment and storage medium
CN119128939A