An image storage method, an image storage apparatus, and a computer storage medium

By generating visual saliency maps for region segmentation and adaptive encoding, and combining mapping indexes and inverted indexes, the problem of balancing image storage efficiency and visual quality in existing technologies is solved, achieving efficient image storage and retrieval.

CN121705445BActive Publication Date: 2026-05-15数盾信息科技股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
数盾信息科技股份有限公司
Filing Date
2026-02-11
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing image storage methods ignore the spatial importance differences of image content, resulting in loss of detail in key areas or redundant storage in secondary areas. This makes it difficult to achieve the optimal balance between storage efficiency and visual quality, and they also lack structured metadata and efficient retrieval capabilities.

Method used

By calculating local contrast and edge density to generate a visual saliency map for region segmentation, and combining the adaptive rate-distortion benchmark value with the quantization step size and encoding strategy, a mapping index from region ID to physical address offset value and an inverted index based on visual saliency level are constructed to achieve adaptive encoding and efficient retrieval.

Benefits of technology

It achieves superior rate-distortion performance, improves the balance between storage efficiency and visual quality, enhances image retrieval and browsing efficiency, and is suitable for intelligent image storage in resource-constrained environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121705445B_ABST
    Figure CN121705445B_ABST
Patent Text Reader

Abstract

The application discloses an image storage method, an image storage device and a computer storage medium, and relates to the technical field of image processing and storage. The method comprises the following steps: acquiring original data through an image acquisition sensor, calculating local contrast and edge density, and fusing to generate a visual saliency map; obtaining an average visual saliency value of each region through region segmentation; calculating statistical variance and a global peak value according to the value of all regions to generate an adaptive rate distortion reference value; comparing the value of each region with the reference value to determine a quantization step and a visual saliency level, adaptively encoding the region to form a composite data stream; calculating the geometric center and area proportion of each region, packaging the data into metadata, and packing and storing the metadata with the encoded stream; and constructing a mapping index of region identification to a physical address and an inverted index based on the visual saliency level. The application can improve the storage space utilization rate and optimize the image quality of important regions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing and storage technology, and in particular to an image storage method, an image storage device, and a computer storage medium. Background Technology

[0002] With the widespread adoption of high-definition imaging equipment, the volume of image data has surged, placing higher demands on the capacity, efficiency, and access speed of storage systems. Traditional storage methods employ a globally uniform compression strategy, neglecting the spatial differences in the importance of image content. This leads to loss of detail in critical areas or redundant storage in secondary areas, making it difficult to achieve an optimal balance between storage efficiency and visual quality. While existing region-based encoding methods attempt differentiated compression, region division often relies on fixed grids or simple color segmentation, failing to incorporate visual attention mechanisms. Furthermore, compression parameters often depend on fixed thresholds, making dynamic adjustment based on image content impossible. In addition, the lack of structured metadata and efficient indexing after storage results in inefficient retrieval and access based on visual attributes. Therefore, there is an urgent need for an intelligent image storage method that can simulate visual attention mechanisms, achieve content-adaptive encoding, and support efficient retrieval. Summary of the Invention

[0003] This invention proposes an image storage method, comprising:

[0004] S1. Obtain raw image data through an image acquisition sensor, calculate its local contrast value and edge density value, fuse them to generate a visual saliency map, and perform region segmentation based on the map to obtain a region division map and the average visual saliency value of each region.

[0005] S2. Based on the regional average visual saliency values ​​of all regions, calculate their statistical variance and global peak value based on the histogram, and then weight and fuse them to generate an adaptive rate-distortion benchmark value.

[0006] S3. Compare the average visual saliency value of each region with the adaptive rate distortion baseline value, calculate the difference and determine the quantization step size value based on the difference, and calculate the visual saliency level value. Perform lossless or lossy encoding on all regions and then interleave them into a composite encoded data stream.

[0007] S4. Calculate the geometric center coordinates and area percentage of each region, and encapsulate them together with the region's average visual saliency value, visual saliency level value, and quantization step size value into descriptive metadata. Pack the descriptive metadata and composite encoded data stream together and write them into the image storage device.

[0008] S5. In the computer storage medium, construct a mapping index from region ID to physical address offset for each data packet, and construct an inverted index based on the visual saliency level value, associating the root node information of the two-level index to the corresponding data packet.

[0009] An image storage method as described above, wherein raw image data is acquired through an image acquisition sensor, its local contrast value and edge density value are calculated, fused to generate a visual saliency map, and region segmentation is performed based on the map to obtain a region segmentation map and the average visual saliency value of each region, including the following sub-steps:

[0010] The image sensor is used to acquire raw image data. A preset sliding window is used to traverse the position of each pixel in the image, and the standard deviation of the pixel gray value within the window is calculated as the local contrast value.

[0011] The Canni edge detection operator is used to perform edge detection on the original image data. The number of edge pixels in each sliding window is counted and the ratio of the edge pixel count to the total area of ​​the window is calculated to obtain the edge density value.

[0012] After processing the local contrast values ​​and edge density values, a visual saliency map is generated.

[0013] An image storage method as described above, wherein the statistical variance of the region average visual saliency value of all regions is calculated and the global peak value based on the histogram is weighted and fused to generate an adaptive rate-distortion benchmark value, includes the following sub-steps:

[0014] Statistical analysis was performed on the regional average visual saliency values ​​of all regions, and the statistical variance was calculated to reflect the degree of dispersion of visual saliency in each region.

[0015] Calculate the distribution histogram of the regional average visual saliency values ​​for all regions, and extract the visual saliency value corresponding to the highest peak in the histogram as the global peak.

[0016] The statistical variance value and the global peak value are weighted and fused to generate an adaptive rate distortion benchmark value.

[0017] An image storage method as described above, wherein the average visual saliency value of each region is compared with an adaptive rate-distortion benchmark value, the difference is calculated and the quantization step size is determined based on the difference, and the visual saliency level value is calculated simultaneously, and lossless or lossy encoding is performed on all regions and then interleaved into a composite coded data stream, includes the following sub-steps:

[0018] For each region, the difference between its average visual saliency value and the adaptive rate distortion baseline value is calculated, and the quantization step size and visual saliency level value of the region are determined based on the difference and preset rules.

[0019] The region type is determined based on the visual saliency level value: if it is a high saliency level, a lossless encoding algorithm is used to encode the original data of the region; if it is a low saliency level, a lossy encoding algorithm combined with the quantization step size value is used for encoding.

[0020] All regions are arranged in a preset order, their encoded data blocks are concatenated sequentially, and synchronization markers and region header information are added to generate a composite encoded data stream.

[0021] An image storage method as described above, wherein for each region, the difference between its average visual saliency value and the adaptive rate-distortion benchmark value is calculated, and the quantization step size and visual saliency level value of the region are determined based on the difference and a preset rule, including the following sub-steps:

[0022] The absolute value of the difference is mapped to a preset quantization step size range, and the basic quantization step size value is obtained by looking up a table or by linear interpolation.

[0023] The statistical variance of the average visual saliency value of the region is introduced as a correction factor to fine-tune the basic quantization step size value, thus obtaining the final quantization step size value.

[0024] Based on the multiple preset threshold intervals to which the difference belongs, the corresponding visual saliency level value is directly mapped and determined.

[0025] The image storage method described above, wherein the geometric center coordinates and area proportion of each region are calculated, and these, along with the region's average visual saliency value, visual saliency level value, and quantization step size value, are encapsulated into descriptive metadata. The descriptive metadata is then packaged with a composite encoded data stream and written to the image storage device. This method includes the following sub-steps:

[0026] Extract the pixel coordinate information of each connected region in the region partitioning map, calculate the arithmetic mean of all pixel coordinates in that region, and obtain the geometric center coordinate value;

[0027] Count the total number of pixels in each connected region and calculate its ratio to the total number of pixels in the entire image to obtain the area percentage.

[0028] The geometric center coordinates, area percentage, average visual saliency of the region, visual saliency level, and quantization step size are encapsulated into descriptive metadata according to a preset data structure format.

[0029] The image storage method described above, wherein in the computer storage medium, a mapping index from region ID to physical address offset is constructed for each data packet, and an inverted index is constructed based on visual saliency level values, associating the root node information of the two-level index with the corresponding data packet, includes the following sub-steps:

[0030] A unique region identifier is assigned to each data packet, the starting physical address offset of the encoded data stream in the image storage device is recorded, and a mapping index structure between the region identifier and the physical address offset is established.

[0031] Extract the visual saliency level values ​​of all regions, group the region identifiers according to the level values, and construct an inverted index structure with the visual saliency level values ​​as keys and the corresponding list of region identifiers as values;

[0032] The root node address of the mapped index and the root node address of the inverted index are used as metadata information and associated with the corresponding data packet header.

[0033] The present invention also proposes an image storage device, comprising:

[0034] Visual saliency acquisition module: Acquires raw image data through image acquisition sensor, calculates its local contrast value and edge density value, fuses them to generate a visual saliency map, and performs region segmentation based on the map to obtain a region division map and the average visual saliency value of each region.

[0035] The adaptive quantization coding module calculates the statistical variance and global peak value based on the regional average visual saliency value of all regions, and weights them together to generate an adaptive rate-distortion baseline value. It compares the regional average visual saliency value of each region with the adaptive rate-distortion baseline value, calculates the difference, determines the quantization step size value based on the difference, and calculates the visual saliency level value. After performing lossless or lossy coding on all regions, the data is interleaved into a composite coded data stream.

[0036] Storage and Indexing Module: Calculates the geometric center coordinates and area percentage of each region, and encapsulates them together with the region's average visual saliency value, visual saliency level value, and quantization step size value into descriptive metadata. Packs the descriptive metadata and composite encoded data stream and writes it to the image storage device. In the computer storage medium, it constructs a mapping index from region ID to physical address offset for each data packet, and constructs an inverted index based on the visual saliency level value, associating the root node information of the two-level index to the corresponding data packet.

[0037] The present invention also proposes a computer storage medium, comprising: at least one memory and at least one processor;

[0038] Memory, used to store one or more program instructions;

[0039] A processor for executing one or more program instructions to perform an image storage method as described above.

[0040] The beneficial effects achieved by this invention are as follows:

[0041] (1) From the perspective of balancing storage efficiency and visual quality, a visual saliency map is generated by calculating local contrast and edge density, and region segmentation is performed accordingly, making the region division more in line with the characteristics of human visual attention. Combined with an adaptive rate-distortion benchmark, appropriate quantization step size and encoding strategy are assigned to regions of different visual importance. While ensuring high-quality storage of key regions, secondary regions are effectively compressed, and overall, better rate-distortion performance is achieved.

[0042] (2) In terms of adaptive processing capability, the statistical variance and global peak value are calculated based on the image content itself, and a rate-distortion benchmark is dynamically generated, avoiding the problem of poor adaptability of a fixed threshold to different images. The encoding strategy and parameters are dynamically determined based on the difference between the regional visual saliency and the benchmark, which improves the robustness and versatility of the method.

[0043] (3) In terms of data organization and retrieval efficiency, by encapsulating descriptive metadata containing multi-dimensional information such as geometry, statistics, and semantics, and storing it in an integrated manner with the coded data stream, a rich foundation is provided for image content understanding. The constructed region mapping index and the inverted index based on visual saliency level greatly accelerate the image retrieval, browsing, and intelligent analysis process based on region or visual importance level.

[0044] (4) This method realizes intelligent processing of the entire process from image perception, analysis, compression to storage and indexing, deeply integrates visual attention mechanism with storage technology, significantly improves the overall performance of image storage system in resource-constrained environment, and can be widely used in fields with high requirements for storage efficiency and intelligent retrieval, such as security monitoring, medical image management, digital library, cloud photo album. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0046] Figure 1 This is a flowchart of an image storage method provided in an embodiment of this application.

[0047] Figure 2 This is a schematic diagram of an image storage device provided in an embodiment of this application. Detailed Implementation

[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0049] Example 1

[0050] like Figure 1 As shown in the figure, an image storage method according to an embodiment of this application includes:

[0051] Step S1: Acquire raw image data through an image acquisition sensor, calculate its local contrast value and edge density value, fuse them to generate a visual saliency map, and perform region segmentation based on the map to obtain a region division map and the average visual saliency value of each region.

[0052] Specifically, the raw data output by the image sensor is expanded pixel by pixel within a sliding window. The standard deviation of the window's grayscale forms the local contrast, and the proportion of edge pixels detected by the Cannibal operator constitutes the edge density. After feature-weighted fusion of the two, a visual saliency map is obtained. Connected regions are extracted through threshold segmentation, and the average saliency of the regions is calculated, providing a unified input for subsequent adaptive encoding and fast indexing. The specific steps include the following:

[0053] Step S11: Use an image sensor to acquire raw image data, traverse the position of each pixel in the image with a preset sliding window, and calculate the standard deviation of the pixel gray value within the window as the local contrast value.

[0054] Raw image data is acquired using a high-resolution image sensor, and a sliding window of a preset size traverses each pixel position in the image. The size of the sliding window is dynamically adjusted according to the image resolution and application scenario to ensure accurate capture of local features. For each window position, the local contrast value is obtained by calculating the weighted standard deviation of the grayscale values ​​of all pixels within it. During the calculation process, a moving average technique is used to optimize computational efficiency, reduce redundant calculations, and a boundary handling mechanism is introduced to avoid window out-of-bounds issues.

[0055] Step S12: Use the Canni edge detection operator to perform edge detection on the original image data, count the number of edge pixels in each sliding window and calculate the ratio of the edge pixel count to the total area of ​​the window to obtain the edge density value;

[0056] Gaussian filtering is applied to the image to smooth noise. Gradient magnitude and direction are calculated, and local gradient maxima are preserved through non-maximum suppression. Finally, a double thresholding method is used to detect strong and weak edges, which are then connected to form complete edges. For each sliding window, the number of pixels marked as edges within the window is counted, and the ratio of this number to the total number of pixels in the window is calculated to obtain the edge density value. The edge density value reflects the richness of edge information within a region. The density value is characterized, and a window overlap strategy is used to reduce the impact of edge breakage.

[0057] Step S13: After processing the local contrast value and edge density value, a visual saliency map is generated;

[0058] The two feature values ​​are characterized separately to fall within the range of 0 to 1, eliminating dimensional differences. An adaptive weighted fusion algorithm is used to dynamically adjust the weight coefficients based on global image features. After fusion, a threshold segmentation method is applied to binarize the saliency map, extract connected regions, and calculate the average pixel saliency value of each region to generate a region partitioning map. The average pixel saliency value of each region is expressed by the following formula:

[0059]

[0060] in, This represents the average visual saliency value; Indicates the first Connected regions The number of pixels contained; This represents the weight hyperparameter, used to balance the contributions of color / contrast features and edge / texture features to saliency; Represents pixels Color characteristic values; This represents the global mean of color features across the entire image. The global standard deviation of color features across the entire image; It represents extremely small positive numbers, used to avoid denominators of 0 and to ensure the stability of numerical calculations; Scaling parameters representing edge features; Represents the edge feature value of a pixel; Represents the regularization coefficient; This represents a Gaussian dynamic weight modulation term;

[0061] During segmentation, morphological operations such as opening and closing operations are used to optimize region boundaries, avoiding over-segmentation or under-segmentation, and ensuring the accuracy and consistency of region division. Finally, the average visual saliency value of the regions provides a quantitative basis for subsequent storage and indexing.

[0062] Step S2: Calculate the statistical variance and the global peak value based on the histogram of the average visual saliency values ​​of all regions, and then weight and fuse them to generate an adaptive rate-distortion baseline value.

[0063] Specifically, the statistical variance value is obtained by performing a dispersion calculation on the overall sample of the regional average visual saliency value of each region. At the same time, a distribution histogram is constructed and its highest peak is located as the global peak. Then, the statistical variance and the global peak are weighted and synthesized with preset weights to obtain an adaptive rate-distortion benchmark value that dynamically changes with the image content, which is used for subsequent quantitative decision-making. The specific steps include the following:

[0064] Step S21: Perform statistical analysis on the regional average visual saliency values ​​of all regions and calculate their statistical variance values ​​to reflect the degree of dispersion of visual saliency in each region.

[0065] After region segmentation and visual saliency extraction of each region, the average visual saliency values ​​of all regions were used as a sample dataset for statistical analysis. First, the mean of this dataset was calculated to characterize the overall concentration trend of visual attention. Then, based on this mean, the statistical variance was calculated. This process involves summing and characterizing the squared differences between the visual saliency value of each region and the overall mean. This variance quantitatively describes the fluctuation and dispersion of visual appeal among different regions within the image: a lower variance indicates a more uniform distribution of image content at the visual saliency level, with visual attention points being more dispersed; a higher variance means that there are regions in the image whose visual saliency deviates significantly from the average level, i.e., the visual focus is more concentrated, and some regions are more visually prominent.

[0066] Step S22: Calculate the distribution histogram of the regional average visual saliency value of all regions, and extract the visual saliency value corresponding to the highest peak in the histogram as the global peak.

[0067] The range of visual saliency values ​​is divided into a series of continuous and equally wide intervals. The number of regions falling into each interval is counted, forming a histogram reflecting the frequency distribution of saliency values. This histogram is smoothed to suppress minor fluctuations that may be caused by the randomness of interval division, thereby accurately identifying the global peak point of the histogram. The visual saliency value corresponding to this peak point is the saliency level of the region that appears most frequently in the current image, and it is defined as the global peak. This global peak characterizes the most representative visual saliency in the image, reflecting the dominant feature of visual content in a statistical sense, and is another important indicator for measuring the concentration intensity of overall visual saliency in an image.

[0068] Step S23: Weight and fuse the statistical variance value with the global peak value to generate an adaptive rate distortion benchmark value;

[0069] The two indicators are processed separately to eliminate dimensional differences and bring them to the same numerical scale. Based on prior knowledge and experimental analysis of image compression and visual fidelity applications, preset weight coefficients are assigned to the variance and peak values. These two weight coefficients determine the relative importance of the dispersion and central tendency indicators in the final benchmark. The weighted fusion process uses a linear weighted summation model to combine the variance and peak values ​​according to their corresponding weights, ultimately generating an adaptive rate-distortion benchmark value, expressed by the following formula:

[0070]

[0071] in, This represents the adaptive rate distortion baseline value; This represents the average significance value across all regions. The variance; Indicates the regional average significance and median. The mean absolute deviation; Indicates the first The average visual saliency value of each connected region; This represents the average significance value across all regions. the median; This represents the total number of connected components obtained after image segmentation; This indicates a preset weighting coefficient that satisfies... ; This represents the global peak value of the histogram of regional average significance. This represents the average significance value across all regions. The mean; Indicates global peak value The logarithmic transformation term; This represents the hyperbolic tangent transformation term of variance and mean.

[0072] This benchmark value is dynamically adjusted based on the dispersion and central tendency of the visual saliency distribution in the input image region. A higher value usually indicates that the visual content of the image is more complex or the visual focus is more concentrated. In the subsequent rate-distortion optimization quantization decision, the compression parameters will be adaptively adjusted based on this dynamic benchmark.

[0073] Step S3: Compare the average visual saliency value of each region with the adaptive rate distortion baseline value, calculate the difference and determine the quantization step size value based on the difference, and calculate the visual saliency level value. Perform lossless or lossy encoding on all regions and then interleave them into a composite encoded data stream.

[0074] Specifically, the average visual saliency value of each region is subtracted from the adaptive rate-distortion baseline value. The difference is then mapped using absolute value mapping, table lookup, or linear interpolation to obtain the basic quantization step size value. After fine-tuning with statistical variance as a correction factor, the final quantization step size value is output. Simultaneously, the visual saliency level is directly mapped based on the threshold range of the difference. High-level regions use lossless encoding to retain all information, while low-level regions undergo lossy encoding to compress redundancy, combined with the quantization step size value. After all regions are encoded, data blocks are concatenated in a preset order and embedded with synchronization markers and region header information to form a structured composite encoded data stream. This achieves high-fidelity adaptive storage of visually important regions and high-compression of background regions. The specific steps include the following:

[0075] Step S31: For each region, calculate the difference between its average visual saliency value and the adaptive rate distortion benchmark value, and determine the quantization step size and visual saliency level value of the region based on the difference and preset rules.

[0076] Step S311: Map the absolute value of the difference to a preset quantization step size interval, and obtain the basic quantization step size value by looking up a table or by linear interpolation.

[0077] The absolute value of the difference between the calculated regional average visual saliency and the adaptive rate-distortion baseline value is input into a pre-calibrated nonlinear mapping relationship. Based on statistical analysis of a large amount of visual sensitivity test data, the proposed quantization step size intervals corresponding to different ranges of saliency differences are clearly defined. The mapping process directly obtains the matching value through table lookup or performs smooth calculation within the interval boundaries using piecewise linear interpolation, thereby outputting a basic quantization step size value for the current region.

[0078] Step S312: Introduce the statistical variance of the average visual saliency value of the region as a correction factor to fine-tune the basic quantization step size value to obtain the final quantization step size value;

[0079] To improve the adaptability of quantization parameters to the complexity within a region, the statistical variance of the visual saliency value of that region is introduced as a dynamic correction factor. The correction logic is as follows: When the variance within a region is large, it indicates uneven distribution of visual attention and rich detail, requiring a contraction coefficient to be applied to the basic quantization step size to reduce compression intensity and preserve local highly saliency details; when the variance is small, it means that the region's content is homogeneous, allowing an expansion coefficient to be applied to the basic step size to further improve overall compression efficiency. The correction coefficient is generated through a smoothing function with variance as input, ultimately fine-tuning the basic quantization step size and outputting a final quantization step size value that matches the internal structural characteristics of the region. The final quantization step size value is expressed by the following formula:

[0080]

[0081] in, This represents the final quantization step size value; Indicates the basic quantization step size; Indicates the first The average visual saliency value of each connected region; This represents the global adaptive rate-distortion baseline value; Empirical parameters representing the range of control adjustment; Represents the Gaussian error function; Indicates the first The variance of pixel saliency within each region; Indicates the first The mean saliency of pixels within each region; An empirical parameter representing the range of control adjustment.

[0082] Step S313: Based on the multiple preset threshold intervals to which the difference belongs, directly map and determine the corresponding visual saliency level;

[0083] Based on the saliency difference calculated in the previous steps, it is compared with multiple predefined threshold intervals. These threshold intervals are determined by a comprehensive trade-off between visual perception experiments and coding performance, dividing the difference range into several consecutive levels such as "high positive bias," "low positive bias," "near-zero bias," "low negative bias," and "high negative bias." The comparison process uses a direct mapping rule, meaning that the region is directly assigned the corresponding visual saliency level label based on which threshold interval the difference falls into. This level label, as key metadata, determines the core path of subsequent coding processes, thus achieving rapid classification and determination of the visual importance level of a region at the parameter level.

[0084] Step S32: Determine the region type based on the visual saliency level value: If it is a high saliency level, use a lossless encoding algorithm to encode the original data of the region; if it is a low saliency level, use a lossy encoding algorithm that combines the quantization step size value to encode.

[0085] Based on the visual saliency level determined in step S31, the system automatically classifies each region into two types: high saliency level and low saliency level. For high saliency level regions, a lossless coding algorithm is used to directly encode their original pixel data, ensuring the complete preservation of information in visually important regions and avoiding distortion introduced by compression. For low saliency level regions, a lossy coding algorithm is used for compression processing based on the quantization step size value calculated in step S31. Both coding paths are executed under a unified coding framework, ensuring that the output data remains consistent in structure and syntax, facilitating subsequent streaming encapsulation and decoding reconstruction.

[0086] Step S33: Arrange all regions in a preset order, concatenate their encoded data blocks sequentially, and add synchronization markers and region header information to generate a composite encoded data stream;

[0087] After independently encoding all regions, the data blocks generated from each region's encoding are sequentially concatenated according to a preset spatial order or descending visual saliency order. To ensure the resolvability of the data stream during transmission or storage, a synchronization marker and region header information are inserted before each data block. The header information contains key metadata such as the region's coordinate range, encoding type, quantization parameters, and visual saliency level. Finally, all the marked data blocks are combined sequentially to generate a well-structured, self-describing composite encoded data stream.

[0088] Step S4: Calculate the geometric center coordinates and area percentage of each region, and encapsulate them together with the region's average visual saliency value, visual saliency level value, and quantization step size value into descriptive metadata. Pack the descriptive metadata and composite encoded data stream together and write them into the image storage device.

[0089] Specifically, the geometric center coordinates are obtained by extracting the pixel coordinate sets of each connected region in the region partitioning map and calculating their arithmetic mean. Simultaneously, the area percentage is calculated by calculating the ratio of the total number of pixels in the region to the total number of pixels in the entire image. Then, the geometric center coordinates, area percentage, and the generated average visual saliency value, visual saliency level value, and quantization step size value are encapsulated into descriptive metadata according to a preset data structure. This metadata is then combined with the composite encoded data stream to form a data packet with header information, which is written to the corresponding physical block of the image storage device via the storage interface. This completes the binding and disk storage of region-level semantic information with the compressed bitstream. The specific steps include the following:

[0090] Step S41: Extract the pixel coordinate information of each connected region in the region partitioning map, calculate the arithmetic mean of all pixel coordinates in the region, and obtain the geometric center coordinate value.

[0091] A regional pixel coordinate acquisition mechanism is employed to traverse each connected component, recording its row and column coordinates pixel by pixel and storing them in a dynamic coordinate buffer. The coordinate set is statistically summarized through cumulative summation and counting, followed by division to obtain the arithmetic mean of the horizontal and vertical coordinates, which represents the geometric center coordinates of the region. During this process, coordinate deduplication and outlier pixel filtering strategies are introduced to eliminate coordinate anomalies caused by image noise or edge adhesion. Simultaneously, floating-point precision is used to retain coordinate values, supporting subsequent high-precision semantic localization and region matching.

[0092] Step S42: Count the total number of pixels in each connected region and calculate its ratio to the total number of pixels in the whole image to obtain the area ratio.

[0093] While completing the region pixel traversal and coordinate acquisition, a counter is used to accumulate the number of effective pixels in each connected region in real time to obtain the total number of pixels in the region; then, the total number of pixels in the global image parameters is read, and the region pixel count is divided by it to obtain the area percentage of the region in the whole image. The area percentage is expressed by the following formula:

[0094]

[0095] in, Indicates the area Visually weighted area percentage; Indicates the area The total number of pixels included; This represents the total number of connected regions obtained by segmenting the entire image; This represents the minimum number of pixels in all connected regions; This represents the maximum number of pixels in all connected regions.

[0096] To adapt to image processing at different resolutions, a scaling factor and dynamic range adjustment mechanism are introduced to ensure that the proportion values ​​are comparable at different scales. At the same time, a proportion threshold screening mechanism is established to mark regions that are too small or whose proportion is below a set threshold for selective processing during subsequent semantic encapsulation.

[0097] Step S43: Encapsulate the geometric center coordinates, area percentage, average visual saliency of the region, visual saliency level, and quantization step size into descriptive metadata according to a preset data structure format.

[0098] A multi-layered nested metadata structure is designed, sequentially writing geometric center coordinates, area percentage, average visual saliency, visual saliency level, and quantization step size. A byte alignment and header identifier mechanism is employed, setting a version identifier and length field at the beginning of the metadata for quick location during parsing; a checksum field is also introduced to perform cyclic redundancy checks on the metadata content. After encapsulation, the metadata and composite encoded data stream are assembled according to a packet structure to form a region semantically enhanced image data packet with strong self-descriptiveness and support for fast retrieval.

[0099] Step S5: In the computer storage medium, construct a mapping index from region ID to physical address offset for each data packet, and construct an inverted index based on the visual saliency level value, associating the root node information of the two-level index to the corresponding data packet;

[0100] Specifically, each data packet is injected with a unique region identifier, and its encoded stream's starting physical address offset in the storage device is locked, forming a mapping index from region identifier to address; all visual saliency level values ​​are synchronously summarized, and region identifiers are grouped and collected according to level to establish an inverted index with level as the key and the list of region identifiers as the value; the root node addresses of the two-level index are written into the data packet header metadata, so that the mapping and inverted information are persisted with the packet, enabling the simultaneous acquisition of physical address and saliency level with a single location, supporting subsequent millisecond-level content retrieval. This includes the following sub-steps:

[0101] Step S51: Assign a unique region identifier to each data packet, record the starting physical address offset value of the encoded data stream in the image storage device, and establish a mapping index structure between the region identifier and the physical address offset value.

[0102] In the storage system, a globally unique region identifier is generated for each data packet. This identifier is typically composed of a packet generation timestamp, device identifier, and sequence number, ensuring its uniqueness and traceability in the distributed storage environment. Simultaneously, the system records the exact starting offset address of the corresponding image-encoded data stream in the physical storage device. This address is byte-level and a one-to-one mapping is established between it and the region identifier. Based on this, a hash-accelerated mapping index structure is constructed. This structure uses a combination of multi-level B+ trees and hash tables to achieve extremely fast lookup from region identifier to physical address.

[0103] Step S52: Extract the visual saliency level values ​​of all regions, group the region identifiers according to the level values, and construct an inverted index structure with the visual saliency level values ​​as keys and the corresponding region identifier list as values;

[0104] In the storage preprocessing stage, visual saliency calculation and grading have been completed for each image region, with grading values ​​typically quantified as discrete integer levels. Saliency level information for all regions in the entire database is extracted, and region identifiers are clustered based on this information. For each saliency level, all region identifiers belonging to that level are collected, forming an ordered identifier list. Based on this, an inverted index structure is constructed, using the saliency level as the primary key. Each key corresponds to a linked list or skip list of region identifiers, and a portion of the high-frequency level index is resident in memory to accelerate retrieval.

[0105] Step S53: Associate the root node address of the mapping index and the root node address of the inverted index as metadata information with the corresponding data packet header;

[0106] During the data packet encapsulation phase, the root node storage address information of the aforementioned mapping index and inverted index is written into the header metadata area of ​​the data packet in a fixed format. This metadata segment typically contains fields such as index type identifier, version number, root node physical address or logical pointer, and checksum. During storage or retrieval, the entry points of the two-level indexes can be directly located by parsing the data packet header, without the need for additional queries to the index file or database, thus achieving integrated management of the index and data.

[0107] Example 2

[0108] like Figure 2 As shown, Embodiment 2 of this application provides an image storage device, including:

[0109] Visual saliency acquisition module 21: Acquires raw image data through an image acquisition sensor, calculates its local contrast value and edge density value, fuses them to generate a visual saliency map, and performs region segmentation based on this map to obtain a region division map and the average visual saliency value of each region; including the following sub-modules:

[0110] Local contrast calculation submodule 211: It uses an image sensor to collect raw image data, traverses each pixel position of the image with a preset sliding window, and calculates the standard deviation of the pixel gray value within the window as the local contrast value.

[0111] Edge density calculation submodule 212: The Canni edge detection operator is used to perform edge detection on the original image data, count the number of edge pixels in each sliding window and calculate the ratio of the edge density to the total area of ​​the window to obtain the edge density value;

[0112] Saliency map generation submodule 213: After processing the local contrast value and edge density value, a visual saliency map is generated;

[0113] Adaptive Quantization Encoding Module 22: Based on the regional average visual saliency values ​​of all regions, calculate their statistical variance and global peak value based on the histogram, and weightedly fuse them to generate an adaptive rate-distortion baseline value; compare the regional average visual saliency value of each region with the adaptive rate-distortion baseline value, calculate the difference, and determine the quantization step size value based on the difference; simultaneously calculate the visual saliency level value; perform lossless or lossy encoding on all regions, and then interleave them into a composite encoded data stream; includes the following sub-modules:

[0114] Statistical variance calculation submodule 221: Performs statistical analysis on the regional average visual saliency values ​​of all regions and calculates their statistical variance values ​​to reflect the degree of dispersion of visual saliency in each region.

[0115] Global Peak Extraction Submodule 222: Calculates the distribution histogram of the regional average visual saliency values ​​of all regions, and extracts the visual saliency value corresponding to the highest peak in the histogram as the global peak;

[0116] Adaptive benchmark fusion submodule 223: Weighted fusion of statistical variance and global peak value to generate adaptive rate distortion benchmark value;

[0117] Region coding parameter decision submodule 224: For each region, calculate the difference between its average visual saliency value and the adaptive rate distortion benchmark value, and determine the quantization step size value and visual saliency level value of the region based on the difference and preset rules;

[0118] Differential coding execution submodule 225: Determines the region type based on the visual saliency level value: If it is a high saliency level, a lossless coding algorithm is used to encode the original data of the region; if it is a low saliency level, a lossy coding algorithm combined with the quantization step size value is used for encoding.

[0119] Data stream multiplexing and encapsulation submodule 226: Arranges all regions in a preset order, concatenates their encoded data blocks sequentially, and adds synchronization markers and region header information to generate a composite encoded data stream;

[0120] Storage and Indexing Module 23: Calculates the geometric center coordinates and area percentage of each region, and encapsulates them together with the region's average visual saliency value, visual saliency level value, and quantization step size value into descriptive metadata. This descriptive metadata is then packaged with the composite encoded data stream and written to the image storage device. In the computer storage medium, a mapping index from region ID to physical address offset is constructed for each data packet, and an inverted index is built based on the visual saliency level value, associating the root node information of the two-level indexes with the corresponding data packets. This includes the following sub-modules:

[0121] Geometric center calculation submodule 231: Extracts the pixel coordinate information of each connected region in the region partitioning map, calculates the arithmetic mean of all pixel coordinates in the region, and obtains the geometric center coordinate value;

[0122] Area percentage calculation submodule 232: Count the total number of pixels in each connected region and calculate its ratio with the total number of pixels in the whole image to obtain the area percentage value;

[0123] Metadata encapsulation submodule 233: Encapsulates the geometric center coordinates, area percentage, average visual saliency of the region, visual saliency level, and quantization step size into descriptive metadata according to a preset data structure format;

[0124] Mapping index construction submodule 234: Assigns a unique region identifier to each data packet, records the starting physical address offset of the encoded data stream in the image storage device, and establishes a mapping index structure between the region identifier and the physical address offset.

[0125] Inverted index construction submodule 235: Extract the visual saliency level values ​​of all regions, group the region identifiers according to the level values, and construct an inverted index structure with the visual saliency level values ​​as keys and the corresponding region identifier list as values;

[0126] Index association submodule 236: Associates the root node address of the mapped index and the root node address of the inverted index as metadata information with the corresponding data packet header;

[0127] The memory is used to store one or more program instructions;

[0128] A processor is used to run one or more program instructions to execute an image storage method.

[0129] Corresponding to the above embodiments, the present invention provides a computer-readable storage medium containing one or more program instructions, which are executed by a processor to provide an image storage method.

[0130] The embodiments disclosed in this invention provide a computer-readable storage medium storing computer program instructions that, when executed on a computer, cause the computer to perform the image storage method described above.

[0131] In this embodiment of the invention, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0132] The various methods, steps, and logic diagrams disclosed in the embodiments of this invention can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The processor reads information from the storage medium and, in conjunction with its hardware, completes the steps of the above methods.

[0133] The storage medium can be memory, such as volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.

[0134] Among them, non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory.

[0135] Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (Synchlink DRAM, SLDRAM), and direct memory bus RAM (DRRAM).

[0136] The storage media described in the embodiments of the present invention are intended to include, but are not limited to, these and any other suitable types of memory.

[0137] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using a combination of hardware and software. When applied as software, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of computer programs from one place to another. Storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer.

[0138] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, or improvements made on the basis of the technical solution of the present invention should be included within the scope of protection of the present invention.

Claims

1. An image storage method, characterized in that, include: S1. Obtain raw image data through an image acquisition sensor, calculate the local contrast value and edge density value of the raw image data, fuse them to generate a visual saliency map, and perform region segmentation based on the visual saliency map to obtain a region division map and the average visual saliency value of each region. S2. Based on the regional average visual saliency value of all regions, calculate the statistical variance value of each region, simultaneously construct a distribution histogram and locate the global peak of the histogram, and weight and fuse the statistical variance value with the global peak value to generate an adaptive rate distortion benchmark value. S3. Compare the average visual saliency value of each region with the adaptive rate distortion benchmark value, calculate the difference and determine the quantization step size value based on the difference, and calculate the visual saliency level value. Perform lossless or lossy encoding on all regions and then interleave them into a composite encoded data stream. S4. Calculate the geometric center coordinates and area percentage of each region, and encapsulate them together with the average visual saliency value of the region, the visual saliency level value and the quantization step size value into descriptive metadata. Pack the descriptive metadata and the composite encoded data stream and write them into the image storage device. S5. In the computer storage medium, a mapping index from region ID to physical address offset is constructed for each data packet, and an inverted index is constructed based on the visual saliency level value. The root node address of the mapping index and the root node address of the inverted index are associated with the corresponding data packet.

2. The image storage method according to claim 1, characterized in that, Raw image data is acquired through an image acquisition sensor. The local contrast and edge density values ​​of the raw image data are calculated and fused to generate a visual saliency map. Based on the visual saliency map, region segmentation is performed to obtain a region division map and the average visual saliency value for each region. This process includes the following sub-steps: The image sensor is used to acquire raw image data. A preset sliding window is used to traverse the position of each pixel in the image, and the standard deviation of the pixel gray value within the window is calculated as the local contrast value. The Canni edge detection operator is used to perform edge detection on the original image data. The number of edge pixels in each sliding window is counted and the ratio of the edge pixel number to the total area of ​​the window is calculated to obtain the edge density value. After processing the local contrast value and the edge density value, a visual saliency map is generated.

3. The image storage method according to claim 1, characterized in that, Based on the regional average visual saliency values ​​of all regions, the statistical variance value is calculated for each region. Simultaneously, a distribution histogram is constructed, and the global peak of the histogram is located. The statistical variance value and the global peak are then weighted and fused to generate an adaptive rate-distortion baseline value. This process includes the following sub-steps: Statistical analysis was performed on the regional average visual saliency values ​​of all regions, and the statistical variance was calculated to reflect the degree of dispersion of visual saliency in each region. Calculate the distribution histogram of the regional average visual saliency values ​​for all regions, and extract the visual saliency value corresponding to the highest peak in the histogram as the global peak. The statistical variance value and the global peak value are weighted and fused to generate an adaptive rate distortion benchmark value.

4. The image storage method according to claim 1, characterized in that, The average visual saliency value of each region is compared with the adaptive rate-distortion baseline value, the difference is calculated, and the quantization step size is determined based on the difference. At the same time, the visual saliency level value is calculated. After performing lossless or lossy encoding on all regions, they are interleaved into a composite encoded data stream, including the following sub-steps: For each region, the difference between its average visual saliency value and the adaptive rate distortion baseline value is calculated, and the quantization step size and visual saliency level value of the region are determined based on the difference and preset rules. The region type is determined based on the visual saliency level value: if it is a high saliency level, a lossless encoding algorithm is used to encode the original data of the region; If the significance level is low, a lossy encoding algorithm that combines the quantization step size value is used for encoding. All regions are arranged in a preset order, their encoded data blocks are concatenated sequentially, and synchronization markers and region header information are added to generate a composite encoded data stream.

5. The image storage method according to claim 4, characterized in that, For each region, the difference between its average visual saliency value and the adaptive rate-distortion baseline value is calculated. Based on the difference and preset rules, the quantization step size and visual saliency level value of the region are determined, including the following sub-steps: The absolute value of the difference is mapped to a preset quantization step size range, and the basic quantization step size value is obtained by looking up a table or by linear interpolation. The statistical variance of the average visual saliency value of the region is introduced as a correction factor to fine-tune the basic quantization step size value, thus obtaining the final quantization step size value. Based on the multiple preset threshold intervals to which the difference belongs, the corresponding visual saliency level value is directly mapped and determined.

6. The image storage method according to claim 1, characterized in that, Calculate the geometric center coordinates and area percentage of each region, and encapsulate them together with the region's average visual saliency value, visual saliency level value, and quantization step size value into descriptive metadata. Pack the descriptive metadata with the composite encoded data stream and write it into the image storage device, including the following sub-steps: Extract the pixel coordinate information of each connected region in the region partitioning map, calculate the arithmetic mean of all pixel coordinates in that region, and obtain the geometric center coordinate value; Count the total number of pixels in each connected region and calculate its ratio to the total number of pixels in the entire image to obtain the area percentage. The geometric center coordinates, area percentage, average visual saliency of the region, visual saliency level, and quantization step size are encapsulated into descriptive metadata according to a preset data structure format.

7. The image storage method according to claim 1, characterized in that, In computer storage media, a mapping index from region ID to physical address offset is constructed for each data packet, and an inverted index is constructed based on visual saliency level values. The root node address of the mapping index and the root node address of the inverted index are associated with the corresponding data packet, including the following sub-steps: A unique region identifier is assigned to each data packet, the starting physical address offset of the encoded data stream in the image storage device is recorded, and a mapping index structure between the region identifier and the physical address offset is established. Extract the visual saliency level values ​​of all regions, group the region identifiers according to the level values, and construct an inverted index structure with the visual saliency level values ​​as keys and the corresponding list of region identifiers as values; The root node address of the mapped index and the root node address of the inverted index are used as metadata information and associated with the corresponding data packet header.

8. An image storage device, characterized in that, include: Visual saliency acquisition module: Acquires raw image data through an image acquisition sensor, calculates the local contrast value and edge density value of the raw image data, fuses them to generate a visual saliency map, and performs region segmentation based on the visual saliency map to obtain a region division map and the average visual saliency value of each region. Adaptive quantization encoding module: Based on the regional average visual saliency value of all regions, calculate the statistical variance value of each region, simultaneously construct a distribution histogram and locate the global peak of the histogram, and perform weighted fusion of the statistical variance value and the global peak value to generate an adaptive rate distortion benchmark value. The average visual saliency value of each region is compared with the adaptive rate distortion benchmark value, the difference is calculated and the quantization step size value is determined based on the difference, and the visual saliency level value is calculated. After performing lossless or lossy encoding on all regions, they are interleaved into a composite encoded data stream. Storage and indexing module: Calculates the geometric center coordinates and area percentage of each region, and encapsulates them together with the average visual saliency value of the region, the visual saliency level value and the quantization step size value into descriptive metadata. Packs the descriptive metadata and the composite encoded data stream and writes them into the image storage device. In computer storage media, a mapping index from region ID to physical address offset is constructed for each data packet, and an inverted index is constructed based on the visual saliency level value. The root node address of the mapping index and the root node address of the inverted index are associated with the corresponding data packet.

9. A computer storage medium, characterized in that, include: At least one memory and at least one processor; Memory, used to store one or more program instructions; A processor for executing one or more program instructions to perform an image storage method as described in any one of claims 1-7.