Image compression and decompression processing method and system

By dividing the X-ray detection image into grid areas and performing compression processing, the problem of low image transmission efficiency is solved, efficient image data transmission and display is achieved, and it is suitable for the real-time transmission requirements of X-ray detection images.

CN112367522BActive Publication Date: 2024-09-06BOE TECHNOLOGY GROUP CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202011189726.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-30
Publication Date
2024-09-06
Estimated Expiration
2040-10-30

AI Technical Summary

Technical Problem

X-ray detection images are inefficient in real-time transmission and display, and are limited by data transmission methods and hardware conditions, resulting in poor transmission and display effects.

Method used

The image compression processing method is used to divide the image to be compressed into multiple grid areas, and perform gray value compression processing respectively to obtain the data matrix and direction matrix, which are stored and transmitted respectively. The receiving end performs analysis and restoration processing to obtain Original image.

Benefits of technology

It improves the real-time transmission efficiency of image data, reduces the transmission complexity, and is suitable for the real-time transmission requirements of 16-bit bitmaps, especially in the application of X-ray detection images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112367522B
    Figure CN112367522B
Patent Text Reader

Abstract

The present application discloses an image compression and decompression processing method and system, which obtains an image to be compressed; divides the image into multiple grid areas according to a preset rule, and assigns a corresponding grid position to each grid area; compresses the grayscale values ​​contained in each grid area according to the position of the grid area to obtain a data matrix and a direction matrix corresponding to each grid area, compresses and stores the data matrix and the direction matrix into a data matrix array and a direction matrix array respectively; and transmits the direction matrix array and the data matrix array to a display terminal. The embodiment of the present application improves the efficiency of real-time transmission of image data by compressing the grayscale values ​​corresponding to the grid area, and the complexity is relatively low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of image data processing, and in particular to an image compression and decompression processing method and system. Background Art

[0002] X-ray digital imaging technology can perform nondestructive testing of quality defects such as structural medium discontinuity, structural morphology, and medium physical density of production workpieces online and in real time. Therefore, it has broad development prospects in the field of rapid nondestructive testing.

[0003] X-ray digital imaging technology is widely used in nondestructive testing, nondestructive evaluation and inverse analysis of products and systems in the fields of aviation, aerospace, weapons, nuclear energy, automobiles, etc. It plays an extremely important role in engineering quality supervision and product quality assurance, and is gradually becoming a basic technology for the development of modern national defense science and technology and many high-tech industries.

[0004] X-ray detection images are subject to the influence of factors such as data transmission methods and hardware conditions in terms of real-time transmission, data processing, and data storage, resulting in low real-time transmission and display effects. Summary of the invention

[0005] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide an image compression and decompression processing method and system to improve the efficiency of real-time transmission of image data.

[0006] In a first aspect, an embodiment of the present application provides an image compression processing method, the method comprising:

[0007] Obtaining an image to be compressed;

[0008] Divide the image into multiple grid areas according to preset rules, and assign a corresponding grid position to each grid area;

[0009] Compressing the grayscale values ​​contained in each grid area according to the position of the grid area to obtain a data matrix and a direction matrix corresponding to each grid area;

[0010] Compress and store the data matrix and direction matrix into the data matrix array and direction matrix array respectively;

[0011] The direction matrix array and the data matrix array are transmitted to the display terminal.

[0012] In a second aspect, an embodiment of the present application provides an image data decompression processing method, the method comprising:

[0013] receiving a direction matrix message and a data matrix message, wherein the direction matrix message includes a message header for indicating image information and a direction matrix array, and the data matrix message includes a message header for indicating image information and a data matrix array;

[0014] Parse the direction matrix message to obtain the direction matrix array;

[0015] Parsing the data matrix message to obtain a data matrix array;

[0016] The grayscale values ​​stored in the data matrix array are restored according to the direction matrix array to obtain the image before compression.

[0017] In the third aspect, an embodiment of the present application provides an image compression processing system, which includes a transmission device and a display terminal. The transmission terminal is configured to execute the method described in the embodiment of the present application, the display terminal is used to send a start transmission instruction to the transmission terminal, and receive a direction matrix message and a data matrix message sent by the transmission terminal, parse the direction matrix message and the data matrix message, and restore the grayscale values ​​stored in the data matrix array according to the direction matrix array to obtain the image before compression; the transmission terminal is used to respond to the start transmission instruction and obtain the image from the acquisition terminal in real time.

[0018] The embodiment of the present application provides an image compression and decompression processing method and system, which obtains an image to be compressed; divides the image into multiple grid areas according to a preset rule, and assigns a corresponding grid position to each grid area; compresses the grayscale values ​​contained in each grid area according to the position of the grid area to obtain a data matrix and a direction matrix corresponding to each grid area, compresses the data matrix and the direction matrix into a data matrix array and a direction matrix array, respectively, and transmits the direction matrix array and the data matrix array to a display terminal. The embodiment of the present application improves the efficiency of real-time transmission of image data by compressing the grayscale values ​​corresponding to the grid area, and the compression processing method of the embodiment of the present application compresses each pixel in the grid area, and its complexity is relatively low. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0020] Figure 1 A schematic diagram showing an application scenario of the image compression processing method provided by an embodiment of the present application is shown;

[0021] Figure 2 A schematic diagram showing a flow chart of an image compression processing method proposed in an embodiment of the present application is shown;

[0022] Figure 3A schematic diagram of grid area division proposed in an embodiment of the present application is shown;

[0023] Figure 4 A two-byte grayscale value representation diagram proposed in an embodiment of the present application is shown;

[0024] Figure 5 A schematic diagram showing a flow chart of another image compression processing method proposed in an embodiment of the present application;

[0025] Figure 6 A schematic diagram showing the comparison processing of pixels in a grid area proposed in an embodiment of the present application is shown;

[0026] Figure 7 A schematic diagram showing a flow chart of another image compression processing method proposed in an embodiment of the present application;

[0027] Figure 8 A schematic diagram showing a flow chart of an image decompression processing method proposed in an embodiment of the present application is shown;

[0028] Fig. 9 A schematic diagram of the structure of an image compression processing device provided in an embodiment of the present application is shown;

[0029] Fig.10 A schematic diagram showing the structure of an image decompression processing device provided in an embodiment of the present application is shown;

[0030] Fig.11 A schematic diagram of the structure of an image compression processing system provided by an embodiment of the present application is shown;

[0031] Fig.12 A schematic diagram of the structure of a processing system of a transmission device or a display terminal provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0032] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant disclosure, rather than to limit the disclosure. It should also be noted that, for ease of description, only the parts related to the disclosure are shown in the accompanying drawings.

[0033] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0034] Please refer to Figure 1 , Figure 1 A schematic diagram of an application scenario of the image compression processing method provided in an embodiment of the present application is shown.

[0035] like Figure 1As shown, the data acquisition terminal 101 is used to acquire X-ray detection images.

[0036] The transmission device 102 is used to transmit the X-ray detection image acquired by the data acquisition terminal to the display terminal 103 .

[0037] The display terminal 103 is used to receive the X-ray detection image sent by the transmission device 102 and display it.

[0038] In practical applications, X-ray detection images are generally 16-bit bitmaps, which means that the bitmap has a maximum of 2 ^16 It can be seen that 16-bit bitmap can be subdivided into more gray levels and display more information.

[0039] However, large-sized 16-bit bitmaps (for example, 3000*3000 in size) cannot be transmitted in real time. In order to meet the requirements of real-time transmission, the 16-bit bitmaps need to be compressed, but the image and video codecs for 8-bit bitmaps are not suitable for 16-bit bitmaps.

[0040] In order to solve the above problems, the present application proposes a technical solution for image compression transmission, which can take into account the complexity while meeting the requirements of real-time transmission of 16-bit image data.

[0041] Please refer to the following Figure 2 , Figure 2 FIG. 1 is a flow chart showing the image compression processing method proposed in the embodiment of the present application. Figure 2 As shown, the method can be performed by an image compression processing device, and the image compression transmission device can be configured in a transmission device. The method includes:

[0042] Step 201: Obtain an image to be compressed.

[0043] Step 202: Divide the image into a plurality of grid areas according to a preset rule, and assign a corresponding grid position to each grid area.

[0044] Step 203, compressing the grayscale values ​​contained in each grid area according to the position of the grid area to obtain a data matrix and a direction matrix corresponding to each grid area;

[0045] Step 204, compressing and storing the direction matrix and the data matrix into the direction matrix array and the data matrix array respectively;

[0046] Step 205: Send the direction matrix array and the data matrix array to the display terminal.

[0047] In the above steps, the image to be compressed refers to the original image acquired by the data acquisition terminal, and the original image may be a 16-bit bitmap.

[0048] The image is divided into multiple grid areas according to preset rules, and each grid area corresponds to a grid position. The preset rule refers to the division rule set according to the pixels of each frame of the displayed image. For example, for a 16-bit bitmap, according to the size of the storage space corresponding to each pixel, the pixels contained in each frame of the image are divided into multiple grid areas according to the size of the storage space. The grid area refers to the set of pixels to be divided. The size of the grid area refers to the size of the pixel set. For example, the grid area is 16*16 pixels. Figure 3 As shown, a 3000*3000 pixel x-ray detection image is divided into multiple grid areas according to areas corresponding to 16*16 pixels.

[0049] Each grid area corresponds to a grid position. The grid position refers to the position of the grid area in the original image. For example, according to the order of the image from left to right and from top to bottom, the grid position of the first grid area is (0,0), the grid position of the second grid area is (0,1), and so on. Each grid area is assigned a grid position accordingly.

[0050] The grayscale value corresponding to each pixel requires 2 bytes to represent, such as Figure 3 As shown, the grayscale value storage bits of a pixel include high-order bytes F15-F8 and low-order bytes F7-F0.

[0051] like Figure 4 As shown, for the grayscale value of each pixel, it may be represented by storing the corresponding numerical value in both the high-order byte and the low-order byte; or, the high-order byte has no numerical value, and only the low-order byte has a numerical value.

[0052] According to the storage characteristics of the grayscale values ​​of the pixels of the 16-bit bitmap, the grayscale values ​​contained in the grid area corresponding to each grid position are compressed according to the grid position to obtain the data matrix and direction matrix corresponding to each grid area. The data matrix is ​​the grayscale value data compression matrix obtained after the grayscale values ​​of the pixels contained in each grid area are compressed. The direction matrix is ​​a matrix used to indicate the position of the data matrix compression.

[0053] After obtaining the data matrix and the direction matrix, in order to realize data transmission, the data matrix and the direction matrix are converted into one-dimensional arrays, namely, a data matrix array and a direction matrix array.

[0054] Then send the data matrix array and direction matrix array to the display terminal.

[0055] In the embodiment of the present application, the grayscale values ​​in the original image are converted into a data matrix and a direction matrix for compression and transmission, which can effectively compress the image to be transmitted with low complexity.

[0056] Based on the above embodiments, in order to more clearly understand the process of image compression processing, please refer to Figure 5 , Figure 5 FIG. 2 is a flow chart of another image compression processing method proposed in an embodiment of the present application. Figure 5 As shown, the method can be performed by an image compression processing device, which can be configured in a transmission device. The method includes:

[0057] Step 201, obtaining an image to be compressed;

[0058] Step 202, dividing the image into a plurality of grid areas according to a preset rule, and assigning a corresponding grid position to each grid area;

[0059] Step 2031, determining the grid position of the grid area;

[0060] Step 2032, performing edge extraction processing on the grid area corresponding to the grid position to obtain a column processing matrix;

[0061] Step 2033, compressing the grayscale values ​​contained in the column processing matrix to obtain a data matrix;

[0062] Step 2034, marking the gray values ​​contained in the column processing matrix to obtain a direction matrix;

[0063] Step 204, compressing and storing the data matrix and the direction matrix into a data matrix array and a direction matrix array respectively;

[0064] Step 205: Transmit the direction matrix array and the data matrix array to a display terminal.

[0065] In the above steps, steps 201-202 are the same as the above method.

[0066] Determine the grid positions of the grid area, for example, determine the grid positions in order from left to right and from top to bottom according to the direction of image processing.

[0067] After obtaining the grid position, edge extraction processing is performed on the grid area corresponding to the grid position to obtain a column processing matrix, that is, gradient calculation is performed on each grid area in the row and column directions to obtain a gradient matrix in the row and column directions. The gradient calculation can be performed in the row direction first, and then the gradient matrix is ​​calculated in the column direction. Alternatively, the gradient matrix is ​​calculated in the column direction first, and then the gradient matrix is ​​calculated in the row direction, which includes the following steps:

[0068] Compare and process the grayscale value set included in the grid area according to the first direction to obtain a row processing matrix;

[0069] The row processing matrix is ​​then compared along the second direction to obtain a column processing matrix.

[0070] The comparison process is performed according to the first direction, including the following steps:

[0071] Determine a plurality of first direction pixel groups of the grid area, where the first direction pixel groups are obtained by dividing the grid area according to the first direction;

[0072] According to the second direction, two adjacent pixels in the first direction pixel group are compared and found in sequence according to the opposite direction of the first direction to obtain an updated first direction pixel group;

[0073] The updated first direction pixel group is stored as a row processing matrix according to the second direction.

[0074] The comparison process is performed according to the second direction, including the following steps:

[0075] Determine a plurality of second direction pixel groups of a row processing matrix, where the second direction pixel groups are obtained by dividing the row processing matrix according to the second direction;

[0076] According to the first direction, two adjacent pixels in the second direction pixel group are compared and found in sequence according to the opposite direction of the second direction to obtain an updated second direction pixel group;

[0077] The updated second direction pixel group is stored as a column processing matrix according to the first direction.

[0078] The first direction and the second direction are perpendicular to each other.

[0079] like Figure 6 As shown, the grayscale value set contained in the grid area is divided according to the row direction to obtain a first direction pixel group in, represents the pixel group corresponding to the grid area in the first direction, l 00 Indicates the pixel at the first position of the first row. 00 The corresponding grayscale value is represented by 2 bytes as [000000000100000].

[0080] The difference between two adjacent pixels in each row is calculated using the following formula (starting from the last pixel in the first row, i.e., starting from the right side of the image and continuing to the left):

[0081] L hn =L hn -L hn-1

[0082] Wherein, h represents the number of pixel groups in the first direction obtained by dividing the grid area in the row direction;

[0083] n represents pixels determined according to the first direction in each first direction pixel group.

[0084] Where L h0 = l 00 .

[0085] Then, process them in the column direction (from top to bottom). arrive Get the row processing matrix, that is, the gradient matrix in the row direction.

[0086] Divide the row processing matrix in the column direction to obtain the first direction pixel group in, represents the pixel group corresponding to the grid area in the first direction, l 00 Represents the pixel at the first position of the first column. 00 The corresponding grayscale value is represented by 2 bytes as [000000000100000].

[0087] The difference between two adjacent pixels in each column is calculated using the following formula (starting from the last pixel in the first column, i.e., starting from the bottom of the image and continuing upward):

[0088] L n′h′ =L n′h′ -L n′-1,h′

[0089] Wherein, n′ represents the number of pixel groups in the second direction obtained by dividing the grid area in the column direction;

[0090] h′ represents pixels determined according to the second direction in each second direction pixel group.

[0091] Where L 0h′ = l 00 .

[0092] The column processing matrix obtained after the above processing is the gradient matrix in the column direction. The above difference calculation process is the gradient calculation.

[0093] The first value of this column of the processing matrix is ​​the same as the value of the original pixel matrix corresponding to the grid area, and the value of the grid position is filled by subtracting the adjacent positions.

[0094] The above processing can well capture the edge sensitive data of the grid area, effectively retain the sensitive values ​​in the image to be compressed, and lay the foundation for ensuring the accuracy of subsequent image compression processing.

[0095] The grayscale values ​​contained in the column processing matrix are compressed to obtain a data matrix including:

[0096] Compare the element in the i-th row and j-th column of the column processing matrix with a preset threshold, where the element includes a high byte and a low byte, and the value of i is less than or equal to the row value of the grid area, and the value of j is less than or equal to the column value of the grid area;

[0097] When the element is larger than a preset threshold, the high byte and the low byte of the element are retained as the first element to be written;

[0098] Write the first element to be written into the position of the i-th row and j-th column in the data matrix;

[0099] When the element is less than or equal to a preset threshold, the low byte of the element is reserved as the second element to be written, and the second element to be written is forcibly converted into a single byte;

[0100] The converted second element to be written is written into the position of the i-th row and j-th column in the data matrix.

[0101] After the above processing, the grayscale value originally represented by 2 bytes is compressed into a single-byte grayscale value, thereby effectively compressing the image data. Especially for X-ray detection images, the proportion of pixels in the image with grayscale values ​​lower than the preset threshold is relatively high. Therefore, the above compression processing can effectively improve the efficiency of real-time image transmission. The above preset threshold can be, for example, 0xFF.

[0102] Mark the grayscale values ​​contained in the column processing matrix, and the direction matrix also includes

[0103] Compare the element in the i-th row and j-th column of the column processing matrix with a preset threshold, wherein the element includes a high byte and a low byte, the value of i is less than or equal to the row value of the grid area, and the value of j is less than or equal to the column value of the grid area;

[0104] When the element is greater than the preset threshold, a first flag is set;

[0105] Write the first identifier into the position of the i-th row and j-th column in the data matrix;

[0106] When the element is less than or equal to a preset threshold, a second flag is set, and the second flag is written into the position of the i-th row and the j-th column in the data matrix.

[0107] After compressing the grayscale values ​​corresponding to the grid area, a data matrix and a direction matrix are obtained.

[0108] Each element of the direction matrix is ​​processed into two bytes according to a preset processing order; the preset processing order may include but is not limited to first reading each element in the direction matrix according to a first direction, and then reading each element in the direction matrix according to a second direction.

[0109] Write the two bytes into the direction matrix array in sequence;

[0110] Each element of the data matrix is ​​sequentially written into a data matrix array in the order of first the first direction and then the second direction, and the data matrix array includes storage locations mixed with two bytes and single bytes.

[0111] The above method provided in the embodiment of the present application obtains a data matrix containing grayscale values ​​represented by two bytes and single byte by performing grayscale value compression processing on the image after edge extraction, and establishes a direction matrix to indicate whether the elements in the compressed data matrix are compressed, thereby reducing the complexity of data processing.

[0112] Getting the image to be compressed includes:

[0113] Obtain two adjacent frames of original images and perform grayscale value difference processing to obtain the image to be compressed.

[0114] Based on the above embodiments, in order to more clearly understand the process of image compression processing, please refer to Figure 7 , Figure 7 FIG. 2 is a flow chart of another image compression processing method proposed in an embodiment of the present application. Figure 7 As shown, the method can be performed by an image compression processing device, which can be configured in a transmission device. The method includes:

[0115] Step 201, obtaining two adjacent frames of original images and performing grayscale value difference processing to obtain an image to be compressed;

[0116] In the above steps, sensitive data in the image can be retained by performing grayscale value difference processing to improve the data quality of image compression.

[0117] Step 202, dividing the image into a plurality of grid areas according to a preset rule, and assigning a corresponding grid position to each grid area;

[0118] The above preset rule refers to a predefined pixel processing range, for example, the size of 16*16 can be used as the standard for dividing the grid area.

[0119] Step 2031, determining the grid position of the grid area;

[0120] Step 2032, performing edge extraction processing on the grid area corresponding to the grid position to obtain a column processing matrix;

[0121] Step 2033, compressing the grayscale values ​​contained in the column processing matrix to obtain a data matrix;

[0122] Step 2034, marking the gray values ​​contained in the column processing matrix to obtain a direction matrix;

[0123] Step 204, compressing and storing the data matrix and the direction matrix into a data matrix array and a direction matrix array respectively;

[0124] Step 2051, encapsulating the direction matrix array into a direction matrix message, where the direction matrix message includes a message header for indicating image information and the direction matrix array;

[0125] Step 2052, sending a direction matrix message to a display terminal;

[0126] Step 2053, encapsulating the data matrix array into a data matrix message, the data matrix message including a message header for indicating image information and a data matrix array;

[0127] Step 2054, sending the data matrix message to the display terminal.

[0128] In the above steps, when sending a direction matrix message, the message header used to indicate the image information includes: an image information message fixed start flag field, a direction matrix flag field, a matrix column number field, a matrix row number field, a direction matrix array, a message check data field, and a message fixed end flag field.

[0129] When sending a data matrix message, the message header used to indicate image information includes: an image information message fixed start flag field, a data matrix flag field, a matrix column number field, a matrix row number field, a data matrix array, a message check data field, and a message fixed end flag field.

[0130] Among them, the start identification field, the end flag field, and the direction matrix flag field can be 1 byte, and the other fields can use two bytes.

[0131] The transmission device can compress each grid area in turn and send it to the display terminal according to the above steps, or can combine and compress multiple grid areas and send them to the display terminal according to the display capability of the display terminal.

[0132] Please refer to Figure 8 , Figure 8 FIG. 2 is a flow chart showing the image decompression processing method proposed in the embodiment of the present application. Figure 8 As shown, the method can be performed by an image decompression processing device, which can be configured in a display terminal. The method includes:

[0133] Step 301, receiving a direction matrix message and a data matrix message.

[0134] In the above steps, the direction matrix message includes a message header for indicating image information and a direction matrix array, and the data matrix message includes a message header for indicating image information and a data matrix array;

[0135] Step 302, parsing the direction matrix message to obtain a direction matrix array; parsing the data matrix message to obtain a data matrix array;

[0136] Step 303, restore the grayscale values ​​stored in the data matrix array according to the direction matrix array to obtain the image before compression.

[0137] In the embodiment of the present application, the display terminal uses the above decompression processing method to Figure 2 Restoring the grayscale value of the compressed image shown can improve the efficiency of real-time display.

[0138] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a different order from the order marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0139] Please refer to the following Fig. 9 , Fig. 9 The schematic diagram of the structure of the image compression processing device provided in the embodiment of the present application is shown. The device can be configured in a transmission device. The device includes:

[0140] An image acquisition module 401 is used to acquire an image to be compressed;

[0141] A grid division module 402, used to divide the image into a plurality of grid areas according to a preset rule, and assign a corresponding grid position to each grid area;

[0142] A compression processing module 403 is used to compress the grayscale values ​​contained in each grid area according to the position of the grid area to obtain a data matrix and a direction matrix corresponding to each grid area;

[0143] A compression storage module 404 is used to compress and store the direction matrix and the data matrix into a direction matrix array and a data matrix array respectively;

[0144] The data transmission module 405 is used to transmit the direction matrix array and the data matrix array to the display terminal.

[0145] The compression processing module 403 includes:

[0146] A determination submodule, used to determine the grid position of the grid area;

[0147] An extraction submodule is used to perform edge extraction processing on the grid area corresponding to the grid position to obtain a column processing matrix;

[0148] A compression submodule is used to compress the grayscale values ​​contained in the column processing matrix to obtain a data matrix;

[0149] The marking submodule is used to mark the grayscale values ​​contained in the column processing matrix to obtain a direction matrix.

[0150] Compression submodule for:

[0151] Compare the element in the i-th row and j-th column of the column processing matrix with the preset threshold, the element includes a high byte and a low byte, the value of i is less than or equal to the row value of the grid area, and the value of j is less than or equal to the column value of the grid area;

[0152] When the element is greater than the preset threshold, retaining the high byte and the low byte of the element as the first element to be written;

[0153] Write the first element to be written into the position of the i-th row and j-th column in the data matrix;

[0154] When the element is less than or equal to the preset threshold, retain the low byte of the element as the second element to be written, and forcibly convert the second element to be written into a single byte;

[0155] The converted second element to be written is written into the position of the i-th row and j-th column in the data matrix.

[0156] Mark submodules for:

[0157] Compare the element of the i-th row and j-th column in the column processing matrix with a preset threshold, wherein the element includes a high byte and a low byte, the value of i is less than or equal to the row value of the grid area, and the value of j is less than or equal to the column value of the grid area;

[0158] When the element is greater than a preset threshold, a first flag is set;

[0159] Write the first identifier into the position of the i-th row and j-th column in the data matrix;

[0160] When the element is less than or equal to a preset threshold, a second flag is set;

[0161] Write the second identifier into the data matrix at the position of row i and column j.

[0162] Extract submodules for:

[0163] Compare and process the grayscale value set included in the grid area according to the first direction to obtain a row processing matrix;

[0164] The row processing matrix is ​​compared along the second direction to obtain a column processing matrix.

[0165] The compression storage module 404 is used for:

[0166] Each element of the direction matrix is ​​processed into two bytes according to the preset processing order;

[0167] Write the two bytes into the direction matrix array in sequence;

[0168] Each element of the data matrix is ​​sequentially written into a data matrix array in the order of first the first direction and then the second direction. The data matrix array includes storage locations mixed with two bytes and single bytes. The first direction is perpendicular to the second direction.

[0169] The image acquisition module 401 is used to acquire two adjacent frames of original images and perform gray value difference processing to obtain an image to be compressed.

[0170] Data transmission module for:

[0171] Encapsulating the direction matrix array into a direction matrix message, wherein the direction matrix message includes a message header for indicating image information and the direction matrix array;

[0172] Send direction matrix message to display terminal;

[0173] encapsulating the data matrix array into a data matrix message, wherein the data matrix message includes a message header for indicating image information and a data matrix array;

[0174] Send data matrix message to display terminal.

[0175] Please refer to the following Fig.10 , Fig.10 The schematic diagram of the structure of the image decompression processing device provided by the embodiment of the present application is shown. The device can be configured in a display terminal. The device includes:

[0176] The message receiving module 501 is used to receive direction matrix messages and data matrix messages.

[0177] The above-mentioned direction matrix message includes a message header and a direction matrix array for indicating image information, and the data matrix message includes a message header and a data matrix array for indicating image information;

[0178] The message parsing module 502 is used to parse the direction matrix message to obtain the direction matrix array; parse the data matrix message to obtain the data matrix array;

[0179] The data restoration module 503 is used to restore the grayscale values ​​stored in the data matrix array according to the direction matrix array to obtain the image before compression.

[0180] Please refer to the following Fig.11 , Fig.11 The structure diagram of the image compression processing system provided by the embodiment of the present application is shown in FIG. The system includes a transmission device 601 and a display terminal 602. The transmission terminal is configured to perform the following steps: Figure 2 The internal structure may include but is not limited to the following: Fig. 9 The structure shown in the embodiment can also be Fig. 9 The modules shown are merged or split.

[0181] The system may also include a collection terminal, the collection terminal is used to collect images in real time;

[0182] The display terminal 602 is used to send a transmission start instruction to the transmission terminal, receive a direction matrix message and a data matrix message sent by the transmission terminal, parse the direction matrix message and the data matrix message, and restore the grayscale value stored in the data matrix array according to the direction matrix array to obtain an image before compression;

[0183] The transmission device 601 is used to respond to the start transmission instruction and acquire images from the acquisition terminal in real time.

[0184] It should be understood that the units or modules described in the above device are similar to those described in the reference Figure 2 The steps in the described method correspond to each other. Therefore, the operations and features described above for the method are also applicable to the above-mentioned device and the units contained therein, and will not be repeated here. The above-mentioned device can be pre-implemented in the browser or other security application of the electronic device, and can also be loaded into the browser or its security application of the electronic device by downloading or the like. The corresponding units in the above-mentioned device can cooperate with the units in the electronic device to implement the solution of the embodiment of the present application.

[0185] For the several modules or units mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0186] Reference below Fig.12 , Fig.12A schematic diagram of the structure of a processing system of a transmission device or a display terminal provided in an embodiment of the present application is shown.

[0187] like Fig.12 As shown, the processing system includes a processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read only memory (ROM) 702 or a program loaded from a storage portion 705 to a random access memory (RAM) 703.

[0188] It may further include a communication section 706. The communication section 706 performs communication processing via a network such as the Internet.

[0189] In particular, according to an embodiment of the present disclosure, the above reference flow chart Figure 2 The described process can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a machine-readable medium, and the computer program contains program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 706, and / or installed from a removable medium. When the computer program is executed by the processing unit 701, the above-mentioned functions defined in the system of the present application are executed.

[0190] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0191] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of the code, and the aforementioned module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0192] The units or modules involved in the embodiments described in the present application may be implemented by software or by hardware. The units or modules described may also be arranged in a processor. For example, they may be described as: a processor includes an image acquisition module, a grid division module, a compression processing module, a compression storage module, and a data transmission module. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves. For example, the image acquisition module may also be described as a "module for acquiring an image to be compressed."

[0193] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently and not be assembled into the electronic device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the image compression processing and decompression processing methods described in the present application.

[0194] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.

Claims

1. An image compression processing method, characterized in that: The method includes: Obtaining an image to be compressed; Dividing the image into a plurality of grid areas according to a preset rule, and assigning a corresponding grid position to each of the grid areas; Compressing the grayscale values ​​contained in each grid area according to the position of the grid area to obtain a data matrix and a direction matrix corresponding to each grid area; Compressing and storing the data matrix and the direction matrix into a data matrix array and a direction matrix array respectively; Transmitting the direction matrix array and the data matrix array to a display terminal; The grayscale values ​​contained in each grid area are compressed according to the position of the grid area to obtain a direction matrix and a data matrix including: Determining a grid position of the grid area; Performing edge extraction processing on the grid area corresponding to the grid position to obtain a column processing matrix, wherein the edge extraction processing is to perform gradient calculation in the row and column directions on each grid area; Compressing the grayscale values ​​contained in the column processing matrix to obtain a data matrix; Marking the grayscale values ​​contained in the column processing matrix to obtain a direction matrix; The step of marking the grayscale values ​​contained in the column processing matrix to obtain a direction matrix further comprises: Compare the element of the i-th row and j-th column in the column processing matrix with a preset threshold, wherein the element includes a high byte and a low byte, the value of i is less than or equal to the row value of the grid area, and the value of j is less than or equal to the column value of the grid area; When the element is greater than the preset threshold, a first flag is set; Writing the first identifier into the position of the i-th row and j-th column in the data matrix; When the element is less than or equal to the preset threshold, setting a second flag; The second identifier is written into the position of the i-th row and the j-th column in the data matrix.

2. The method according to claim 1, characterized in that The grayscale values ​​contained in the column processing matrix are compressed to obtain a data matrix including: Compare the element of the i-th row and j-th column in the column processing matrix with a preset threshold, wherein the element includes a high byte and a low byte, the value of i is less than or equal to the row value of the grid area, and the value of j is less than or equal to the column value of the grid area; When the element is greater than the preset threshold, retaining the high byte and the low byte of the element as the first element to be written; Writing the first element to be written into the position of the i-th row and j-th column in the data matrix; When the element is less than or equal to the preset threshold, retaining the low byte of the element as the second element to be written, and forcibly converting the second element to be written into a single byte; The converted second element to be written is written into the position of the i-th row and the j-th column in the data matrix.

3. The method according to claim 1, characterized in that Performing edge extraction processing on the grid area corresponding to the grid position to obtain a column processing matrix includes: Compare the grayscale value set included in the grid area according to the first direction to obtain a row processing matrix; The row processing matrix is ​​compared along the second direction to obtain a column processing matrix.

4. The method according to claim 1, characterized in that Compressing and storing the data matrix and the direction matrix into a data matrix array and a direction matrix array respectively comprises: Processing each element of the direction matrix into two bytes according to a preset processing order; Write the two bytes into the direction matrix array in sequence; Each element of the data matrix is ​​sequentially written into a data matrix array in the order of first a first direction and then a second direction. The data matrix array includes storage locations mixed with two bytes and single bytes. The first direction is perpendicular to the second direction.

5. The method according to claim 1, characterized in that The obtaining of the image to be compressed comprises: Obtain two adjacent frames of original images and perform grayscale value difference processing to obtain the image to be compressed.

6. The method according to claim 1, characterized in that Sending the direction matrix array and the data matrix array to the display terminal includes: Encapsulating the direction matrix array into a direction matrix message, wherein the direction matrix message includes a message header for indicating image information and the direction matrix array; Sending the direction matrix message to the display terminal; Encapsulating the data matrix array into a data matrix message, wherein the data matrix message includes a message header for indicating image information and the data matrix array; Transmitting the data matrix message to the display terminal.

7. A method for decompressing image data, characterized in that: The method includes: Receiving a direction matrix message and a data matrix message, wherein the direction matrix message includes a message header for indicating image information and the direction matrix array, and the data matrix message includes a message header for indicating image information and the data matrix array, wherein the direction matrix message is obtained according to the direction matrix in claim 1, and the data matrix message is obtained according to the data matrix in claim 1; Parsing the direction matrix message to obtain the direction matrix array; Parsing the data matrix message to obtain the data matrix array; The grayscale values ​​stored in the data matrix array are restored according to the direction matrix array to obtain an image before compression.

8. An image compression processing system, characterized in that: The system comprises a transmission terminal and a display terminal, wherein the transmission terminal is configured to execute the method according to any one of claims 1 to 6; the system further comprises a collection terminal, wherein the collection terminal is used to collect images in real time; The display terminal is used to send a transmission start instruction to the transmission terminal, and receive a direction matrix message and a data matrix message sent by the transmission terminal, parse the direction matrix message and the data matrix message, and restore the grayscale value stored in the data matrix array according to the direction matrix array to obtain an image before compression; The transmission terminal is used to respond to the start transmission instruction and acquire the image from the acquisition terminal in real time; The compression processing module includes: A determination submodule, used to determine the grid position of the grid area; An extraction submodule is used to perform edge extraction processing on the grid area corresponding to the grid position to obtain a column processing matrix, wherein the edge extraction processing is to perform gradient calculation in the row and column directions on each grid area; A compression submodule is used to compress the grayscale values ​​contained in the column processing matrix to obtain a data matrix; A marking submodule is used to mark the grayscale values ​​contained in the column processing matrix to obtain a direction matrix; Mark submodules for: Compare the element of the i-th row and j-th column in the column processing matrix with a preset threshold, wherein the element includes a high byte and a low byte, the value of i is less than or equal to the row value of the grid area, and the value of j is less than or equal to the column value of the grid area; When the element is greater than a preset threshold, a first flag is set; Write the first identifier into the position of the i-th row and j-th column in the data matrix; When the element is less than or equal to a preset threshold, a second flag is set; Write the second identifier into the data matrix at the position of row i and column j.

Citation Information

Patent Citations

  • Characteristic matching method based on principal direction template

    CN105023021A

  • Processing method and device for converting track sequence into image matrix, and storage medium

    CN109783771A

  • Motion detection method and device, storage medium and terminal equipment

    CN111583299A

  • Differential type geographic location information coding algorithm based on region benchmark

    CN1808068A

  • Image processing apparatus and method, program, and storage medium

    US20030107753A1