Picture processing method and apparatus
By dividing credit data images into multiple regions and adjusting sampling weights and sparse bases based on information type for undersampling and reconstruction, the transmission performance and image distortion problems caused by JPEG or PNG formats are solved, achieving efficient and accurate credit data transmission and recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-03-27
AI Technical Summary
Existing technologies use JPEG or PNG formats to transmit credit data images, resulting in excessively large image sizes that affect the real-time transmission performance of encryption protocols. Furthermore, high compression rates can easily cause image distortion, impacting the accuracy of OCR recognition.
The target image is divided into multiple regions. Sampling weights and sparse bases are determined based on the information type of each region. The weight coefficients of the random Gaussian matrix are adjusted, and undersampling is performed through a weighted Gaussian measurement matrix to obtain the undersampling result of the target image. Image reconstruction is then performed based on the sparse base and observations.
Achieving high compression rates while maintaining image quality improves transmission efficiency and enhances the fidelity of key data, ensuring the accuracy of OCR recognition.
Smart Images

Figure CN121095361B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The one or more embodiments of the present specification relate to the technical field of picture processing, and in particular, to a picture processing method and device. BACKGROUND
[0002] Due to the particularity of credit investigation data, the security requirement for transmission is high. Therefore, when transmitting credit investigation data, especially pictures containing credit investigation data, the original picture cannot be directly transmitted, and the picture containing credit investigation data is converted into bytecode and transmitted through an encryption protocol to avoid data leakage.
[0003] At present, in the related art, in order to improve the efficiency of transmitting bytecode through an encryption protocol, when transmitting a picture containing credit investigation data, the picture containing credit investigation data is compressed into a JPEG or PNG format, and the compression result is converted into bytecode for transmission. However, the JPEG or PNG format can cause the picture to be too large, affecting the real-time transmission performance of the encryption protocol. If the picture containing credit investigation data is directly compressed at a high compression rate, image distortion can easily occur at a high compression rate, affecting subsequent OCR recognition. Therefore, how to improve the efficiency of transmitting a picture containing credit investigation data through an encryption protocol while ensuring image quality is a technical problem to be solved at present. SUMMARY
[0004] Therefore, the one or more embodiments of the present specification provide a picture processing method and device.
[0005] To achieve the above object, the one or more embodiments of the present specification provide the technical solutions as follows.
[0006] According to a first aspect of the one or more embodiments of the present specification, a picture processing method is provided, the method being applied to a picture sender; the method comprises:
[0007] dividing a target picture into a plurality of regions; and determining a sampling weight corresponding to each region and a sparse basis corresponding to each region based on an information type of picture information contained in each region;
[0008] obtaining a random Gaussian matrix corresponding to the target picture, adjusting a weight coefficient in the random Gaussian matrix based on the sampling weight of each region to obtain a weighted Gaussian measurement matrix, and performing undersampling on the target picture based on the weighted Gaussian measurement matrix to obtain an undersampling result corresponding to the target picture;
[0009] determining a target observation value of the target picture based on the sparse basis corresponding to each region and the undersampling result;
[0010] Determine a processing result of the target picture based on the target observation value, the sparse basis corresponding to each region and the weighted Gaussian measurement matrix, and transmit the processing result.
[0011] According to a second aspect of one or more embodiments of the present specification, a picture processing method is provided, which is applied to a picture receiver; the method comprises:
[0012] Receiving a processing result of a target picture sent by a picture sender; the processing result comprises a target observation value of the target picture, a sparse basis corresponding to each region of the target picture and a weighted Gaussian matrix corresponding to the target picture; the target observation value is determined according to the result of undersampling the target picture according to the weighted Gaussian measurement matrix and the sparse basis of each region; the weighted Gaussian measurement matrix is obtained by adjusting the weight coefficient in the random Gaussian matrix according to the sampling weight of each region; the sampling weight of each region and the sparse basis corresponding to each region are determined based on the information type of the picture information contained in each region;
[0013] Based on the target observation value, the sparse basis corresponding to each region and the weighted Gaussian measurement matrix, reconstruct the image.
[0014] According to a third aspect of one or more embodiments of the present specification, an electronic device is provided, comprising:
[0015] A processor;
[0016] A memory for storing processor executable instructions;
[0017] The processor implements the method of the first aspect or the second aspect by running the executable instructions.
[0018] According to a fourth aspect of one or more embodiments of the present specification, a computer readable storage medium is provided, which stores computer instructions, and the instructions are executed by a processor to implement the steps of the method of the first aspect or the second aspect.
[0019] According to a fifth aspect of one or more embodiments of the present specification, a computer program product is provided, comprising: computer program / instructions, which are executed by a processor to implement the method of the first aspect or the second aspect.
[0020] As can be seen from the above embodiments, the picture processing method and device provided by one or more embodiments of the present specification divide a target picture into multiple regions, and determine the sampling weight and sparse basis corresponding to each region based on the information type of the picture information contained in each region, so that picture information of different information types correspond to different sampling weights and sparse bases. The weight coefficients in the random Gaussian matrix are adjusted based on the sampling weights of each region to obtain a weighted Gaussian measurement matrix, and the target picture is undersampled based on the weighted Gaussian measurement matrix to obtain an undersampling result corresponding to the target picture. After obtaining the sparse basis corresponding to each region and the undersampling result corresponding to the target picture, the target observation value of the target picture is determined according to the undersampling result and the sparse basis corresponding to each region, and the processing result for the target picture is determined based on the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix, so as to be transmitted. The target observation value takes into account the different requirements of picture information of different information types for compression accuracy and sparsity, significantly improves the fidelity of key data, so that the target picture containing credit data can achieve high compression ratio under the premise of ensuring image quality, and thus improve the transmission efficiency of the target picture under the premise of ensuring image quality. BRIEF DESCRIPTION OF DRAWINGS
[0021] Figure 1 FIG. 1 is a schematic diagram of an application scenario of a picture processing method provided by an example embodiment.
[0022] Figure 2 FIG. 2 is a flowchart of a picture processing method provided by an example embodiment.
[0023] Figure 3 FIG. 3 is a schematic diagram of a target picture being divided into multiple regions provided by an example embodiment.
[0024] Figure 4 FIG. 4 is a flowchart of another picture processing method provided by an example embodiment.
[0025] Figure 5 FIG. 5 is a schematic diagram of a device provided by an example embodiment.
[0026] Figure 6 FIG. 6 is a block diagram of a picture processing device provided by an example embodiment.
[0027] Figure 7 FIG. 7 is a block diagram of another picture processing device provided by an example embodiment.
[0028] Figure 8 FIG. 8 is a schematic diagram of a picture transmission system provided by an example embodiment. DETAILED DESCRIPTION
[0029] In order for those skilled in the art to better understand the technical solutions in the specification, the technical solutions in the specification will be clearly and completely described below in combination with the drawings in the embodiments of the specification. Obviously, the described embodiments are only part of the embodiments of the specification, not all the embodiments. According to the embodiments in the specification, all other embodiments obtained by those of ordinary skill in the art without creative labor should belong to the scope of protection of the specification.
[0030] The institutional information (including but not limited to institutional equipment information, institutional personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the specification are information and data authorized by the institution or fully authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of the country and region, and provide corresponding operation portal for the institution to choose authorization or refusal.
[0031] As described in the background, in the related art, in order to improve the efficiency of transmitting bytecode through the encryption protocol, when transmitting pictures containing credit investigation data, pictures containing credit investigation data are compressed into JPEG or PNG format, and the compression result is converted into bytecode for transmission. However, JPEG or PNG format can cause the picture size to be too large, affecting the real-time transmission performance of the encryption protocol. If the pictures containing credit investigation data are directly compressed by high compression ratio, image distortion is easy to occur under high compression ratio, affecting the accuracy of subsequent OCR (Optical Character Recognition, Optical Character Recognition) recognition.
[0032] Therefore, this specification proposes an image processing method in its embodiments. When compressing a target image containing credit data, the target image is first divided into multiple regions. Based on the information type of the image information contained in each region, the sampling weight and sparse basis corresponding to that region are determined. This allows different information types of image information to have different sampling weights and sparse bases. The sparse base corresponding to each region is used to determine the sparse representation of each region, thereby meeting the different requirements of different information types for accuracy, coherence, periodicity, and other dimensions when performing sparse representation. After determining the sampling weights and sparse bases of different regions based on information type, the weight coefficients in the random Gaussian matrix are adjusted based on the sampling weights of each region to obtain a weighted Gaussian measurement matrix. The target image is then undersampled based on the weighted Gaussian measurement matrix to obtain the undersampled result corresponding to the target image, allowing different information types of regions to correspond to different sampling ratios. After obtaining the sparse basis corresponding to each region and the undersampling result corresponding to the target image, the target observation value of the target image is determined based on the undersampling result and the sparse basis corresponding to each region. Based on the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix, the processing result for the target image is determined for transmission. This allows the target observation value to take into account the different requirements of image information of different information types for compression accuracy and sparsity, significantly improving the fidelity of key data. This enables the target image containing credit data to achieve a high compression rate while ensuring image quality, thereby improving the transmission efficiency of the target image while ensuring image quality.
[0033] Figure 1 This is a schematic diagram illustrating the architecture of an image processing method application scenario provided by an exemplary embodiment. For example... Figure 1 As shown, the method may include a server 11, a network 12, and several electronic devices, such as a PC (Personal Computer) 13, a mobile phone 14, etc.
[0034] Server 11 can be a physical server containing an independent host, or it can be a virtual server hosted in a host cluster. During operation, server 11 can run server-side programs for a certain application to implement the relevant functions of that application. For example, when server 11 runs an image processing program containing credit data, it can act as an image sender.
[0035] PC 13, mobile phone 14 are only part of the types of electronic devices that the institution can use. In fact, the institution can obviously also use electronic devices of the following types: tablet devices, notebook computers, personal digital assistants (PDAs), wearable devices (such as smart glasses, smart watches, etc.), and the like, and one or more embodiments of the present specification do not limit this. During operation, the electronic device can run a client-side program of an application to implement the relevant functions of the application, such as when the electronic device runs the program of the above picture processing method, a picture receiver that serves the program can be implemented, and the client-side application program that serves the program can be started and run on the electronic device. The client-side program can be a native application installed on the electronic device, or the client-side program can be an applet, a fast application, or other similar forms. Of course, when using web technologies such as HTML5 or the like, the relevant functions can be implemented through a page displayed by a browser, and the browser can be a standalone browser application or a browser module embedded in some application.
[0036] As for the network 12 between the electronic devices such as PC 13, mobile phone 14 and the server 11, the communication can be realized by wired or wireless network according to the communication mode supported by the corresponding electronic device, and the present specification does not limit this. For example, PC 13 can support wired and wireless communication at the same time, so wired or wireless network can be used as needed to realize communication, while mobile phone 14 usually only supports wireless communication, so wireless network can be used to realize communication.
[0037] Reference Figure 2 A flowchart of a picture processing method provided by the present specification, the method is applied to a picture sender; the picture processing method comprises the following steps:
[0038] S202, divide the target picture into multiple regions, and determine the sampling weight and the sparse basis corresponding to each region based on the information type of the picture information contained in each region;
[0039] In some embodiments, the target picture can be a picture containing credit data or other pictures to be processed, and the credit data can be credit-related data such as credit bills, credit profiles, and credit query records. Generally, the picture containing credit data can include picture information of various information types, such as time field type, table line type, currency symbol type, institution code type, and amount field type. Considering that the importance of picture information of each information type and the focus of picture details are different, in the implementation of the present specification, the target picture containing credit data is divided into multiple regions according to different information types, and each region contains picture information of one information type. In some embodiments, the target picture can be directly divided into multiple regions according to the number of information types included in the target picture, so that picture information of each information type corresponds to one region. For example, if a target picture includes time field type and table line type, the target picture can be divided into two regions, one of which contains picture information of time field type and the other of which contains picture information of table line type. Figure 3 As shown in FIG. 1, a target picture is divided into multiple regions in the implementation of the present specification. Figure 3 As can be seen, the target picture includes five regions 10, 20, 30, 40, and 50, each of which contains picture information of one information type, wherein 10 represents a region corresponding to institution code type, 20 represents a region corresponding to time field type, 30 represents a region corresponding to amount field type, 40 represents a region corresponding to currency symbol type, and 50 represents a region corresponding to table line type. In some embodiments, the target picture can also be divided into multiple regions according to the smallest closed region corresponding to picture information of each information type in the target picture. At this time, there can be two or more regions in the target picture containing picture information of the same information type, that is, two regions in the target picture are not connected to each other, but both of them contain picture information of the same information type. For example, if a target picture includes time field type and table line type, the target picture can be divided into six regions, two of which contain picture information of time field type and four of which contain picture information of table line type.
[0040] After the target picture containing credit investigation data is divided into multiple regions according to different information types, in order to compress the picture information of different information types in a targeted manner, the sampling weight and the sparse basis corresponding to each region can be determined based on the information type of the picture information contained in each region. In some embodiments, the sampling weight and the sparse basis corresponding to each region can be determined according to a preset relationship between the information type, the sampling weight and the sparse basis, and the information type corresponding to each region. The preset relationship can be set according to experiments or actual needs. In some embodiments, the preset relationship can include the sampling weight and the sparse basis corresponding to each information type, or the preset relationship can include a judgment rule for determining the sampling weight of different information types and a judgment rule for determining the sparse basis of different information types. For example, the sampling weight corresponding to the first information type is greater than the sampling weight corresponding to the second information type, and the third information type is suitable for selecting a sparse basis capable of processing edge details. The sparse basis refers to a linear transformation basis that can make a specific signal set sparse. In some embodiments, the sparse basis can include a Symlets wavelet basis, a Fourier basis, a discrete cosine transformation basis, etc.
[0041] In some embodiments of the present specification, determining the sampling weight corresponding to each region based on the information type of the picture information contained in each region includes:
[0042] Determining the importance degree corresponding to each region based on the information type of the picture information contained in each region, and determining the sampling weight corresponding to each region based on the importance degree; wherein the sampling weight and the importance degree are in a positive proportional relationship.
[0043] In order to accurately determine the sampling weight of the region of different information types, the importance degree of each region can be determined according to the information type corresponding to each region and the preset relationship, and then the sampling weight corresponding to the current region is determined through the importance degree, wherein the sampling weight and the importance degree are in a positive proportional relationship, that is, the higher the importance degree, the greater the corresponding sampling weight. It should be noted that in order to accurately determine the importance degree of different regions, the importance degree corresponding to different information types can be set in the preset relationship in advance. The importance degree can be represented by a level or a value, which is not limited.
[0044] In some embodiments of the present specification, determining the sparse basis corresponding to each region based on the information type of the picture information contained in each region includes:
[0045] In response to the information type corresponding to the region being an information type requiring edge details, determining that the sparse basis corresponding to the region is a Symlets wavelet basis;
[0046] In response to the information type corresponding to the respective region being an information type requiring continuity details, the sparse basis corresponding to the respective region is determined as a discrete cosine transform basis.
[0047] In response to the information type corresponding to the respective region being an information type requiring periodicity details, the sparse basis corresponding to the respective region is determined as a Fourier basis.
[0048] In order to accurately determine the sparse basis corresponding to the region of different information types, the detail requirements corresponding to different information types can be determined respectively, and then the sparse basis of the region of each information type is determined through the detail requirements. For example, when the information type corresponding to the respective region is an information type requiring edge details, the sparse basis corresponding to the respective region can be determined as a Symlets wavelet basis; when the information type corresponding to the respective region is an information type requiring continuity details, the sparse basis corresponding to the respective region can be determined as a discrete cosine transform basis; when the information type corresponding to the respective region is an information type requiring periodicity details, the sparse basis corresponding to the respective region can be determined as a Fourier basis. It should be noted that in some embodiments, the picture information in the target picture can be classified according to actual needs to obtain various information types, and the detail requirements required by each information type are determined, and then the appropriate sparse basis is matched for the picture information of each information type.
[0049] In some embodiments of the present specification, the plurality of information types includes: a time field type, a table line type, a currency symbol type, an organization code type and an amount field type; determining the sparse basis corresponding to the respective region based on the information type of the picture information contained in each region comprises:
[0050] Determining the sparse basis corresponding to the respective region based on the preset relationship between the information type and the sparse basis and the information type of the picture information contained in each region; wherein, the preset relationship includes: the sparse basis corresponding to the time field type and the table line type is a Symlets wavelet basis, the sparse basis corresponding to the amount field type is a discrete cosine transform basis, the sparse basis corresponding to the currency symbol type is a Fourier basis, and the region corresponding to the organization code type adopts full sampling. It should be noted that when a certain region adopts full sampling, all pixel points of the region will be retained, at this time, the region no longer needs to be sparsely represented, that is, the region has no corresponding sparse basis, and the sampling weight corresponding to the region is 100%.
[0051] In S204, the random Gaussian matrix corresponding to the target picture is obtained, the weight coefficients in the random Gaussian matrix are adjusted based on the sampling weights of each region to obtain a weighted Gaussian measurement matrix, and the target picture is undersampled based on the weighted Gaussian measurement matrix to obtain an undersampling result corresponding to the target picture.
[0052] In some embodiments, after obtaining the random Gaussian matrix corresponding to the target picture, the weight coefficients of the random Gaussian matrix are further adjusted according to the sampling weights of the regions determined in advance, to obtain a weighted Gaussian measurement matrix, and the target picture is undersampled based on the weighted Gaussian measurement matrix to obtain an undersampling result corresponding to the target picture. Since the weighted Gaussian measurement matrix takes into account the different importance of different types of picture information, the undersampling result corresponding to the target picture is more in line with the actual situation, rather than simple random sampling, which further improves the restoration quality of important picture information and provides a basis for accurate OCR recognition. In some embodiments, when adjusting the weight coefficients in the random Gaussian matrix based on the sampling weights of the regions, multiplication and / or addition operations can be used, for example, if the sampling weight of a region is increased by 30%, the weight coefficient corresponding to the region can be multiplied by 130% to obtain the adjusted weight coefficient. Alternatively, the weight coefficient corresponding to the region is multiplied by 30% and then added to the weight coefficient corresponding to the region to obtain the adjusted weight coefficient.
[0053] In S206, target observation values of the target picture are determined based on the sparse bases corresponding to the regions and the undersampling result.
[0054] In order to ensure that the picture can be undersampled and reconstructed with high quality, after determining the sparse base corresponding to each region, in some embodiments, the sparse representation of each region can be further determined based on the sparse base corresponding to each region. The sparse representation of each region means that when the picture information of the region is expanded in a certain sparse base, only a small number of non-zero coefficients are included, and the rest of the coefficients are approximately zero. When determining the target observation values of the target picture based on the sparse bases corresponding to the regions and the undersampling result, the sparse representation of each region can be first determined based on the sparse base corresponding to each region, and then after obtaining the sparse representation corresponding to each region and the undersampling result corresponding to the target picture, for each region of the target picture, the sparse representation corresponding to the region and the undersampling result corresponding to the region are multiplied to obtain the observation value corresponding to the region. By combining the observation values corresponding to all regions, the target observation values of the target picture can be determined.
[0055] In S208, a processing result for the target picture is determined based on the target observation values, the sparse bases corresponding to the regions, and the weighted Gaussian measurement matrix, for transmission.
[0056] To help the picture receiver accurately reconstruct the target picture, the processing result for the target picture can be determined based on the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix, so as to perform picture transmission. In some embodiments, the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix can be directly determined as the processing result for the target picture, or the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix are further processed, and then the processing result is determined as the processing result for the target picture, which is not limited. In some embodiments, the picture containing credit data generally needs to be transmitted through an encryption protocol due to the high requirement for secure transmission. In order to cooperate with the encryption protocol, the data to be transmitted (i.e., the processing result of the target picture) needs to be converted into bytecode (byte sequence (byte sequence composed of 8-bit binary)) before transmission. Considering that the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix of the target picture containing credit data are needed when reconstructing the target picture, in the embodiments of the present specification, the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix are first converted into bytecode, and then the bytecode is transmitted, so that the picture receiver reconstructs the image based on the bytecode.
[0057] In some embodiments of the present specification, the processing result for the target picture is determined based on the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix, including:
[0058] The weighted Gaussian measurement matrix and the sparse basis corresponding to each region are embedded into the target observation value based on a preset embedding position and a preset embedding method, to obtain an observation value of embedded information;
[0059] The observation value of embedded information is determined as the processing result for the target picture.
[0060] In order to further improve the transmission efficiency, and prevent the intercepted bytecode from being intercepted, the interceptor can directly reconstruct the image through the intercepted bytecode. In the embodiments of the present specification, when the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix are converted into bytecode, the sparse basis corresponding to each region and the weighted Gaussian measurement matrix are first embedded into the target observation value through a preset embedding position and a preset embedding method to obtain an embedded information observation value, and the embedded information observation value is determined as the processing result of the target image. Then, the embedded information observation value (i.e., the current processing result) is converted into bytecode. In this way, the number of bytecodes that need to be transmitted can be reduced, thereby improving the transmission speed. At the same time, since the sparse basis and the weighted Gaussian measurement matrix are embedded in the target observation value, it is necessary to further obtain the preset embedding position and the preset embedding method in order to restore the sparse basis and the weighted Gaussian measurement matrix from the embedded information observation value. The preset embedding position and the preset embedding method can be agreed upon by the image sender and the image receiver in advance, so that a third party cannot obtain them, so that the third party cannot restore the sparse basis and the weighted Gaussian measurement matrix from the embedded information observation value, thereby protecting the image information of the target image from being leaked after the bytecode is intercepted. It should be noted that the preset embedding position and the preset embedding method can be set as needed, and are not limited. For example, in some embodiments, the preset embedding method can be a bit operation on the values of the preset embedding position of the target observation value using the sparse basis or the weighted Gaussian measurement matrix. In the bit operation, each sparse basis can be encoded so as to correspond to an encoding, and the weighted Gaussian measurement matrix can be converted into a binary sequence, and then the above encoding or binary sequence can be used for bit operation.
[0061] In some embodiments of the present specification, the method further comprises:
[0062] For each region in the plurality of regions, a target preset enhancement strategy matching the region is determined from a plurality of preset enhancement strategies based on a correspondence between the information type and the preset enhancement strategy and the information type corresponding to the region, and the region is preprocessed based on the target preset enhancement strategy.
[0063] To further improve the reconstruction quality of the target picture after transmission, in the embodiments of the present specification, different preset enhancement strategies are formulated for different information types of picture information according to the characteristics of different information types of picture information, so as to improve the picture quality of image reconstruction. It should be noted that the correspondence between the information type and the preset enhancement strategy can be set in advance through experiments or actual needs, and no limitation is made on this. For each region in the target picture, the target preset enhancement strategy matched with the region is determined from the multiple preset enhancement strategies through the above correspondence and the information type corresponding to the region, and then the region is preprocessed according to the target preset enhancement strategy to enhance the picture quality of the region in image reconstruction, thereby providing more protection for the subsequent accurate identification of OCR.
[0064] In some embodiments of the present specification, the plurality of information types include a time field type, a table line type, a currency symbol type, and an institution code type; the correspondence includes that the preset enhancement strategy corresponding to the time field type is to enhance the contrast through contrast limited adaptive histogram equalization (CLAHE) and remove noise through guided filter; the preset enhancement strategy corresponding to the table line type is to detect the table line by using Hough transform, perform binarization processing on the region corresponding to the table line type, and superimpose a histogram of oriented gradients (HOG) feature; the preset enhancement strategy corresponding to the currency symbol type is to separate the currency symbol and the number in the region through character segmentation and perform a morphological dilation operation; and the preset enhancement strategy corresponding to the institution code type is to enhance the contrast through gamma correction.
[0065] It should be noted that the contrast of the region corresponding to the time field type is enhanced through CLAHE, and the noise of the region is removed through guided filter, which can increase the saliency of the picture information of the time field type, and further improve the OCR recognition accuracy of the picture information of the time field type in the reconstructed picture. The table line is detected by using Hough transform, the region corresponding to the table line type is binarized, and a HOG feature is superimposed, which can enhance the frame coherence of the picture information of the table line type. The currency symbol and the number in the region are separated through character segmentation, and a morphological dilation operation is performed, which can ensure the accuracy of the picture information of the currency symbol type in image reconstruction, avoid confusion of data and symbols, and prevent the picture information of the currency symbol type from being distorted due to compression. The contrast is enhanced through gamma correction, which can make the details of the picture information corresponding to the institution code type clearer, so that the subsequent OCR can accurately identify the institution code in the reconstructed picture.
[0066] The picture processing method provided by the embodiments of the present specification applied to a picture sender divides a target picture containing credit investigation data into multiple regions, and determines the sampling weight corresponding to each region and the sparse basis corresponding to each region according to the information type of the picture information contained in each region, so that the picture information of different information types corresponds to different sampling weights and sparse bases. The coefficient representation of each region is determined according to the sparse basis corresponding to each region, and the weight coefficient in the random Gaussian matrix is adjusted based on the sampling weight of each region to obtain a weighted Gaussian measurement matrix. The target picture is undersampled based on the weighted Gaussian measurement matrix to obtain an undersampling result corresponding to the target picture. After obtaining the sparse representation corresponding to each region and the undersampling result corresponding to the target picture, the target observation value of the target picture is determined according to the undersampling result and the sparse representation corresponding to each region, and the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix are converted into bytecode, and the bytecode is transmitted. The target observation value takes into account the different requirements of picture information of different information types for compression accuracy and sparsity, significantly improves the fidelity of key data, so that the target picture containing credit investigation data can achieve high compression ratio under the premise of ensuring image quality, and further improve the transmission efficiency of the target picture under the premise of ensuring image quality.
[0067] Reference Figure 4 Another picture processing method provided by the embodiments of the present specification is provided, and the method is applied to a picture receiver. The picture processing method comprises the following steps:
[0068] S402, obtaining a processing result for a target picture, and determining a target observation value of the target picture, a sparse basis corresponding to each region of the target picture, and a weighted Gaussian matrix corresponding to the target picture based on the processing result; the target observation value is determined according to the result of undersampling the target picture based on the weighted Gaussian measurement matrix and the sparse basis of each region; the weighted Gaussian measurement matrix is obtained by adjusting the weight coefficient in the random Gaussian matrix corresponding to the target picture according to the sampling weight of each region; and the sampling weight of each region and the sparse basis corresponding to each region are determined based on the information type of the picture information contained in each region.
[0069] In the processing of the target picture containing credit data, the picture receiver first acquires the processing result of the target picture sent by the picture sender, and then determines the target observation value of the target picture, the sparse basis corresponding to each region of the target picture, and the weighted Gaussian matrix corresponding to the target picture according to the processing result. In some embodiments, the processing result of the target picture can directly include the target observation value of the target picture, the sparse basis corresponding to each region of the target picture, and the weighted Gaussian matrix corresponding to the target picture. In some embodiments, the processing result of the target picture can be sent to the picture receiver in the format of bytecode, so that after receiving the bytecode, the picture receiver first decodes the bytecode to obtain the processing result including the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian matrix. Before decoding, the picture sender first divides the target picture into multiple regions according to different information types, that is, the target picture is divided into multiple regions, and each region contains picture information of one information type. Then the picture sender determines the sampling weight corresponding to each region according to the information type of the picture information contained in each region, and determines the sparse basis corresponding to each region according to the information type of the picture information contained in each region. After determining the sparse basis and the sampling weight corresponding to each region, the picture sender adjusts the weight coefficient in the random Gaussian matrix through the sampling weight of each region to obtain the weighted Gaussian measurement matrix corresponding to the target picture. Finally, the picture sender determines the target observation value of the target picture according to the sparse basis of each region and the weighted Gaussian measurement matrix. Therefore, the processing result of the target picture received by the picture receiver includes all the information for reconstructing the target picture, and the information for reconstructing the target picture included in the processing result of the target picture is generated according to the embodiments corresponding to steps S202 to S208, so that the picture transmission efficiency can be ensured while the picture quality of the reconstructed target picture is ensured.
[0070] In some embodiments, the picture sender can first transcode the processing result of the target picture into byte code when transmitting the processing result of the target picture to the picture receiver, so that the picture receiver receives the byte code containing the processing result of the target picture transmitted by the picture sender, which is obtained by the picture sender through transcoding the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix. Therefore, the picture receiver can obtain the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian matrix by inverse transcoding the byte code after obtaining the byte code. It should be noted that the transcoding process and the inverse transcoding process correspond to the same type of transcoding rule, and the difference between the two is mainly that one is a forward process and the other is an inverse process. The specific transcoding rule can be selected as needed, and is not limited herein.
[0071] S404, reconstructing the image based on the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix.
[0072] After obtaining the target observation value corresponding to the target picture, the sparse basis corresponding to each region of the target picture, and the weighted Gaussian measurement matrix corresponding to the target picture, the image can be reconstructed based on the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix to obtain the reconstructed picture corresponding to the target picture. It should be noted that the image reconstruction process can refer to the image reconstruction process in related technologies, and the reconstruction process can be completed by using the sparse basis corresponding to each region and the weighted Gaussian measurement matrix provided in the embodiments of the present disclosure. In some embodiments, the perceptual matrix can be obtained by using the sparse basis corresponding to each region and the weighted Gaussian measurement matrix, and then a relationship between the perceptual matrix, the target observation value, and the sparse coefficient can be constructed, and an optimization algorithm can be used to iteratively determine the sparse coefficient in the relationship to determine the optimal solution of the sparse coefficient. The inverse transformation of the sparse basis is performed based on the optimal solution of the sparse coefficient to complete the reconstruction of the target image. The optimization algorithm used can be selected as needed, for example, CoSaMP (Compressive Sampling Matching Pursuit), OMP (Orthogonal Matching Pursuit), GPSR-BB Gradient Projection for Sparse Reconstruction with Barzilai-Borwein step sizes, and the like, and is not limited herein.
[0073] In some embodiments of the present disclosure, the processing result comprises an observation value with embedded information, the observation value with embedded information being obtained by embedding the weighted Gaussian measurement matrix and the sparse basis corresponding to each region into the target observation value based on a preset embedding position and a preset embedding method; determining the target observation value of the target picture, the sparse basis corresponding to each region of the target picture and the weighted Gaussian matrix corresponding to the target picture based on the processing result comprises:
[0074] determining the target observation value of the target picture, the sparse basis corresponding to each region of the target picture and the weighted Gaussian matrix corresponding to the target picture from the observation value with embedded information based on the preset embedding position and the preset embedding method.
[0075] In order to ensure that the picture information of the target picture is not leaked after the bytecode is intercepted, and further improve the transmission efficiency of the processing result of the target picture, in some embodiments of the present disclosure, the processing result of the target picture can be an observation value with embedded information, which is obtained by embedding the sparse basis corresponding to each region and the weighted Gaussian measurement matrix into the target observation value. Therefore, after obtaining the observation value with embedded information, the target observation value, the sparse representation corresponding to each region and the weighted Gaussian matrix are further obtained from the observation value with embedded information according to the preset embedding position and the preset embedding method. The preset embedding position and the preset embedding method can be agreed by the picture sender and the picture receiver in advance. Even if a third party obtains the observation value with embedded information, the target observation value, the sparse representation corresponding to each region and the weighted Gaussian matrix cannot be directly obtained without knowing the preset embedding position and the preset embedding method, which can improve the confidentiality of the target picture.
[0076] In some embodiments of the present disclosure, the sampling weight of each region is in a positive proportional relationship with the importance degree of the information type corresponding to each region.
[0077] In some embodiments of the present disclosure, the information type comprises a time field type, a table line type, a currency symbol type, an institution code type and an amount field type; the sparse basis corresponding to the time field type and the table line type is a Symlets wavelet basis, the sparse basis corresponding to the amount field type is a discrete cosine transform basis, the sparse basis corresponding to the currency symbol type is a Fourier basis, and the region corresponding to the institution code type adopts full sampling.
[0078] In some embodiments of the present disclosure, the image reconstruction based on the target observation value, the sparse basis corresponding to each region and the weighted Gaussian measurement matrix comprises:
[0079] obtaining information types corresponding to the regions;
[0080] performing image reconstruction based on the information types corresponding to the regions, the target observation value, the sparse bases corresponding to the regions, and the weighted Gaussian measurement matrix.
[0081] To further improve the reconstruction quality of the target picture, when performing image reconstruction, the information types corresponding to the regions are obtained first. In some embodiments, the information types corresponding to the regions can be obtained directly by the picture sender, or the picture sender and the picture receiver can agree on a preset relationship between the information types, the sampling weights, and the sparse bases, and then the picture receiver can inversely deduce the information types corresponding to the regions according to the agreed preset relationship and the sparse bases corresponding to the regions. After obtaining the information types corresponding to the regions, image reconstruction can be performed according to the information types corresponding to the regions, the target observation value, the sparse bases corresponding to the regions, and the weighted Gaussian measurement matrix, so that when performing image reconstruction, different information types corresponding to the regions can be referred to for targeted reconstruction reinforcement, further improving the quality of the reconstructed picture.
[0082] In some embodiments of the present specification, performing image reconstruction based on the information types corresponding to the regions, the target observation value, the sparse bases corresponding to the regions, and the weighted Gaussian measurement matrix comprises:
[0083] In response to the information type corresponding to the current region being a time field type, a preset time format template is obtained; the current region is any one of the regions;
[0084] A time format constraint condition is generated based on the preset time format template;
[0085] Image reconstruction is performed based on the time format constraint condition, the target observation value, the sparse base corresponding to the current region, and the weighted Gaussian measurement matrix to obtain an initial reconstructed picture corresponding to the current region;
[0086] Time information in the initial reconstructed picture is recognized by OCR, and it is determined whether a deviation between the time information and expected time information is greater than a preset deviation;
[0087] In response to determining that the deviation between the time information and the expected time information is greater than the preset deviation, a target part in the initial reconstructed picture that has a deviation is determined;
[0088] The target part is iteratively optimized based on the target observation value, the sparse base corresponding to the current region, and the weighted Gaussian measurement matrix.
[0089] Considering that time information in images containing credit data is relatively important, errors in time information during image reconstruction can affect subsequent OCR recognition and credit information judgment. Therefore, in the embodiments of this specification, when reconstructing images of regions corresponding to time field types, time format constraints are generated based on a preset time format template. These constraints ensure that the time information maintains a standardized format during image reconstruction, thereby improving the accuracy of time information reconstruction. In some embodiments, the preset time format template can be set according to the actual situation of the credit data. For example, a preset time format template can be YYYY / MM / DD or XXXX year XX month XX day. After obtaining the preset time format template, the corresponding time format constraints can ensure that the time information in the reconstructed image meets the preset time format. To further enhance the reliability of time information, after image reconstruction using the time format constraints, the target observation, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix to obtain the initial reconstructed image of the current region, OCR can be used to identify the time information in the initial reconstructed image and determine whether the deviation between the time information and the expected time information is greater than a preset deviation. It should be noted that the expected time information can be an estimated time derived from known time information. For example, when the image receiver receives bytecode, there is a receiving moment. Generally, the time information in the target image will be earlier than this receiving moment. Moreover, considering the timeliness requirements for credit data in some scenarios, the time difference between the time information in the target image and the receiving moment will not be too large. Therefore, the accuracy of the reconstruction thickness time information can be judged based on the magnitude of the deviation between the receiving moment and the time information in the initial reconstructed image; that is, the expected time can be determined by the receiving moment. In some embodiments, to more accurately determine the expected time information, in addition to the receiving moment, the expected time can also be determined by combining the context information adjacent to the time information in the initial reconstructed image; that is, the expected time can be determined by the receiving moment and / or the context information. After determining the deviation between the time information and the expected time information, it is further determined whether the deviation is greater than a preset deviation. If it is greater, the target part of the initial reconstructed image in which the deviation occurs is determined, and the target part is iteratively optimized based on the target observation value, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix, thereby realizing the calibration of the time information corresponding to the target part.
[0090] In some embodiments of this specification, image reconstruction is performed based on the information type corresponding to each region, the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix, including:
[0091] In response to the information type corresponding to the current region being a table line type, performing image reconstruction on the target observation value, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix by using a CoSaMP algorithm to obtain an initial reconstruction picture corresponding to the current region; the current region is any one of the regions;
[0092] Obtaining a Histogram of Oriented Gradients (HOG) feature of the current region;
[0093] Reconstructing a table border in the initial reconstruction picture based on the HOG feature.
[0094] To further improve the clarity and quality of the table in the reconstruction picture, the CoSaMP algorithm is used for image reconstruction when reconstructing the region corresponding to the table line type. It should be noted that the main requirement of table information is complete structure and clear content, and the CoSaMP has the advantages of adapting to structured sparsity, accurate detail recovery, and strong anti-noise, thereby having good effect in the reconstruction of table information. At the same time, in order to further reduce the error of column alignment in the table information, after obtaining the initial reconstruction picture corresponding to the current region by using the CoSaMP algorithm, the table border in the initial reconstruction picture is reconstructed according to the HOG feature of the current region.
[0095] In some embodiments of the present specification, performing image reconstruction based on the information type corresponding to each region, the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix includes:
[0096] In response to the information type corresponding to the current region being an amount field type, performing image reconstruction on the target observation value, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix to obtain an initial reconstruction picture corresponding to the current region; the current region is any one of the regions;
[0097] Determining whether a decimal point exists in the initial reconstruction picture;
[0098] In response to the existence of the decimal point in the initial reconstruction picture, enhancing the brightness of the decimal point and suppressing the noise around the decimal point.
[0099] To improve the accuracy of the amount of information in the reconstructed picture, and avoid the amount of recognition error caused by decimal point, in the embodiments of the present specification, after obtaining the initial reconstructed picture corresponding to the current region, it is first determined whether there is a decimal point in the initial reconstructed picture. In some embodiments, whether there is a decimal point in the initial reconstructed picture can be determined by strengthening the OCR of the decimal point, or a decimal point template is set in advance, and then it is determined whether there is a minimum closed region that coincides with the decimal point template in the initial reconstructed picture. If there is, the minimum closed region that coincides with the decimal point template is determined as the decimal point. After determining that there is a decimal point in the initial reconstructed picture, the brightness of the decimal point is enhanced, and the noise around the decimal point is suppressed, thereby improving the saliency of the decimal point and facilitating subsequent OCR recognition.
[0100] In some embodiments of the present specification, the image reconstruction is performed based on the information type corresponding to each region, the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix, which comprises:
[0101] In response to the information type corresponding to the current region being an organization code type, the image reconstruction is performed based on the target observation value, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix to obtain an initial reconstructed picture corresponding to the current region; the current region is any one of the regions;
[0102] The Hamming distance between the organization code in the initial reconstructed picture and a reference code is determined.
[0103] In response to the Hamming distance being greater than a preset distance, an organization code error prompt information is issued, and the initial reconstructed picture is iteratively optimized based on the target observation value, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix.
[0104] To further improve the accuracy of the reconstructed organization code, after obtaining the initial reconstructed picture corresponding to the current region, it is further determined whether the reconstructed organization code is correct according to the Hamming distance between the organization code in the initial reconstructed picture and a reference code. Generally, when the Hamming distance between the organization code and the reference code is greater than a preset distance, it means that the organization code is incorrect. Therefore, an organization code error prompt information is issued, and the initial reconstructed picture is iteratively optimized based on the target observation value, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix. It should be noted that the reference code can be a preset code set according to the standard organization code format, or an organization code obtained from a reconstructed picture that can guarantee the quality of the picture, which is not limited.
[0105] Figure 5This is a schematic structural diagram of a device provided in an exemplary embodiment. For example... Figure 5 As shown, device 500 mainly consists of a communication interface 502, a mechanism interface 504, a processor 506, and a data storage 508. These components are interconnected and communicate with each other via a method bus, network, or other connection mechanism 510. The communication interface 502 enables device 500 to communicate with other devices, access networks, and transmission networks via analog or digital modulation. For example, the communication interface 502 may include a chipset and antenna for wireless communication with a radio access network or access point. Furthermore, the communication interface 502 can be a wired interface such as Ethernet, Token Ring, or a USB port, or a wireless interface such as Wi-Fi, Bluetooth, Global Positioning System (GPS), or a wide-area wireless interface (e.g., WiMAX or LTE). Of course, the communication interface 502 can also support other forms of physical layer interfaces and standard or proprietary communication protocols. The communication interface 502 may also include multiple physical communication interfaces, such as Wi-Fi, Bluetooth, and wide-area wireless interfaces.
[0106] Mechanism interface 504 includes receiving mechanism input and providing output to the mechanism. Therefore, mechanism interface 504 may include input components such as a keypad, keyboard, touch-sensitive or presence-sensitive panel, computer mouse, trackball, joystick, microphone, still camera, and video camera, and output components such as a display screen (which may be combined with a touch-sensitive panel), CRT, LCD, LED, display using DLP technology, printer, and other similar devices known or developed in the future. Mechanism interface 504 may also generate auditory output via speakers, speaker jacks, audio output ports, audio output devices, headphones, and other similar devices known or developed in the future. In some embodiments, mechanism interface 504 may include software, circuitry, or other forms of logic capable of transmitting and receiving data from external mechanism input / output devices. Additionally or alternatively, device 500 may support remote access from other devices via communication interface 502 or another physical interface (not shown). Mechanism interface 504 may be configured to receive mechanism input, the position and movement of which may be indicated by an indicator or cursor described herein. Mechanism interface 504 may also be configured as a display device for rendering or displaying text fragments.
[0107] Processor 506 may contain one or more general-purpose processors and / or special-purpose processors.
[0108] Data storage 508 may include one or more volatile and / or non-volatile storage components and may be integrated wholly or partially with processor 506. Data storage 508 may include removable and non-removable components.
[0109] The processor 506 can execute program instructions stored in the data storage 508 (e.g., compiled or interpreted program logic and / or machine code) to implement various functionality described herein. The data storage 508 can include a non-transitory computer-readable medium having stored thereon program instructions that, when executed by the device 500, enable the device 500 to perform any of the methods, processes, or functions disclosed in the specification and / or drawings. Execution of the program instructions 518 by the processor 506 can cause the processor 506 to utilize the data 512.
[0110] For example, the program instructions 518 can include operating system methods 522 (e.g., operating system kernels, device drivers, and / or other modules) installed on the device 500 as well as one or more application programs 520 (e.g., a browser, a social application, or a gaming application). Similarly, the data 512 can include operating system data 516 and application data 514. The operating system data 516 is primarily accessible to the operating system methods 522, while the application data 514 is primarily accessible to the one or more application programs 520. The application data 514 can be located in file methods that are visible or hidden to the mechanisms of the device 500.
[0111] The application programs 520 can communicate with the operating system methods 522 through one or more application programming interfaces (APIs). These APIs facilitate the application programs 520 to read and / or write the application data 514, transmit or receive information via the communication interface 502, receive or display information on the mechanism interface 504, and so on.
[0112] In some terminology, the application programs 520 can be referred to simply as “apps.” Furthermore, the application programs 520 can be downloaded to the device 500 through one or more online application stores or application markets. However, the application programs can also be installed on the device 500 through other means, such as through a web browser or a physical interface (e.g., a USB port) on the device 500.
[0113] Reference is made to Figure 6 , the picture processing apparatus can be applied to a device as shown in Figure 5 to implement the technical solutions of the present specification. In some embodiments, the device as shown in Figure 5 can serve as a picture sender, i.e., the picture processing apparatus is applied to the picture sender; the picture processing apparatus can include:
[0114] The region division module 602 divides a target picture containing credit investigation data into multiple regions, determines a sampling weight corresponding to each region and a sparse basis based on an information type of picture information contained in each region;
[0115] The sampling module 604 acquires a random Gaussian matrix corresponding to the target picture, adjusts weight coefficients in the random Gaussian matrix based on the sampling weight of each region to obtain a weighted Gaussian measurement matrix, and performs under-sampling on the target picture based on the weighted Gaussian measurement matrix to obtain an under-sampling result corresponding to the target picture.
[0116] The determining module 606 determines a target observation value of the target picture based on the under-sampling result and the sparse basis corresponding to each region.
[0117] The transmission module 608 determines a processing result for the target picture based on the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix, for transmission.
[0118] In some embodiments of the present specification, the transmission module is specifically configured to:
[0119] embed the weighted Gaussian measurement matrix and the sparse basis corresponding to each region into the target observation value based on a preset embedding position and a preset embedding method to obtain an observation value of embedded information.
[0120] convert the observation value of embedded information into byte code.
[0121] In some embodiments of the present specification, the corresponding region division module is specifically configured to:
[0122] determine the importance degree corresponding to each region based on the information type of the picture information contained in each region, and determine the sampling weight corresponding to each region based on the importance degree; wherein the sampling weight is in a positive proportional relationship with the importance degree.
[0123] In some embodiments of the present specification, the corresponding region division module is specifically configured to:
[0124] in response to the information type corresponding to the corresponding region being an information type requiring edge details, determine that the sparse basis corresponding to the corresponding region is a Symlets wavelet basis.
[0125] in response to the information type corresponding to the corresponding region being an information type requiring continuity details, determine that the sparse basis corresponding to the corresponding region is a discrete cosine transform basis.
[0126] in response to the information type corresponding to the corresponding region being an information type requiring periodicity details, determine that the sparse basis corresponding to the corresponding region is a Fourier basis.
[0127] In some embodiments of the present disclosure, the plurality of information types include: a time field type, a table line type, a currency symbol type, an institution code type, and an amount field type; the time field type and the table line type correspond to a Symlets wavelet basis, the amount field type corresponds to a discrete cosine transform basis, the currency symbol type corresponds to a Fourier basis, and the institution code type corresponds to full sampling.
[0128] In some embodiments of the present disclosure, the apparatus further includes an enhancement module configured to:
[0129] For each of the plurality of regions, a target preset enhancement strategy that matches the region is determined based on a correspondence between the information type and a preset enhancement strategy and the information type corresponding to the region, and the region is preprocessed based on the target preset enhancement strategy.
[0130] In some embodiments of the present disclosure, the plurality of information types include: a time field type, a table line type, a currency symbol type, and an institution code type; the correspondence includes: the preset enhancement strategy corresponding to the time field type is to enhance contrast through contrast limited adaptive histogram equalization and remove noise through guided filtering; the preset enhancement strategy corresponding to the table line type is to detect table lines using a Hough transform, perform binarization processing on the region corresponding to the table line type, and superimpose a histogram of oriented gradients feature; the preset enhancement strategy corresponding to the currency symbol type is to separate currency symbols and numbers in the region through character segmentation and perform a morphological dilation operation; and the preset enhancement strategy corresponding to the institution code type is to enhance contrast through gamma correction.
[0131] For reference Figure 7 , the picture processing apparatus can be applied to a device as shown in Figure 5 to implement the technical solutions of the present disclosure. In some embodiments, the device as shown in Figure 5 can act as a picture sender, i.e., the picture processing apparatus is applied to a picture receiver; the picture processing apparatus can include:
[0132] The receiving module 702 acquires a processing result for a target picture, and determines a target observation value of the target picture, a sparse basis corresponding to each region of the target picture, and a weighted Gaussian matrix corresponding to the target picture based on the processing result; the target observation value is determined according to a result of undersampling the target picture according to the weighted Gaussian measurement matrix and the sparse basis of each region; the weighted Gaussian measurement matrix is obtained by adjusting a weight coefficient in a random Gaussian matrix corresponding to the target picture according to a sampling weight of each region, and the sampling weight of each region and the sparse basis corresponding to each region are determined based on an information type of picture information contained in each region;
[0133] The reconstructing module 704 performs image reconstruction based on the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix.
[0134] In some embodiments of the present disclosure, the processing result includes an embedded information observation value obtained by embedding the weighted Gaussian measurement matrix and the sparse basis corresponding to each region into the target observation value based on a preset embedding position and a preset embedding method; and the receiving module is specifically configured to:
[0135] obtain the target observation value, the sparse representation corresponding to each region, and the weighted Gaussian matrix from the embedded information observation value based on the preset embedding position and the preset embedding method, respectively.
[0136] In some embodiments of the present disclosure, the sampling weight of each region is in a positive proportional relationship with the importance degree of the information type corresponding to each region.
[0137] In some embodiments of the present disclosure, the information type includes a time field type, a table line type, a currency symbol type, an institution code type, and an amount field type; the sparse basis corresponding to the time field type and the table line type is a Symlets wavelet basis, the sparse basis corresponding to the amount field type is a discrete cosine transform basis, the sparse basis corresponding to the currency symbol type is a Fourier basis, and the region corresponding to the institution code type is fully sampled.
[0138] In some embodiments of the present disclosure, the reconstructing module includes:
[0139] An acquiring unit acquires an information type corresponding to each region;
[0140] An image reconstructing unit performs image reconstruction based on the information type corresponding to each region, the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix.
[0141] In some embodiments of the present disclosure, the image reconstructing unit is specifically configured to:
[0142] in response to the information type corresponding to the current region being a time field type, obtaining a preset time format template; the current region is any one of the regions;
[0143] generating a time format constraint condition based on the preset time format template;
[0144] performing image reconstruction based on the time format constraint condition, the target observation value, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix to obtain an initial reconstructed picture corresponding to the current region;
[0145] recognizing time information in the initial reconstructed picture through OCR, and determining whether a deviation between the time information and expected time information is greater than a preset deviation;
[0146] in response to determining that the deviation between the time information and the expected time information is greater than the preset deviation, determining a target part in the initial reconstructed picture where the deviation occurs;
[0147] performing iterative optimization on the target part based on the target observation value, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix.
[0148] In some embodiments of the present specification, the image reconstruction unit is specifically configured to:
[0149] in response to the information type corresponding to the current region being a table line type, performing image reconstruction on the target observation value, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix through a CoSaMP algorithm to obtain an initial reconstructed picture corresponding to the current region; the current region is any one of the regions;
[0150] obtaining a histogram of oriented gradients feature of the current region;
[0151] reconstructing a table frame in the initial reconstructed picture based on the histogram of oriented gradients feature.
[0152] In some embodiments of the present specification, the image reconstruction unit is specifically configured to:
[0153] in response to the information type corresponding to the current region being an amount field type, performing image reconstruction based on the target observation value, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix to obtain an initial reconstructed picture corresponding to the current region; the current region is any one of the regions;
[0154] determining whether a decimal point exists in the initial reconstructed picture;
[0155] In response to the existence of the decimal point in the initial reconstructed picture, the brightness of the decimal point is enhanced, and the noise around the decimal point is suppressed.
[0156] In some embodiments of the present specification, the image reconstruction unit is specifically used for:
[0157] In response to the information type corresponding to the current region being an institution code type, performing image reconstruction based on the target observation value, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix to obtain an initial reconstructed picture corresponding to the current region; the current region is any one of the regions;
[0158] Determining the Hamming distance between the institution code in the initial reconstructed picture and a reference code;
[0159] In response to the Hamming distance being greater than a preset distance, issuing an institution code error prompt information, and performing iterative optimization on the initial reconstructed picture based on the target observation value, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix.
[0160] For the convenience of description, the above device is described as various modules or units in function. Of course, when implementing one or more of the present specification, the functions of each module or unit can be implemented in the same or more software and / or hardware, or the modules implementing the same function can be combined or implemented by a combination of sub-modules or sub-units. The above described device embodiments are only illustrative, for example, the division of the units is only a logical function division, and actual implementation can have another division method, for example, a plurality of units or components can be combined or integrated into another method, or some features can be ignored or not executed.
[0161] According to the same concept as the above method, with reference to Figure 8 The present specification also provides a picture transmission system 800, comprising: a picture sender 802 and a picture receiver 804; the picture sender 802 is used for executing the steps of the picture processing method corresponding to the above embodiments, and the picture receiver 804 is used for executing the steps of the picture processing method corresponding to the above embodiments. Figure 2 The picture processing method corresponding to the above embodiments, and the picture receiver 804 is used for executing the steps of the picture processing method corresponding to the above embodiments. Figure 4 The picture processing method corresponding to the above embodiments, and the picture receiver 804 is used for executing the steps of the picture processing method corresponding to the above embodiments.
[0162] According to the same concept as the above method, the present specification also provides an electronic device, comprising: a processor; a memory for storing processor executable instructions; wherein the processor runs the executable instructions to implement the steps of the picture processing method according to any one of the above embodiments.
[0163] According to the same idea as the above method, the specification also provides a computer readable storage medium, which stores computer instructions, and the instructions are executed by a processor to implement the steps of the picture processing method according to any one of the above embodiments.
[0164] According to the same idea as the above method, the specification also provides a computer program product, which includes computer program / instructions, and the instructions are executed by a processor to implement the steps of the picture processing method according to any one of the above embodiments.
[0165] Those skilled in the art can understand that:
[0166] In the specification, the term "comprise", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, product or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such a process, method, product or device. Without more limitations, it does not exclude the presence of other same or equivalent elements in the process, method, product or device including the elements.
[0167] In the specification, "one", "a" and "the" do not necessarily mean singular, but also include plural.
[0168] In the specification, the first, second, etc. ordinal numbers do not necessarily represent the order, and are often used for the purpose of distinguishing objects. For example, the first server and the second server usually refer to two servers. In order to distinguish the two servers, they are expressed as the first server and the second server. Of course, sometimes the two servers can be the same server.
[0169] In the specification, unless specifically stated, "receiving and sending of data" is not necessarily direct receiving and sending, but can be indirect receiving and sending. For example, A receives data sent by B, which can be understood as A directly receiving data sent by B, or A indirectly receiving data sent by B through C and other subjects. Similarly, B sends data to A, which can be understood as B directly sending data to A, or B indirectly sending data to A through C and other subjects. Here, C can be one subject, or two or more subjects.
[0170] In this specification, unless expressly stated otherwise, the connection relationship between structures can be a direct connection relationship or an indirect connection relationship. For example, when describing "A is connected with B", unless it is expressly stated that A is directly connected with B, it should be understood that A can be directly connected with B or indirectly connected with B; for another example, when describing "A is on B", unless it is expressly stated that A is directly on B (AB is adjacent and A is on B), it should be understood that A can be directly on B or A can be indirectly on B (there are other elements between AB and A is on B). By analogy.
[0171] The present specification uses specific terms to describe the embodiments of the present specification. As "one embodiment", "an embodiment", and / or "some embodiments" means a certain feature, structure, or characteristic in relation to at least one embodiment of the present specification. Therefore, it should be emphasized and noted that the "an embodiment" or "one embodiment" or "one alternative embodiment" mentioned in different positions in the present specification does not necessarily refer to the same embodiment. In addition, the skilled in the art can combine and combine the different embodiments or examples described in the present specification and the features of the different embodiments or examples without contradiction.
[0172] Although one or more embodiments of the present specification provide method steps as described in the embodiments or flowcharts, it can be understood that the order of steps listed in the embodiments or flowcharts is only one of the many execution orders, and does not represent the only execution order. Therefore, when the claims involve method steps, the adjustment of the order of the steps or the parallelism between the steps is also within the scope of protection of the claims.
Claims
1. A picture processing method, the method being applied to a picture sender; the method comprising: dividing a target picture into a plurality of regions, and determining a sampling weight corresponding to each region and a sparse basis corresponding to each region based on an information type of picture information contained in each region; obtaining a random Gaussian matrix corresponding to the target picture, adjusting weight coefficients in the random Gaussian matrix based on the sampling weight of each region to obtain a weighted Gaussian measurement matrix, and performing under-sampling on the target picture based on the weighted Gaussian measurement matrix to obtain an under-sampling result corresponding to the target picture; determining a target observation value of the target picture based on the under-sampling result and the sparse basis corresponding to each region; determining a processing result for the target picture based on the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix, for transmission.
2. The method of claim 1, wherein determining the processing result for the target picture based on the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix comprises: embedding the weighted Gaussian measurement matrix and the sparse basis corresponding to each region into the target observation value based on a preset embedding position and a preset embedding method to obtain an observation value of embedded information; and determining the observation value of embedded information as the processing result for the target picture.
3. The method of claim 1, wherein determining the sampling weight corresponding to each region based on the information type of picture information contained in each region comprises: determining an importance degree corresponding to each region based on the information type of picture information contained in each region, and determining the sampling weight corresponding to each region based on the importance degree; wherein the sampling weight is in a positive proportional relationship with the importance degree.
4. The method of claim 1, wherein determining the sparse basis corresponding to each region based on the information type of picture information contained in each region comprises: in response to the information type corresponding to each region being an information type requiring edge details, determining the sparse basis corresponding to each region to be a Symlets wavelet basis; in response to the information type corresponding to each region being an information type requiring continuity details, determining the sparse basis corresponding to each region to be a discrete cosine transform basis; and in response to the information type corresponding to each region being an information type requiring periodicity details, determining the sparse basis corresponding to each region to be a Fourier basis. a time field type, a table line type, a currency symbol type, an organization code type, and an amount field type; determining the sparse basis corresponding to each region based on the information type of picture information contained in each region comprises: determining the sparse basis corresponding to each region based on a preset relationship between the information type and the sparse basis and the information type of picture information contained in each region; the preset relationship comprising: the sparse basis corresponding to the time field type and the table line type being a Symlets wavelet basis, the sparse basis corresponding to the amount field type being a discrete cosine transform basis, the sparse basis corresponding to the currency symbol type being a Fourier basis, and the region corresponding to the organization code type being fully sampled.
6. The method of claim 1, further comprising: 5. The method of claim 4, the information type comprising: For each of the plurality of regions, a target preset enhancement strategy matching the region is determined from a plurality of preset enhancement strategies based on a correspondence between the information type and the preset enhancement strategy and the information type corresponding to the region, and the region is preprocessed based on the target preset enhancement strategy.
7. The method of claim 6, the information type comprising: The time field type, the table line type, the currency symbol type, and the institution code type; The preset enhancement strategy corresponding to the time field type is to enhance contrast through contrast-limited adaptive histogram equalization and remove noise through guided filtering; The preset enhancement strategy corresponding to the table line type is to detect table lines using Hough transform, perform binarization processing on the region corresponding to the table line type, and superimpose a histogram of oriented gradients feature; the preset enhancement strategy corresponding to the currency symbol type is to separate the currency symbol and the number in the region through character segmentation and perform a morphological dilation operation; and the preset enhancement strategy corresponding to the institution code type is to enhance contrast through gamma correction.
8. A picture processing method, the method being applied to a picture receiver; the method comprising: obtaining a processing result for a target picture, and determining a target observation value of the target picture, a sparse basis corresponding to each region of the target picture, and a weighted Gaussian measurement matrix corresponding to the target picture based on the processing result; the target observation value being determined according to a result of undersampling the target picture according to the weighted Gaussian measurement matrix and the sparse basis of each region, the weighted Gaussian measurement matrix being obtained by adjusting weight coefficients in a random Gaussian matrix corresponding to the target picture according to sampling weights of each region, and the sampling weights of each region and the sparse basis corresponding to each region being determined based on an information type of picture information contained in each region; performing image reconstruction based on the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix.
9. The method of claim 8, wherein the processing result comprises an embedded information observation value obtained by embedding the weighted Gaussian measurement matrix and the sparse basis corresponding to each region into the target observation value based on a preset embedding position and a preset embedding method; and determining the target observation value of the target picture, the sparse basis corresponding to each region of the target picture, and the weighted Gaussian measurement matrix corresponding to the target picture based on the processing result comprises: determining the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix from the embedded information observation value based on the preset embedding position and the preset embedding method.
10. The method of claim 8, wherein the sampling weights of each region are in a positive proportional relationship with the importance degree of the information type corresponding to each region.
11. The method of claim 8, the information type comprising: The time field type, the table line type, the currency symbol type, the organization code type and the amount field type; the sparse base corresponding to the time field type and the table line type is a Symlets wavelet base, the sparse base corresponding to the amount field type is a discrete cosine transform base, the sparse base corresponding to the currency symbol type is a Fourier base, and the region corresponding to the organization code type adopts full sampling.
12. The method of claim 8, wherein the image reconstruction is based on the target observation value, the sparse base corresponding to each region and the weighted Gaussian measurement matrix, and the image reconstruction comprises: obtaining an information type corresponding to each region; and reconstructing the image based on the information type corresponding to each region, the target observation value, the sparse base corresponding to each region and the weighted Gaussian measurement matrix.
13. The method of claim 12, wherein the image reconstruction based on the information type corresponding to each region, the target observation value, the sparse base corresponding to each region and the weighted Gaussian measurement matrix comprises: in response to the information type corresponding to a current region being a time field type, obtaining a preset time format template; the current region being any one of the regions; generating a time format constraint condition based on the preset time format template; reconstructing the image based on the time format constraint condition, the target observation value, the sparse base corresponding to the current region and the weighted Gaussian measurement matrix to obtain an initial reconstructed picture corresponding to the current region; identifying time information in the initial reconstructed picture through OCR and determining whether a deviation between the time information and expected time information is greater than a preset deviation; in response to determining that the deviation between the time information and the expected time information is greater than the preset deviation, determining a target part in the initial reconstructed picture where the deviation occurs; and iteratively optimizing the target part based on the target observation value, the sparse base corresponding to the current region and the weighted Gaussian measurement matrix.
14. The method of claim 12, wherein the image reconstruction based on the information type corresponding to each region, the target observation value, the sparse base corresponding to each region and the weighted Gaussian measurement matrix comprises: in response to the information type corresponding to a current region being a table line type, reconstructing the image through a CoSaMP algorithm based on the target observation value, the sparse base corresponding to the current region and the weighted Gaussian measurement matrix to obtain an initial reconstructed picture corresponding to the current region; the current region being any one of the regions; obtaining a histogram of oriented gradients feature of the current region; and reconstructing a table border in the initial reconstructed picture based on the histogram of oriented gradients feature.
15. The method of claim 12, wherein the image reconstruction based on the information type corresponding to each region, the target observation value, the sparse base corresponding to each region and the weighted Gaussian measurement matrix comprises: In response to the information type corresponding to the current region being an amount field type, performing image reconstruction based on the target observation value, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix to obtain an initial reconstructed picture corresponding to the current region; the current region is any one of the regions; Determining whether a decimal point exists in the initial reconstructed picture; In response to the decimal point existing in the initial reconstructed picture, enhancing the brightness of the decimal point and suppressing noise around the decimal point.
16. The method of claim 12, wherein performing image reconstruction based on the information type corresponding to each region, the target observation value, the sparse basis corresponding to each region, and the weighted Gaussian measurement matrix comprises: In response to the information type corresponding to the current region being an institution code type, performing image reconstruction based on the target observation value, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix to obtain an initial reconstructed picture corresponding to the current region; the current region is any one of the regions; Determining a Hamming distance between the institution code in the initial reconstructed picture and a reference code; In response to the Hamming distance being greater than a preset distance, issuing an institution code error prompt message, and performing iterative optimization on the initial reconstructed picture based on the target observation value, the sparse basis corresponding to the current region, and the weighted Gaussian measurement matrix.
17. An electronic device, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements the method of any one of claims 1-16 by executing the executable instructions.
18. A computer-readable storage medium having stored thereon computer instructions that, when executed by a processor, implement the steps of the method of any one of claims 1-16.
19. A computer program product, comprising: computer program / instructions that, when executed by a processor, implement the method of any one of claims 1-16.
Citation Information
Patent Citations
Structure sparse tracking method based on significance weighting
CN107392938A
Image compression method and device, equipment and storage medium
CN118264818A