Image lossless compression method and system
By preloading the grayscale values and indices of single pixels and combinations of adjacent pixels in the ISP chip, and combining dynamic noise reduction and multi-core parallel encoding, the problem of low matching efficiency of the encoding dictionary in the ISP chip is solved, achieving efficient lossless compression of industrial images and meeting the requirements of real-time processing and low cost.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ANHUI RONDS SCI & TECH INC CO
- Filing Date
- 2026-01-21
- Publication Date
- 2026-05-15
AI Technical Summary
The pre-loaded encoding dictionary in existing ISP chips only loads single grayscale values, resulting in low matching efficiency and low compression efficiency during the encoding process, and limited reduction in data volume, which cannot effectively meet the large data processing needs of industrial images.
The grayscale value and its index corresponding to a single pixel, as well as the grayscale value combination and its index corresponding to the combination of adjacent pixels, are preloaded in the ISP chip. Parallel encoding is performed through the built-in compression module, and the encoding dictionary update mechanism is optimized by combining dynamic noise reduction coefficients and multi-core parallel processing.
It improves encoding matching efficiency, achieves a compression ratio of 3.0:1, reduces the data size of a single frame to below 500KB, meets real-time processing requirements, reduces hardware costs and latency, and is suitable for efficient lossless compression of industrial images.
Smart Images

Figure CN122053841A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing, and more specifically, to a lossless image compression method and system. Background Technology
[0002] With the development of industry and intelligent manufacturing, the amount of data generated by industrial vision systems is growing exponentially, due to factors such as a surge in resolution, increased frame rates, and expanded scale. Facing such massive amounts of industrial images, failure to compress them will result in enormous storage costs, excessive transmission latency, and heavy loads on backend processing servers.
[0003] For industrial image compression, an Image Signal Processor (ISP) is typically used. In industrial image compression, the ISP chip generally uses an encoding dictionary for matching, and then compresses the image based on the matching results. However, in existing technologies, the encoding dictionary pre-loaded in the ISP chip only loads single grayscale values. This results in low encoding dictionary matching efficiency during the encoding process, leading to problems such as low compression efficiency and limited reduction in data volume. Summary of the Invention
[0004] The purpose of this invention is to provide a lossless image compression method and system to improve compression efficiency and ensure that the compressed data volume meets the requirements.
[0005] In a first aspect, the present invention provides a lossless image compression method applied to an ISP chip, wherein the ISP chip communicates with an industrial sensor, the method comprising: Obtain the industrial images captured by the industrial sensor; The industrial images are subjected to format conversion and noise suppression processing. The processed industrial image is encoded based on a preloaded encoding dictionary to obtain the encoding result, and the encoding dictionary is updated. The preloaded encoding dictionary includes the gray value corresponding to a single pixel and its corresponding index, as well as the gray value combination corresponding to the combination of adjacent pixels and its corresponding index. The encoded result is post-processed, and the post-processed encoded result is transmitted to an external system.
[0006] In an optional implementation, the ISP chip includes a built-in acquisition module, and the step of obtaining the industrial image acquired by the industrial sensor includes: Configure the industrial sensor with the following settings: pixel resolution and frame rate. Based on the configuration information, the industrial images output by the industrial sensor are acquired through the acquisition module.
[0007] In an optional implementation, the step of performing noise suppression processing on the industrial image includes: Obtain the pixel resolution of the industrial sensor, and obtain the correspondence between different pixel resolutions and different noise reduction coefficients; The corresponding target noise reduction coefficient is determined based on the pixel resolution and the correspondence. The industrial image is subjected to noise suppression processing based on the target noise reduction coefficient.
[0008] In an optional implementation, the ISP chip includes a built-in compression module, and the step of encoding the processed industrial image based on a preloaded encoding dictionary to obtain the encoding result includes: The compressed module is used to encode the processed industrial image based on the gray value combination and its corresponding index of adjacent pixel combination in the preloaded encoding dictionary, so as to obtain the encoding result of adjacent pixel combination. The processed industrial image is encoded using the grayscale value and its corresponding index of a single pixel in the encoding dictionary to obtain the encoding result of a single pixel. The final encoding result is obtained by combining the encoding results of adjacent pixel combinations and the encoding results of single pixels.
[0009] In an optional implementation, the step of encoding the processed industrial image using the compression module and based on the grayscale value combinations and their corresponding indices corresponding to adjacent pixel combinations in a preloaded encoding dictionary to obtain the encoding result of adjacent pixel combinations includes: The compression module is used to combine two adjacent pixels in the processed industrial image into adjacent pixel combinations. Obtain the gray value pairs of the adjacent pixel combinations, and search in the preloaded encoding dictionary whether there is a matching gray value combination based on the gray value pairs. If there is a matching gray value combination, obtain the corresponding index of the matching gray value combination. The encoding result of the adjacent pixel combination is obtained based on the corresponding index.
[0010] In an optional implementation, the step of encoding the processed industrial image using the grayscale value and its corresponding index of a single pixel in the encoding dictionary to obtain the encoding result of a single pixel includes: Obtain the grayscale value corresponding to a single pixel in the processed industrial image; Based on the gray value corresponding to the single pixel, search the encoding dictionary to see if there is a matching gray value; If a matching grayscale value is found, the corresponding index of the matching grayscale value is obtained; The encoding result of a single pixel is obtained based on the corresponding index.
[0011] In an optional implementation, the step of updating the encoding dictionary includes: If there is no matching grayscale value combination, the grayscale value pairs of the adjacent pixel points are added to the encoding dictionary, and the corresponding index is configured. If no matching grayscale value is found, the grayscale value corresponding to the single pixel is added to the encoding dictionary, and the corresponding index is configured.
[0012] In an optional implementation, the step of updating the encoding dictionary further includes: Detect whether the capacity of the encoded dictionary has reached the preset maximum capacity; If the preset maximum capacity is reached, delete the grayscale value combinations or grayscale values in the encoding dictionary that have not been matched more than a preset number of times, and then perform the steps of adding the grayscale value pairs of the adjacent pixel points to the encoding dictionary or adding the grayscale value corresponding to the single pixel point to the encoding dictionary.
[0013] In an optional implementation, the ISP chip includes a built-in compression module, which comprises multiple parallel processing units. The step of encoding the processed industrial image based on a preloaded encoding dictionary to obtain the encoding result includes: The processed industrial image is divided into multiple image sub-blocks; The multiple image sub-blocks are processed in parallel using multiple parallel processing units in the compression module and based on a preloaded encoding dictionary to obtain sub-encoding results. The results of multiple sub-encodings are merged to obtain the final encoding result.
[0014] Secondly, the present invention provides an image lossless compression system applied to an ISP chip, wherein the ISP chip communicates with an industrial sensor, and the system includes: The acquisition unit is used to obtain industrial images acquired by the industrial sensor; The preprocessing unit is used to perform format conversion and noise suppression processing on the industrial image; The encoding unit is used to encode the processed industrial image based on a preloaded encoding dictionary to obtain the encoding result, and to update the encoding dictionary. The preloaded encoding dictionary includes the gray value corresponding to a single pixel and its corresponding index, as well as the gray value combination corresponding to the combination of adjacent pixels and its corresponding index. The transmission unit is used to post-process the encoding result and transmit the post-processed encoding result to an external system.
[0015] This invention provides a lossless image compression method and system. It acquires industrial images from industrial sensors, performs format conversion and noise suppression on the industrial images, and then encodes the processed industrial images based on a pre-loaded encoding dictionary to obtain an encoded result. The encoding dictionary is then updated. The pre-loaded encoding dictionary includes the grayscale value and corresponding index of a single pixel, as well as the grayscale value combination and corresponding index of adjacent pixel combinations. The obtained encoding result is post-processed and then transmitted to an external system. In this scheme, by loading the grayscale values and corresponding indices of both single pixels and adjacent pixel combinations, matching compression of single pixels and adjacent pixel combinations can be achieved, improving matching efficiency and significantly increasing the compression ratio, ensuring that the compressed data volume meets requirements. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart of the image lossless compression method provided in this embodiment of the invention; Figure 2 for Figure 1 A flowchart of the sub-steps included in S11; Figure 3 for Figure 1 A flowchart of the sub-steps included in S12; Figure 4 for Figure 1 A flowchart of the sub-steps included in S13; Figure 5 This is a schematic diagram of the functional units of the image lossless compression system provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0018] The technical solutions of the present invention will now be described with reference to the accompanying drawings in the embodiments of the present invention.
[0019] Please see Figure 1The following is a flowchart of a lossless image compression method provided in an embodiment of the present invention. The detailed steps of the lossless image compression method are described below.
[0020] S11, Obtain the industrial image acquired by the industrial sensor; S12, perform format conversion and noise suppression processing on the industrial image; S13, the processed industrial image is encoded based on the preloaded encoding dictionary to obtain the encoding result, and the encoding dictionary is updated. The preloaded encoding dictionary includes the gray value corresponding to a single pixel and its corresponding index, as well as the gray value combination corresponding to the combination of adjacent pixels and its corresponding index. S14, perform post-processing on the encoding result, and transmit the post-processed encoding result to an external system.
[0021] The lossless image compression method provided in this embodiment is applied to an ISP chip. By loading the grayscale values and corresponding indices of single pixels and combinations of adjacent pixels, matching compression of single pixels and combinations of adjacent pixels can be achieved, improving matching efficiency and greatly increasing the compression ratio, ensuring that the amount of compressed data meets the requirements.
[0022] The specific implementation methods of each of the above steps will be explained in detail below.
[0023] In this embodiment, the ISP chip includes a built-in acquisition module, a preprocessing module, a compression module, and a data output module. All modules are integrated within the ISP chip and are connected to each other via an internal high-speed bus, without any external interface transmission links. The acquisition module connects directly to the industrial sensor via a data interface, such as a 12-bit RAW data interface. The data output module connects to a back-end storage system or an external system via an interface, such as an AXI4 interface.
[0024] Please see Figure 2 In this embodiment, the step of obtaining the industrial image acquired by the industrial sensor can be implemented in the following way: S111, Set the configuration information of the industrial sensor, the configuration information including pixel resolution and frame rate; S112, Based on the configuration information, the industrial image output by the industrial sensor is acquired through the acquisition module.
[0025] In this embodiment, the acquisition module is a built-in module of the ISP chip. It communicates with the industrial sensor through the I2C interface and can configure the configuration information of the industrial sensor, including pixel resolution, frame rate, etc. The pixel resolution can range from 200W to 500W, and the frame rate can be up to 30fps.
[0026] The acquisition module has a built-in 12-bit data acquisition interface, capable of acquiring industrial images output by industrial sensors at a rate of 100MHz. The industrial images output by the industrial sensors can be in RAW format. After acquiring the industrial images, the acquisition module can transmit them to the preprocessing module via the 32-bit high-speed bus inside the ISP chip.
[0027] In existing technologies, ISP chips typically use general-purpose acquisition interfaces. However, in this embodiment, the interface is configured specifically for the output characteristics of industrial sensors, which can improve acquisition stability, for example, by 20%. Furthermore, the acquisition module and the subsequent preprocessing module share an internal bus, eliminating external transmission delays.
[0028] Based on the acquired industrial image, the image is first subjected to format conversion and noise suppression processing. The format conversion process includes converting the acquired 12-bit RAW format industrial image into a unified 32-bit parallel data format used within the ISP chip to meet the bandwidth requirements of subsequent parallel encoding. In this embodiment, the format conversion latency can be less than or equal to 0.5ms.
[0029] In noise suppression processing of industrial images, Gaussian denoising algorithms are used, such as the 3×3 window Gaussian denoising algorithm. In existing technologies, ISP chips typically use Gaussian denoising algorithms with fixed coefficients when performing noise processing, without considering the noise levels of the industrial sensor in different pixel modes. For example, the noise level in a 500W pixel mode is about 30% higher than that in a 200W pixel mode, resulting in incomplete denoising in high-pixel modes and excessive denoising in low-pixel modes, affecting subsequent encoding efficiency.
[0030] To address the problems existing in the prior art, this embodiment employs a dynamic noise reduction coefficient for noise reduction processing. For details, please refer to [link to relevant documentation]. Figure 3 Noise suppression processing of industrial images can be achieved in the following ways: S121, obtain the pixel resolution of the industrial sensor, and obtain the correspondence between different pixel resolutions and different noise reduction coefficients; S122, determine the corresponding target noise reduction coefficient based on the pixel resolution and the correspondence; S123, perform noise suppression processing on the industrial image based on the target noise reduction coefficient.
[0031] In this embodiment, a pre-built correspondence between different pixel resolutions and different noise reduction coefficients is established. For example, the noise reduction coefficients corresponding to different pixel resolutions of industrial sensors, such as 200W, 300W, and 500W, are as follows: the noise reduction coefficient corresponding to 500W pixel resolution is 1.2, and the noise reduction coefficient corresponding to 200W pixel resolution is 0.8.
[0032] Thus, given the actual pixel resolution of the industrial sensor, the target noise reduction coefficient can be determined based on this correspondence. Then, noise reduction processing of the industrial image is implemented based on this target noise reduction coefficient.
[0033] In this embodiment, a dynamic noise reduction coefficient determination method is adopted to adapt to the noise characteristics of different pixel modes. The signal-to-noise ratio of the denoised data can be improved by 15% to 20%, which improves the quality of standardized data and lays the foundation for subsequent efficient coding.
[0034] In existing technologies, when compressing industrial images, compression is performed using a compression chip independent of the ISP chip, i.e., a separate architecture of "ISP chip + independent compression chip". The independent compression module requires additional hardware chips and supporting power supply and interface circuits, increasing hardware costs by about 40%. At the same time, the modules are connected through external interfaces, which poses a risk of signal loss during data transmission and results in poor integration.
[0035] To address the aforementioned problems in the existing technology, this embodiment implements compression processing based on a compression module built into the ISP chip. The compression module and the preprocessing module are connected via an internal bus. The compression module has a pre-loaded encoding dictionary built in. For details, please refer to [link to relevant documentation]. Figure 4 The step of encoding the processed industrial image based on a preloaded encoding dictionary to obtain the encoding result can be implemented in the following way: S131, using the compression module and based on the gray value combination and its corresponding index corresponding to the combination of adjacent pixels in the preloaded encoding dictionary, the processed industrial image is encoded to obtain the encoding result of the combination of adjacent pixels. S132, using the grayscale value and its corresponding index of a single pixel in the encoding dictionary, the processed industrial image is encoded to obtain the encoding result of a single pixel; S133, the final encoding result is obtained by combining the encoding results of adjacent pixel combinations and the encoding results of single pixels.
[0036] In existing technologies, the encoding dictionary is initialized by loading only a single grayscale value, without taking into account the grayscale distribution characteristics of industrial images output by specific industrial sensors, such as typical grayscale pairs of metal surfaces and electronic components. This results in low encoding dictionary matching efficiency during the encoding process, with a compression ratio of only 2.0-2.5:1. Even after compression, a single frame of a 500W pixel image still reaches more than 600KB, and the storage and transmission pressure has not been adequately alleviated.
[0037] To address the problems existing in the prior art, this embodiment adopts a method of preloading the single grayscale value corresponding to a single pixel and the combination of grayscale values corresponding to the combination of adjacent pixels, thereby improving the initial dictionary matching effect by 50%, increasing the compression ratio to 3.0:1, and reducing the data volume after single-frame compression to below 500KB.
[0038] Specifically, in this embodiment, the encoding dictionary includes grayscale value combinations corresponding to adjacent pixel combinations and their corresponding indices, as well as grayscale values of single pixels and their corresponding indices.
[0039] The grayscale value combination corresponding to the combination of adjacent pixels can be understood as follows: For example, in an image, if two adjacent pixels, one on the left and the other on the right, have grayscale values of 41 and 42 respectively, then their corresponding grayscale value combination is (41, 42). If the grayscale values of two adjacent pixels differ significantly, for example, if the difference exceeds a preset threshold, then it can be determined that the adjacent pixels are often located at the contour boundary of the image, such as the contour boundary of a workpiece.
[0040] The index corresponding to the combination of adjacent pixels can be understood as the index in the encoding dictionary that points to the combination of adjacent pixels, which is usually a number that is much shorter than the length of the combination of adjacent pixels.
[0041] In this embodiment, the industrial image is first encoded based on the gray value combination and its corresponding index corresponding to the preloaded adjacent pixel combination, so as to obtain the encoding result of the adjacent pixel combination. In this way, it is not necessary to encode the two pixels separately, which can improve the matching efficiency and the matching success rate.
[0042] For some single pixels, or individual pixels among adjacent pixels that cannot be matched based on the combination of adjacent pixels, the gray value corresponding to the single pixel and its corresponding index in the encoding dictionary can be used to encode them.
[0043] Finally, the final encoding result is obtained by combining the encoding results of adjacent pixel combinations and the encoding results of single pixels.
[0044] In this embodiment, specifically, the step of encoding the industrial image based on the gray value combination corresponding to the combination of adjacent pixels and their corresponding index can be implemented in the following way: The compression module uses the above method to combine every two adjacent pixels in the processed industrial image into adjacent pixel combinations; obtain grayscale value pairs of the adjacent pixel combinations; search the preloaded encoding dictionary for matching grayscale value combinations based on the grayscale value pairs; if a matching grayscale value combination is found, obtain the corresponding index of the matching grayscale value combination; and obtain the encoding result of the adjacent pixel combination based on the obtained corresponding index.
[0045] Taking the above example, if the grayscale value pair of two adjacent pixels is (41, 42), the encoding dictionary can be searched based on this grayscale value pair. If a matching grayscale value combination (41, 42) exists in the encoding dictionary, it means that the grayscale value combination in the encoding dictionary has been matched. Then, the corresponding index of this grayscale value combination is searched, and this short corresponding index can be used as the encoding result of the adjacent pixel.
[0046] Traverse the adjacent pixel combinations in the industrial image and encode them in this way to obtain the encoding result of the adjacent pixel combinations.
[0047] In addition, for pixels in special locations in industrial images, such as pixels at the edge, or pixels that cannot be matched based on combinations of adjacent pixels, a single pixel matching and encoding method can be used.
[0048] Specifically, the step of encoding an industrial image using the grayscale value of a single pixel and its corresponding index to obtain the encoding result of a single pixel can be achieved in the following way: Obtain the grayscale value corresponding to a single pixel in the processed industrial image; search the encoding dictionary for a matching grayscale value based on the grayscale value of the single pixel; if a matching grayscale value is found, obtain the corresponding index of the matching grayscale value; obtain the encoding result of the single pixel based on the obtained corresponding index.
[0049] In this embodiment, for example, for a single pixel in an industrial image, if the grayscale value of the single pixel is 41, we can check if the encoding dictionary contains the grayscale value 41. If it does, it means that the encoding dictionary has been matched. Then, we look up the corresponding index for the grayscale value 41 and use this short corresponding index as the encoding result for the single pixel.
[0050] While performing industrial image encoding, the encoding dictionary can also be updated continuously based on the real-time status of the industrial images.
[0051] Specifically, in this embodiment, during the above process, if the gray value pair of adjacent pixel points does not have a matching gray value pair in the preloaded encoding dictionary, the gray value pair of adjacent pixel points is added to the encoding dictionary and the corresponding index is configured.
[0052] In addition, similarly, in the above process, if the gray value corresponding to a single pixel does not have a matching gray value in the encoding dictionary, the gray value corresponding to the single pixel is added to the encoding dictionary and the corresponding index is configured.
[0053] During the process of updating the encoding dictionary, the capacity of the encoding dictionary also needs to be considered. Specifically, the steps for updating the encoding dictionary may include the following sub-steps: Detect whether the dictionary capacity of the encoding dictionary has reached the preset maximum capacity; if it has reached the preset maximum capacity, delete gray value combinations or gray values in the encoding dictionary that have not been matched more than a preset number of times, and then perform the steps of adding the gray value pairs of the adjacent pixel points to the encoding dictionary or adding the gray value corresponding to the single pixel point to the encoding dictionary.
[0054] For example, the default maximum capacity of the encoding dictionary is 4096. If the dictionary's capacity has not reached this default maximum, entries can be added directly as described above. However, if the dictionary's capacity has reached the default maximum, a replacement operation is required. That is, first, find entries in the encoding dictionary that have not been matched or called for a long time, delete those entries, and then perform the addition operation.
[0055] The entry for which a long-term unmatched call is made can be a combination of grayscale values or a grayscale value in the encoding dictionary that has been matched more than a preset number of times. The preset number of times could be, for example, 3 times.
[0056] In the existing technology, the independent compression module adopts a single-core serial processing encoding method, and there is a delay of about 20ms in the data transmission between the ISP chip and the compression module through the external interface. The total delay of processing a single frame of 500W pixel image is more than 50ms, which cannot meet the real-time output requirements of industrial sensors at 30fps (single frame processing needs to be ≤33ms).
[0057] To address the aforementioned problems in the existing technology, in this embodiment, the compression module built into the ISP chip includes multiple parallel processing units. In one possible implementation, the step of encoding the processed industrial image based on a preloaded encoding dictionary to obtain the encoding result can be achieved in the following way: The processed industrial image is divided into multiple image sub-blocks; multiple parallel processing units in the compression module are used to perform parallel encoding processing on the multiple image sub-blocks based on a preloaded encoding dictionary to obtain sub-encoding results; the multiple sub-encoding results are fused to obtain the encoding result.
[0058] In this embodiment, the number of parallel processing units can be 4 or 8, etc. For example, if there is a 4-core parallel processing unit, the industrial image can be divided into 4 data blocks by row, such as dividing 500W pixel data into 4 125W image sub-blocks. If there is an 8-core parallel processing unit, the 500W pixel data can be divided into 8 62.5W image sub-blocks. If there is a 2-core parallel processing unit, the 500W pixel data can be divided into 2 250W image sub-blocks.
[0059] In one implementation, the industrial image can be divided into multiple image sub-blocks by dividing it into rows.
[0060] In another implementation, as described above, during the encoding process based on combinations of adjacent pixels, the contour boundaries in the image can be determined based on the grayscale value differences of adjacent pixel combinations. Therefore, the industrial image can be divided into multiple image sub-blocks based on the determined contour boundaries.
[0061] The encoding process of each image sub-block is executed synchronously by multiple parallel processing units, and the encoding results of each image sub-block are finally fused to obtain the final encoding result.
[0062] In this embodiment, a parallel encoding processing method is adopted, which can reduce the processing time of a single frame from 50ms in the prior art to 2ms. With the help of internal bus transmission, the total latency is controlled within 10ms, which meets the real-time requirements and the encoding efficiency can be improved by more than 30%.
[0063] Based on the above, the output module and compression module built into the ISP chip connect through a shared buffer to encapsulate the final encoded result data into AXI4 protocol data packets. The output rate is adjusted according to the requirements of the backend equipment (up to 200MHz) and directly transmitted to external systems, such as memory chips or industrial inspection systems.
[0064] Compared to the existing technology that uses an independent output interface, in this embodiment the output module and the compression module in the ISP chip share a cache, which reduces data transfer time and reduces output latency by more than 10ms.
[0065] In summary, the image lossless compression method provided in this embodiment is based on an ISP chip, which is an integrated design chip that integrates acquisition, preprocessing, compression and output.
[0066] Specifically, in this embodiment, an ISP architecture is customized based on the output characteristics of the industrial sensors to be adapted, and the sensor data acquisition, preprocessing, compression processing and data output modules are connected in series. The format conversion, Gaussian noise reduction and multi-core parallel computing units built into the ISP are reused to avoid the deployment of additional compression hardware and solve the problem of high hardware cost in traditional solutions.
[0067] In addition, an encoding algorithm adapted to industrial scenarios is adopted. During the initialization of the encoding dictionary, typical industrial scene grayscale value combinations (0-255 single grayscale value, grayscale pairs of adjacent pixels) output by industrial sensors are preloaded to adapt to the grayscale distribution characteristics of industrial images, improve encoding efficiency, and solve the problem of low compression ratio in existing solutions designed for consumer-grade sensors.
[0068] In addition, a multi-core parallel encoding optimization strategy is adopted to divide the standardized image data into multiple data blocks by row, and encode them synchronously through the ISP's built-in parallel computing unit. After encoding, the results are merged by row, reducing the processing time of a single frame of 500W pixel image to 2ms, thus solving the problem of high processing latency in traditional solutions.
[0069] Furthermore, a dynamic preprocessing adaptation mechanism is adopted, and the format is standardized to convert 12-bit RAW data into 32-bit parallel data within the ISP. The 3×3 window Gaussian noise reduction algorithm calls dynamic noise reduction coefficients to adapt to the pixel mode of industrial sensors, ensuring data compatibility and quality, and laying the foundation for subsequent lossless compression.
[0070] Compared with existing technologies, the lossless image compression method provided in this embodiment has at least the following beneficial effects: 1. Hardware costs reduced by over 30%, improved integration: This solution adopts an ISP architecture that reuses the built-in acquisition, preprocessing, parallel computing, and output units of the ISP. Existing technologies require the additional deployment of independent compression chips and supporting circuits. This solution integrates the compression function into the ISP, eliminating the need for additional hardware and directly reducing hardware costs. At the same time, modules are connected through an internal bus, reducing the number of external interfaces, improving integration, and adapting to the miniaturization requirements of industrial equipment.
[0071] 2. Processing latency reduced by 80%, meeting real-time requirements: This solution adopts a "multi-core parallel encoding + internal bus transmission + shared buffer merging" approach. Existing technologies use single-core serial encoding (48ms) + external interface transmission (2ms), with a total latency of 50ms. This solution uses multi-core (e.g., 4 cores) parallel encoding (2ms) + internal bus transmission (0.5ms) + shared buffer merging (0.3ms), with a total latency of ≤3ms. This is far lower than the 30fps real-time output requirement (≤33ms per frame) required by industrial sensors, making it applicable to online industrial inspection scenarios.
[0072] 3. Compression efficiency improved by 20%-30%, data volume significantly reduced: This solution adopts an "improved encoding method that preloads grayscale value combinations from industrial scenarios." The compression ratio of existing traditional encoding methods is 2.0-2.5:1. This solution, by preloading typical grayscale pairs and improving dictionary matching hit rate, increases the compression ratio to 3.0:1. A single frame of a 500W pixel image (originally 1.5MB) is compressed to 500KB after this invention, reducing the data volume by 16%-33% compared to existing technologies (600-750KB), thus reducing storage capacity requirements and alleviating transmission bandwidth pressure.
[0073] 4. Strong adaptability and stable processing accuracy: This solution adopts "dynamic noise reduction coefficient + sensor-specific interface optimization". Under different pixel modes, this invention dynamically adjusts the noise reduction coefficient. High pixel mode (500W) achieves more thorough noise reduction, while low pixel mode (200W) avoids excessive noise reduction. After noise reduction, the signal-to-noise ratio of the data remains stable above 45dB. Simultaneously, the optimized dedicated interface improves acquisition stability. The PSNR of the decompressed image is ∞ compared to the original image, ensuring complete losslessness and meeting the high-precision requirements for dimensional measurement and defect identification in industrial inspection.
[0074] Based on the same inventive concept, please refer to Figure 5 This invention also provides a functional module diagram of a lossless image compression system. This embodiment divides the lossless image compression system into functional modules based on the above method embodiments. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this embodiment is illustrative and represents only one logical functional division; other division methods may be used in actual implementation.
[0075] For example, when dividing functional modules according to their respective functions, Figure 5 The image lossless compression system shown is only a schematic diagram. The image lossless compression system may include an acquisition unit, a preprocessing unit, an encoding unit, and a transmission unit. The functions of each module of this image lossless compression system will be described in detail below.
[0076] The acquisition unit is used to obtain industrial images acquired by the industrial sensor; The preprocessing unit is used to perform format conversion and noise suppression processing on the industrial image; The encoding unit is used to encode the processed industrial image based on a preloaded encoding dictionary to obtain the encoding result, and to update the encoding dictionary. The preloaded encoding dictionary includes the gray value corresponding to a single pixel and its corresponding index, as well as the gray value combination corresponding to the combination of adjacent pixels and its corresponding index. The transmission unit is used to post-process the encoding result and transmit the post-processed encoding result to an external system.
[0077] The image lossless compression system provided in this embodiment can be used to execute the image lossless compression method under any of the above embodiments. For details not covered in this embodiment, please refer to the corresponding descriptions in the above embodiments. This embodiment will not elaborate further here.
[0078] Please see Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. The electronic device can be a computer device, a server, etc., and may include an ISP chip. The electronic device also includes a memory, a processor, and a communication module. The memory, processor, and communication module are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0079] The memory is used to store computer programs or data. Memory can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc.
[0080] The processor is used to read / write data or programs stored in the memory and to execute the image lossless compression method provided in any embodiment of the present invention.
[0081] The communication module is used to establish communication connections between electronic devices and other communication terminals via a network, and to send and receive data via the network.
[0082] It should be understood that, Figure 6 The structure shown is only a schematic diagram of an electronic device; the electronic device may also include components that are larger than those shown. Figure 6 The more or fewer components shown, or having the same Figure 6The different configurations shown.
[0083] Furthermore, embodiments of the present invention also provide a computer-readable storage medium storing machine-executable instructions, which, when executed, implement the image lossless compression method provided in the above embodiments.
[0084] Specifically, the computer-readable storage medium can be a general-purpose storage medium, such as a removable disk or hard disk. When the computer program on the computer-readable storage medium is executed, it can perform the aforementioned lossless image compression method. The processes involved in the execution of the executable instructions on the computer-readable storage medium can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0085] In the embodiments provided by this invention, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and there may be other division methods in actual implementation. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the coupling or direct coupling or communication connection shown or discussed may be through some communication interface; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0086] Furthermore, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0087] Furthermore, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0088] It should be noted that if the functionality is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0089] The above are merely embodiments of the present invention and are not intended to limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A lossless image compression method, characterized in that, The method, applied to an ISP chip that communicates with industrial sensors, includes: Obtain the industrial images captured by the industrial sensor; The industrial images are subjected to format conversion and noise suppression processing. The processed industrial image is encoded based on a preloaded encoding dictionary to obtain the encoding result, and the encoding dictionary is updated. The preloaded encoding dictionary includes the gray value corresponding to a single pixel and its corresponding index, as well as the gray value combination corresponding to the combination of adjacent pixels and its corresponding index. The encoded result is post-processed, and the post-processed encoded result is transmitted to an external system.
2. The image lossless compression method according to claim 1, characterized in that, The ISP chip includes a built-in acquisition module, and the step of obtaining the industrial image acquired by the industrial sensor includes: Configure the industrial sensor with the following settings: pixel resolution and frame rate. Based on the configuration information, the industrial images output by the industrial sensor are acquired through the acquisition module.
3. The image lossless compression method according to claim 1, characterized in that, The step of performing noise suppression processing on the industrial image includes: Obtain the pixel resolution of the industrial sensor, and obtain the correspondence between different pixel resolutions and different noise reduction coefficients; The corresponding target noise reduction coefficient is determined based on the pixel resolution and the correspondence. The industrial image is subjected to noise suppression processing based on the target noise reduction coefficient.
4. The image lossless compression method according to claim 1, characterized in that, The ISP chip includes a built-in compression module. The step of encoding the processed industrial image based on a preloaded encoding dictionary to obtain the encoding result includes: The compressed module is used to encode the processed industrial image based on the gray value combination and its corresponding index of adjacent pixel combination in the preloaded encoding dictionary, so as to obtain the encoding result of adjacent pixel combination. The processed industrial image is encoded using the grayscale value and its corresponding index of a single pixel in the encoding dictionary to obtain the encoding result of a single pixel. The final encoding result is obtained by combining the encoding results of adjacent pixel combinations and the encoding results of single pixels.
5. The image lossless compression method according to claim 4, characterized in that, The step of encoding the processed industrial image using the compression module and based on the grayscale value combinations and corresponding indices of adjacent pixel combinations in the preloaded encoding dictionary to obtain the encoding result of adjacent pixel combinations includes: The compression module is used to combine two adjacent pixels in the processed industrial image into adjacent pixel combinations. Obtain the gray value pairs of the adjacent pixel combinations, and search in the preloaded encoding dictionary whether there is a matching gray value combination based on the gray value pairs. If there is a matching gray value combination, obtain the corresponding index of the matching gray value combination. The encoding result of the adjacent pixel combination is obtained based on the corresponding index.
6. The image lossless compression method according to claim 5, characterized in that, The step of encoding the processed industrial image using the grayscale value and its corresponding index of a single pixel in the encoding dictionary to obtain the encoding result of a single pixel includes: Obtain the grayscale value corresponding to a single pixel in the processed industrial image; Based on the gray value corresponding to the single pixel, search the encoding dictionary to see if there is a matching gray value; If a matching grayscale value is found, the corresponding index of the matching grayscale value is obtained; The encoding result of a single pixel is obtained based on the corresponding index.
7. The image lossless compression method according to claim 6, characterized in that, The step of updating the encoding dictionary includes: If there is no matching grayscale value combination, the grayscale value pairs of the adjacent pixel points are added to the encoding dictionary, and the corresponding index is configured. If no matching grayscale value is found, the grayscale value corresponding to the single pixel is added to the encoding dictionary, and the corresponding index is configured.
8. The image lossless compression method according to claim 7, characterized in that, The step of updating the encoding dictionary further includes: Detect whether the capacity of the encoded dictionary has reached the preset maximum capacity; If the preset maximum capacity is reached, delete the grayscale value combinations or grayscale values in the encoding dictionary that have not been matched more than a preset number of times, and then perform the steps of adding the grayscale value pairs of the adjacent pixel points to the encoding dictionary or adding the grayscale value corresponding to the single pixel point to the encoding dictionary.
9. The image lossless compression method according to claim 1, characterized in that, The ISP chip includes a built-in compression module, which comprises multiple parallel processing units. The step of encoding the processed industrial image based on a preloaded encoding dictionary to obtain the encoding result includes: The processed industrial image is divided into multiple image sub-blocks; The multiple image sub-blocks are processed in parallel using multiple parallel processing units in the compression module and based on a preloaded encoding dictionary to obtain sub-encoding results. The results of multiple sub-encodings are merged to obtain the final encoding result.
10. A lossless image compression system, characterized in that, The system includes an ISP chip that communicates with industrial sensors. The acquisition unit is used to obtain industrial images acquired by the industrial sensor; The preprocessing unit is used to perform format conversion and noise suppression processing on the industrial image; The encoding unit is used to encode the processed industrial image based on a preloaded encoding dictionary to obtain the encoding result, and to update the encoding dictionary. The preloaded encoding dictionary includes the gray value corresponding to a single pixel and its corresponding index, as well as the gray value combination corresponding to the combination of adjacent pixels and its corresponding index. The transmission unit is used to post-process the encoding result and transmit the post-processed encoding result to an external system.