CN115168629B - Image data compression storage method based on block chain - Google Patents

Image data compression storage method based on block chain Download PDF

Info

Publication number
CN115168629B
CN115168629B CN202210652908.5A CN202210652908A CN115168629B CN 115168629 B CN115168629 B CN 115168629B CN 202210652908 A CN202210652908 A CN 202210652908A CN 115168629 B CN115168629 B CN 115168629B
Authority
CN
China
Prior art keywords
block
brightness
pixel points
rectangular
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210652908.5A
Other languages
Chinese (zh)
Other versions
CN115168629A (en
Inventor
李咏闻
李沂诺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Suntex Development Technology Co ltd
Original Assignee
Shenzhen Suntex Development Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Suntex Development Technology Co ltd filed Critical Shenzhen Suntex Development Technology Co ltd
Priority to CN202210652908.5A priority Critical patent/CN115168629B/en
Publication of CN115168629A publication Critical patent/CN115168629A/en
Application granted granted Critical
Publication of CN115168629B publication Critical patent/CN115168629B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/51Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/55Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/5838Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • G06F16/5854Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content using shape and object relationship
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Library & Information Science (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Multimedia (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the field of big data, in particular to a block chain-based image data compression storage method, which comprises the steps of preprocessing an image to be stored to obtain a corresponding HIS image, converting the HIS image into a corresponding chrominance-luminance two-dimensional histogram, dividing the HIS image into a plurality of rectangular blocks by using a rectangular asymmetric inverse layout model, obtaining chrominance blocks according to respective hues and saturation of upper edge pixel points and lower edge pixel points of columns where pixel points are located in each rectangular block, further subdividing each chrominance block into a plurality of rectangular blocks by using a rectangular asymmetric inverse layout model, obtaining luminance blocks according to respective luminance and luminance error tolerance values of the upper edge pixel points and the lower edge pixel points of columns where pixel points are located in each rectangular block in each subdivided, sequentially encoding and compressing the chrominance blocks and the luminance blocks in the image to be stored, and classifying and storing the chrominance blocks and the luminance blocks into a block chain, thereby reducing the image storage amount.

Description

Image data compression storage method based on block chain
Technical Field
The application relates to the field of big data, in particular to a block chain-based image data compression storage method.
Background
The data of the traditional intelligent traffic system are distributed in a network architecture level, and each organization independently manages and uploads the data, so that the data sharing is difficult to realize.
In order to solve the problem, a method for constructing an intelligent transportation system by adopting a blockchain technology is provided. The method takes block data as a core, removes centralized data management of each organization, thoroughly changes data acquisition, data processing analysis, data storage modes and methods, and fully realizes platform big data sharing, decentralization and distributed computation of the intelligent traffic multi-source system.
The blockchain can be understood as an account book held by a person, and account book contents on each person are identical, so that in the blockchain network, all nodes keep an identical data backup, which results in that a lot of storage resources are wasted in the blockchain framework, and the waste of the storage resources is more and more serious along with the rapid increase of the amount of stored image data with the development of an intelligent transportation system.
Aiming at the problem of storage resource waste, the image data can be compressed and stored, and the traditional data compression mode can influence the decompressed image quality, so that the follow-up investigation result is influenced.
Disclosure of Invention
The invention provides a block chain-based image data compression and storage method, which solves the quality problem generated after image compression and adopts the following technical scheme:
dividing an image to be processed into a plurality of rectangular blocks by using a rectangular asymmetric inverse layout model;
dividing the pixel points in each rectangular block by using the respective hue and saturation of the pixel points at the upper edge and the pixel points at the lower edge of the column of each pixel point in each rectangular block to obtain a chromaticity block;
subdividing each chroma block into a plurality of rectangular blocks using a rectangular asymmetric inverse layout model;
dividing the pixel points in each rectangular block by using the respective brightness and brightness error tolerance values of the upper edge pixel point and the lower edge pixel point of the column where each pixel point in each rectangular block is positioned to obtain a brightness block;
and sequentially encoding and compressing the chroma blocks and the brightness blocks in the image to be stored, and storing the chroma blocks and the brightness blocks in the blockchain in a classified manner.
The method for acquiring the chroma block comprises the following steps:
judging the pixel points in each rectangular block by using a Gouraud shading method:
if the chromaticity D (x, y) of the pixel points in the rectangular block satisfies:
the pixels satisfying the above conditions constitute a chrominance block,all are normalization processes, H est (x, y) and S est (x, y) is the approximation of the hue and saturation of the pixel point with coordinates (x, y), ε D Is the tolerance of the chromaticity error.
The calculation formula of the approximation values of the hue and the saturation of the pixel points is as follows:
hue:
H est (x,y)=H 5 +(H 6 -H 5 )×i 1
wherein H is est (x, y) is the hue of the pixel point with the coordinates of (x, y), H 5 、S 5 Hue and saturation of pixel points corresponding to the upper edge of the rectangular block of the column where the pixel points with coordinates of (x, y) are located, H 6 、S 6 Hue and saturation of pixel points corresponding to the lower edge of the rectangular block of the column where the pixel points with coordinates of (x, y) are located, H 5 =H 1 +(H 2 -H 1 )i 2 ,H 6 =H 3 +(H 4 -H 3 )i 2 ,i 1 =(y-y 1 )/(y 2 -y 1 ),i 2 =(x-x 1 )/(x 2 -x 1 ),H 1 ,H 2 ,H 3 ,H 4 The hues of the pixel points at the upper left, the upper right, the lower left and the lower right of the rectangular block are respectively, and x is the hue 1 ≤x≤x 2 ,y 1 ≤y≤y 2 ,(x 1 ,y 1 ),(x 2 ,y 1 ),(x 1 ,y 2 ),(x 2 ,y 2 ) The pixel point position coordinates of four corners of the rectangular block, namely the upper left corner, the upper right corner, the lower left corner and the lower right corner are respectively;
saturation:
S est (x,y)=S 5 +(S 6 -S 5 )×i 1
wherein S is est (x, y) is the saturation of the pixel point with coordinates (x, y), S 5 =S 1 +(S 2 -S 1 )i 2 ,S 6 =S 3 +(S 4 -S 3 )i 2 ,S 1 ,S 2 ,S 3 ,S 4 The saturation of the pixel points at the upper left, the upper right, the lower left and the lower right of the rectangular block respectively.
The method for obtaining the brightness block comprises the following steps:
if the chromaticity D (x, y) of the pixel points in the rectangular block after each chromaticity block is subdivided is satisfied;
|I(x,y)-I est (x,y)|≤ε L
the pixels satisfying the above condition form a luminance block, where x 1 ≤x≤x 2 ,y 1 ≤y≤y 2 ,I est (x, y) is an approximation of the luminance of the pixel point with coordinates (x, y), ε L The value of the allowable value of the brightness error is the average value of the allowable values of the brightness error corresponding to the chromaticity of all the pixel points in the rectangular block.
The method for acquiring the brightness error allowable value comprises the following steps:
acquiring an HIS image corresponding to the image to be stored, and obtaining a two-dimensional histogram corresponding to the HIS image by taking chromaticity and brightness in the HIS image as an x-axis, the brightness as a y-axis and the frequency of pixel points with the same chromaticity and brightness as a z-axis;
and obtaining the brightness variance corresponding to each chromaticity according to the two-dimensional histogram, and taking the brightness variance as a brightness error allowable value corresponding to each chromaticity. Approximation value I of brightness of pixel point est The calculation method of (x, y) is as follows:
I est (x,y)=I 5 +(I 6 -I 5 )×i 1
wherein I is 5 =I 1 +(I 2 -I 1 )i 2 ,I 6 =I 3 +(I 4 -I 3 )i 2 ,i 1 =(y-y 1 )/(y 2 -y 1 ),i 2 =(x-x 1 )/(x 2 -x 1 ),I 1 ,I 2 ,I 3 ,I 4 The brightness of the pixel points at the upper left, the upper right, the lower left and the lower right of the rectangular block respectively, I 5 Is the brightness of the pixel point of the upper edge of the corresponding rectangular block of the column where the pixel point with the coordinates of (x, y) is located, I 6 The brightness of the pixel point at the lower edge of the corresponding rectangular block of the column where the pixel point with the coordinates of (x, y) is located.
The classified storage method comprises the following steps:
for a rectangular chromaticity block, storing information of two coordinates and four corners;
for the line segment chromaticity block, storing coordinates and information of two ends of the line segment;
for isolated points, the coordinates and information of this point are stored.
The beneficial effects of the invention are as follows:
(1) The invention firstly carries out rough partitioning on an image according to chromaticity, obtains a chromaticity block according to the hue and saturation of four corner pixel points in each rectangular block and the hue and saturation of the pixel points at the upper edge and the lower edge of the column where each pixel point is located, realizes the preservation of large-area region chromaticity information, then further subdivides the chromaticity block into a plurality of rectangular blocks, obtains a brightness block according to the brightness of the four corner pixel points in each rectangular block and the brightness of the pixel points at the upper edge and the lower edge of the column where each pixel point is located, finally sequentially carries out coding preservation on the chromaticity block and the brightness block, realizes the preservation of the brightness information of large-area region details, saves the details of the image with less memory while eliminating visual redundancy, and encodes and decodes the compressed image by a Gouraud shadow method, thereby improving the compression efficiency, simultaneously avoiding the block effect generated by the image due to partitioning and having higher fidelity.
(2) The intelligent transportation system based on the blockchain technology breaks the limitation of each organization, realizes the data sharing of intelligent transportation, avoids tedious manual butt joint, and improves the case processing efficiency; the tool for realizing the record of the case content flow tracking is realized, so that a safer and more reliable image data storage system is realized, and the accurate, timely and more-dimensional supervision is convenient to implement.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, it being obvious that the drawings in the description below are only some embodiments of the invention, and that other drawings can be obtained according to these drawings without inventive faculty for a person skilled in the art.
FIG. 1 is a flow chart of a blockchain-based image data compression storage method of the present invention;
FIG. 2 is a schematic block diagram of a blockchain-based image data compression storage method of the present invention;
FIG. 3a is a schematic diagram of a rectangular chroma block of a blockchain-based image data compression storage method of the present invention;
FIG. 3b is a schematic block diagram of a segment chroma block of a blockchain-based image data compression storage method of the present invention;
FIG. 3c is a schematic diagram of isolated chroma points of a blockchain-based image data compression storage method of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
An embodiment of a blockchain-based image data compression storage method of the present invention, as shown in fig. 1, includes:
step one: preprocessing an image to be stored to obtain a corresponding HIS image, and obtaining a two-dimensional histogram corresponding to the HIS image by taking chromaticity and brightness in the HIS image as an x-axis, the brightness as a y-axis and the frequency of pixel points with the same chromaticity and brightness as a z-axis; obtaining a brightness variance corresponding to each chromaticity according to the two-dimensional histogram, and taking the brightness variance as a brightness error allowable value;
the aim of the step is to preprocess the image to be stored to obtain the brightness and chromaticity information of the pixel points in the image to be stored.
Firstly, the embodiment builds an intelligent traffic system based on a blockchain technology, and a basic model of the system mainly comprises a data layer, a network layer, a consensus layer, an excitation layer, a contract layer and an application layer. The data compression storage method designed in this embodiment mainly designs a data layer, and the data layer mainly includes a bottom data block, a data structure, an encryption and authentication algorithm, and the like.
Then, preprocessing is performed on the image to be stored:
(1) And converting the RGB image of the image to be stored into an HSI image. In HIS colors, the H and S components are closely related to the way humans feel the colors, which makes the HSI model well suited for color characterization detection and analysis. Therefore, in this embodiment, the RGB image captured by the system is converted into the HSI image by the conversion formula for converting the RGB image into the HSI image, where H is a hue, S is a saturation, the hue and the saturation are collectively called a chromaticity, and I is a luminance.
(2) And denoising the HSI image captured by the system. For most images, there is a correlation between adjacent pixels, and it is necessary to have an approximate chromaticity in a certain range to cause visual excitement of a person, so that noise on a snap-shot image is mostly caused by uneven brightness. In the embodiment, the mean value filtering processing is performed on the brightness component I, so that the denoising of the HSI image is realized.
And finally, constructing a chromaticity-brightness two-dimensional histogram, and calculating a brightness error tolerance value.
A chrominance-luminance two-dimensional histogram of the HSI image is calculated. In the HSI image, hue H epsilon [0 DEG, 360 DEG ], saturation S epsilon [0,100], chroma D epsilon [ (0 DEG, 0), [360 DEG, 100) ] is used as x-axis and y-axis, frequency H (D, I) of corresponding chroma and brightness, namely frequency of pixel points corresponding to the chroma and brightness is used as z-axis, and a function image is drawn to obtain a corresponding two-dimensional histogram of chroma-brightness.
Calculating luminance variance corresponding to chromaticity from the chromaticity-luminance two-dimensional histogram, slicing the chromaticity-luminance two-dimensional histogram according to chromaticity, and calculating variance sigma of luminance frequency h (D, I) corresponding to certain chromaticity D 2 As a luminance error allowable value corresponding to the chromaticity.
Step two: dividing an image to be processed into a plurality of rectangular blocks by using a rectangular asymmetric inverse layout model; dividing the pixel points in each rectangular block by using the respective hue and saturation of the pixel points at the upper edge and the pixel points at the lower edge of the column of each pixel point in each rectangular block to obtain a chromaticity block;
the method comprises the steps of roughly partitioning an image to be stored into a plurality of chroma blocks through a rectangular asymmetric inverse layout model RNAM and based on a partitioning judgment rule;
it should be noted that:
(1) The human eye has a higher resolution for details of black and white images and a lower resolution for details of color images. Thus, for a color image, for a large area region, it is necessary to save its luminance information while saving its chromaticity information, and for a detailed portion, it is possible to represent it by a luminance signal, and chromaticity is only necessary to describe the color of the entire region approximately. Therefore, the embodiment obtains the error tolerance of the Gouraud shadow method based on the image characteristics, and performs block coding on the image based on chromaticity and brightness respectively through a rectangular asymmetric inverse layout model algorithm, so as to realize the compression of the image data.
(2) Large areas of equal chromaticity can cause visual excitement of a person who is more concerned about luminance information for the detailed portion. Therefore, only coarse blocking is required for chromaticity of an image, while fine blocking is required for chromaticity blocks according to luminance. The method for partitioning the image in this embodiment is a rectangular asymmetric inverse layout model algorithm, and the determination rule for the chroma block in the algorithm is a determination rule of a Gouraud shadow method.
(3) The algorithm idea of the rectangular asymmetric inverse layout model (RNAM) is to use a given predefined sub-mode to fill the modes, find the minimum mode number for filling the modes, and based on the algorithm, the number of blocks can be reduced, so that the data storage quantity is reduced, and the compression efficiency is improved. The algorithm has different judging rules for the chroma blocks, and the obtained blocking effect is different, so that the final compression efficiency is affected, and the common judging rules are based on the Gouraud shading method. The Gouraud shadow method can save the information in the rectangular block by saving the information of the four corner pixel points of the rectangular chroma block, and meanwhile, the blocking effect can be avoided during the restoration, and the restored image has higher fidelity. However, the Gouraud shading method is a chromaticity block determination rule based on gray information, and cannot achieve the purpose of saving chromaticity information of a large area region and saving luminance information of details of a large area region based on visual redundancy characteristics in the present embodiment. Therefore, the present embodiment modifies the determination rule of the Gouraud shading method based on chromaticity and luminance to obtain a block determination rule, so that it is adapted to the rule of the present embodiment based on chromaticity and luminance blocks.
The method for acquiring the chroma block comprises the following steps:
(1) Dividing an image to be processed into a plurality of rectangular blocks by using a rectangular asymmetric inverse layout model;
(2) Judging the pixel points in each rectangular block by using a Gouraud shading method:
if the chromaticity D (x, y) of the pixel points in one rectangular block satisfies:
the pixels form a chrominance block in whichAll are normalization processes, namely the hue and saturation after treatment are between 0 and 1, the dimensional influence is eliminated, the incomparability between the hue and the saturation is solved, and x is 1 ≤x≤x 2 ,y 1 ≤y≤y 2 ,H est (x, y) and S est (x, y) are approximations of the hue and saturation of the pixel point with coordinates (x, y), respectively.
The calculation formula of the approximation values of the hue and the saturation of the pixel points is as follows:
hue:
H est (x,y)=H 5 +(H 6 -H 5 )×i 1
wherein H is est (x, y) is the hue of the pixel point with the coordinates of (x, y), H 5 、S 5 Hue and saturation of pixel points corresponding to the upper edge of the rectangular block of the column where the pixel points with coordinates of (x, y) are located, H 6 、S 6 Hue and saturation of pixel points corresponding to the lower edge of the rectangular block of the column where the pixel points with coordinates of (x, y) are located, H 5 =H 1 +(H 2 -H 1 )i 2 ,H 6 =H 3 +(H 4 -H 3 )i 2 ,i 1 =(y-y 1 )/(y 2 -y 1 ),i 2 =(x-x 1 )/(x 2 -x 1 ),H 1 ,H 2 ,H 3 ,H 4 The hues of the pixel points at the upper left, the upper right, the lower left and the lower right of the rectangular block are respectively, and x is the hue 1 ≤x≤x 2 ,y 1 ≤y≤y 2 ,(x 1 ,y 1 ),(x 2 ,y 1 ),(x 1 ,y 2 ),(x 2 ,y 2 ) The pixel point position coordinates of four corners of the rectangular block, namely the upper left corner, the upper right corner, the lower left corner and the lower right corner are respectively;
saturation:
S est (x,y)=S 5 +(S 6 -S 5 )×i 1
wherein S is est (x, y) is the saturation of the pixel point with coordinates (x, y), S 5 =S 1 +(S 2 -S 1 )i 2 ,S 6 =S 3 +(S 4 -S 3 )i 2 ,S 1 ,S 2 ,S 3 ,S 4 The saturation of the pixel points at the upper left, the upper right, the lower left and the lower right of the rectangular block respectively.
As shown in FIG. 2, H 1 ,H 2 ,H 3 ,H 4 Hue, S of pixel points at four corners of rectangular block 1 ,S 2 ,S 3 ,S 4 Saturation of pixel points at four corners of the rectangular block respectively, H 5 、S 5 Hue and saturation of pixel points corresponding to the upper edge of the rectangular block of the column where the pixel points with coordinates of (x, y) are located, H 6 、S 6 Hue and saturation of pixel points at the lower edge of the corresponding rectangular block of the column where the pixel point with coordinates (x, y) is located, wherein epsilon D Is a chromaticity error tolerance, which is set for human, epsilon in this embodiment D =0.1。
Step three: subdividing each chroma block into a plurality of rectangular blocks using a rectangular asymmetric inverse layout model; dividing the pixel points in each rectangular block by using the respective brightness and brightness error tolerance values of the upper edge pixel point and the lower edge pixel point of the column where each pixel point in each rectangular block is positioned to obtain a brightness block;
the aim of the step is to finely divide the chroma blocks into a plurality of rectangular blocks by the RNAM algorithm, and the dividing step is the dividing step of the RNAM algorithm.
The method for obtaining the brightness block comprises the following steps:
dividing each chromaticity block obtained in the second step into a plurality of rectangular blocks by using a rectangular asymmetric inverse layout model;
if the brightness I (x, y) of the pixel point in one rectangular block satisfies:
|I(x,y)-I est (x,y)|≤ε L
the pixels form a luminance block, where x 1 ≤x≤x 2 ,y 1 ≤y≤y 2 ,I est (x, y) is an approximation of the brightness of the pixel point with coordinates (x, y), and the calculation formula is:
I est (x,y)=I 5 +(I 6 -I 5 )×i 1
wherein I is 5 =I 1 +(I 2 -I 1 )i 2 ,I 6 =I 3 +(I 4 -I 3 )i 2 ,i 1 =(y-y 1 )/(y 2 -y 1 ),i 2 =(x-x 1 )/(x 2 -x 1 )。I 1 ,I 2 ,I 3 ,I 4 The brightness of the pixel points at four corners of the rectangular block respectively is I 5 Is the brightness of the pixel point of the upper edge of the corresponding rectangular block of the column where the pixel point with the coordinates of (x, y) is located, I 6 Is the lighting of the pixel point of the lower edge of the corresponding rectangular block of the column where the pixel point with the coordinates of (x, y) is located, epsilon L The allowable value of color brightness error is the average value of the brightness variances corresponding to the chromaticity of all the pixel points in the rectangular block (which can be obtained by obtaining the brightness variance corresponding to each chromaticity in the first step).
It should be noted that:
the chroma block obtained in the second step is the result of rough classification of the image, and data compression is realized by saving the chroma information of a large area region; the rough classification in the second step is further detail classification, namely detail information of a large-area chromaticity fast region is represented by a brightness signal; therefore, the present embodiment adaptively acquires the luminance error allowance amount based on the luminance distribution characteristics of the same chromaticity of the image.
Step four: and sequentially encoding and compressing the chroma blocks and the brightness blocks in the image to be stored, and storing the chroma blocks and the brightness blocks in the blockchain in a classified manner.
The method comprises the steps of firstly encoding rectangular chroma blocks in an image to be stored, then encoding rectangular brightness blocks, and classifying non-chroma blocks to realize compression storage of image information.
Firstly, coding the chrominance blocks to store chrominance information, and then coding the luminance blocks to store luminance detail information.
The method for classifying and storing comprises the following steps:
since the coding modes of the RNAM algorithm are different for coding information stored in different types of chroma blocks, classification is needed:
(1) For a rectangular chromaticity block, storing information of two coordinates and four corners;
(2) For the line segment chromaticity block, storing coordinates and information of two ends of the line segment;
(3) For an isolated point, only the coordinates and information of this point need be stored.
Fig. 3a shows a rectangular chromaticity block, fig. 3b shows a line segment chromaticity block, and fig. 3c shows isolated pixels.
So far, the embodiment obtains the error tolerance of the Gouraud shadow method based on the image characteristics, and further codes the image data based on chromaticity and brightness blocks respectively according to the rectangular asymmetric inverse layout model algorithm, so as to realize the compression of the image data.
In the use process, when decoding the compressed image, according to the approximate value calculation formula of hue, saturation and brightness in the chromaticity block judging rule in the Gouraud shadow method, firstly decoding according to the block information of the chromaticity block, and then decoding according to the block information of the brightness block. Note that in decoding, the manner of decoding is different for different types of chroma blocks.
The foregoing description of the preferred embodiments of the invention is not intended to be limiting, but rather is intended to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the invention.

Claims (2)

1. A blockchain-based image data compression storage method, comprising:
dividing an image to be processed into a plurality of rectangular blocks by using a rectangular asymmetric inverse layout model;
dividing the pixel points in each rectangular block by using the respective hue and saturation of the pixel points at the upper edge and the pixel points at the lower edge of the column of each pixel point in each rectangular block to obtain a chromaticity block;
subdividing each chroma block into a plurality of rectangular blocks using a rectangular asymmetric inverse layout model;
dividing the pixel points in each rectangular block by using the respective brightness and brightness error tolerance values of the upper edge pixel point and the lower edge pixel point of the column where each pixel point in each rectangular block is positioned to obtain a brightness block;
sequentially encoding and compressing a chrominance block and a luminance block in an image to be stored, and storing the chrominance block and the luminance block in a block chain in a classified manner;
the method for acquiring the chroma block comprises the following steps:
judging the pixel points in each rectangular block by using a Gouraud shading method:
if the chromaticity D (x, y) of the pixel points in the rectangular block satisfies:
the pixels satisfying the above conditions constitute a chrominance block,all are normalization processes, H est (x, y) and S est (x, y) is the approximation of the hue and saturation of the pixel point with coordinates (x, y), ε D Is the tolerance of chromaticity error;
the calculation formula of the approximation values of the hue and the saturation of the pixel points is as follows:
hue:
H est (x,y)=H 5 +(H 6 -H 5 )×i 1
wherein H is est (x, y) is the hue of the pixel point with the coordinates of (x, y), H 5 、S 5 Hue and saturation of pixel points corresponding to the upper edge of the rectangular block of the column where the pixel points with coordinates of (x, y) are located, H 6 、S 6 Hue and saturation of pixel points corresponding to the lower edge of the rectangular block of the column where the pixel points with coordinates of (x, y) are located, H 5 =H 1 +(H 2 -H 1 )i 2 ,H 6 =H 3 +(H 4 -H 3 )i 2 ,i 1 =(y-y 1 )/(y 2 -y 1 ),i 2 =(x-x 1 )/(x 2 -x 1 ),H 1 ,H 2 ,H 3 ,H 4 The hues of the pixel points at the upper left, the upper right, the lower left and the lower right of the rectangular block are respectively, and x is the hue 1 ≤x≤x 2 ,y 1 ≤y≤y 2 ,(x 1 ,y 1 ),(x 2 ,y 1 ),(x 1 ,y 2 ),(x 2 ,y 2 ) The pixel point position coordinates of four corners of the rectangular block, namely the upper left corner, the upper right corner, the lower left corner and the lower right corner are respectively;
saturation:
S est (x,y)=S 5 +(S 6 -S 5 )×i 1
wherein S is est (x, y) is the saturation of the pixel point with the coordinates of (x, y), S 5 =S 1 +(S 2 -S 1 )i 2 ,S 6 =S 3 +(S 4 -S 3 )i 2 ,S 1 ,S 2 ,S 3 ,S 4 Saturation of pixel points at four corners of the upper left, the upper right, the lower left and the lower right of the rectangular block respectively;
the method for obtaining the brightness block comprises the following steps:
if the chromaticity D (x, y) of the pixel points in the rectangular block after each chromaticity block is subdivided is satisfied;
|I(x,y)-I est (x,y)|≤ε L
the pixels satisfying the above condition form a luminance block, where x 1 ≤x≤x 2 ,y 1 ≤y≤y 2 ,I est (x, y) is an approximation of the luminance of the pixel point with coordinates (x, y), ε L The value is the average value of the allowable brightness error values corresponding to the chromaticity of all the pixel points in the rectangular block;
the method for acquiring the brightness error allowable value comprises the following steps:
acquiring an HIS image corresponding to the image to be stored, and obtaining a two-dimensional histogram corresponding to the HIS image by taking chromaticity and brightness in the HIS image as an x-axis, the brightness as a y-axis and the frequency of pixel points with the same chromaticity and brightness as a z-axis;
obtaining a brightness variance corresponding to each chromaticity according to the two-dimensional histogram, and taking the brightness variance as a brightness error allowable value corresponding to each chromaticity;
approximation value I of brightness of pixel point est The calculation method of (x, y) is as follows:
I est (x,y)=I 5 +(I 6 -I 5 )×i 1
wherein I is 5 =I 1 +(I 2 -I 1 )i 2 ,I 6 =I 3 +(I 4 -I 3 )i 2 ,i 1 =(y-y 1 )/(y 2 -y 1 ),i 2 =(x-x 1 )/(x 2 -x 1 ),I 1 ,I 2 ,I 3 ,I 4 The brightness of the pixel points at the upper left, the upper right, the lower left and the lower right of the rectangular block respectively, I 5 Is the brightness of the pixel point of the upper edge of the corresponding rectangular block of the column where the pixel point with the coordinates of (x, y) is located, I 6 The brightness of the pixel point at the lower edge of the corresponding rectangular block of the column where the pixel point with the coordinates of (x, y) is located.
2. The method for compressing and storing image data based on block chain as recited in claim 1, wherein the method for classifying and storing is as follows:
for a rectangular color block, storing information of two coordinates and four corners;
for the line segment color block, storing coordinates and information of two ends of the line segment;
for isolated points, the coordinates and information of this point are stored.
CN202210652908.5A 2022-06-08 2022-06-08 Image data compression storage method based on block chain Active CN115168629B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210652908.5A CN115168629B (en) 2022-06-08 2022-06-08 Image data compression storage method based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210652908.5A CN115168629B (en) 2022-06-08 2022-06-08 Image data compression storage method based on block chain

Publications (2)

Publication Number Publication Date
CN115168629A CN115168629A (en) 2022-10-11
CN115168629B true CN115168629B (en) 2023-12-26

Family

ID=83486267

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210652908.5A Active CN115168629B (en) 2022-06-08 2022-06-08 Image data compression storage method based on block chain

Country Status (1)

Country Link
CN (1) CN115168629B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104318560A (en) * 2014-10-21 2015-01-28 华南理工大学 Image segmentation method based on asymmetrical anti-packing model

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104318560A (en) * 2014-10-21 2015-01-28 华南理工大学 Image segmentation method based on asymmetrical anti-packing model

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
Koya T等.Analysis of application of arithmetic coding on DCT and DCT-DWT hybrid transforms of images for compression.2017 International Conference on Networks & Advances in Computational Technologies (NetACT). IEEE.2017,全文. *
Wu P等.A Color Image Representation Method Based on Double-Rectangle NAM.Advances in Computer Science and Information Engineering.2012,全文. *
常宜斌.基于非对称逆布局的图像矩算法研究.中国优秀硕士学位论文全文数据库 (信息科技辑).2018,(第undefined期),全文. *
胡卫军;万琳;陆永亮.基于矩形NAM和偏微分方程的灰度图像压缩方法.小型微型计算机系统.2010,(第06期),全文. *
胡索等.一种基于非对称逆布局灰度图像表示算法.福建电脑.2017,全文. *
郑运平;陈传波.一种新的灰度图像表示算法研究.计算机学报.2010,(第12期),全文. *

Also Published As

Publication number Publication date
CN115168629A (en) 2022-10-11

Similar Documents

Publication Publication Date Title
US8218908B2 (en) Mixed content image compression with two edge data representations
JP2003125423A (en) Method for digital compression of color image
JPH07236062A (en) Picture processor and method therefor
JPH07121656A (en) Image area separating device
WO2016031189A1 (en) Image processing apparatus, image processing method, recording medium, and program
CN114693816A (en) Intelligent image big data storage method
US20150326878A1 (en) Selective perceptual masking via scale separation in the spatial and temporal domains using intrinsic images for use in data compression
CN110383696A (en) Method and apparatus for being coded and decoded to super-pixel boundary
Lei et al. A novel intelligent underwater image enhancement method via color correction and contrast stretching✰
US7613353B2 (en) Method of color image processing to eliminate shadows and reflections
CN109934783B (en) Image processing method, image processing device, computer equipment and storage medium
Zhao et al. An adaptive low-illumination image enhancement algorithm based on weighted least squares optimization
CN115168629B (en) Image data compression storage method based on block chain
CN110648297B (en) Image defogging method, system, electronic device and storage medium
KR20200091661A (en) Apparatus and method for determining manipulated image
CN112508847A (en) Image quality evaluation method based on depth feature and structure weighted LBP feature
US8897378B2 (en) Selective perceptual masking via scale separation in the spatial and temporal domains using intrinsic images for use in data compression
CN114067006B (en) Screen content image quality evaluation method based on discrete cosine transform
CN110766117A (en) Two-dimensional code generation method and system
CN106717006A (en) Method for choosing a compression algorithm depending on the image type
CN115082345A (en) Image shadow removing method and device, computer equipment and storage medium
CN116977190A (en) Image processing method, apparatus, device, storage medium, and program product
CN110717875B (en) High-definition image processing method
CN106686387A (en) Picture compression method for photographing surface of odometer style water meter
CN112509107A (en) Point cloud attribute recoloring method, device and encoder

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20231201

Address after: 518000 Floor 3, No. 2 Factory Building, Lijin City Industrial Park, Pinus tabulaeformis Community, Longhua Street, Longhua District, Shenzhen, Guangdong

Applicant after: SHENZHEN SUNTEX DEVELOPMENT TECHNOLOGY Co.,Ltd.

Address before: No. 3003, 30th Floor, Building 15, Asia Pacific Garden, No. 1 Chaofeng Road, Zhengzhou Area (Jingkai), Pilot Free Trade Zone, Zhengzhou City, Henan Province, 450000

Applicant before: Henan Hechangli Information Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant