[go: up one dir, main page]

CN116471412B - Self-adaptive image compression method and system based on density clustering - Google Patents

Self-adaptive image compression method and system based on density clustering Download PDF

Info

Publication number
CN116471412B
CN116471412B CN202310399100.5A CN202310399100A CN116471412B CN 116471412 B CN116471412 B CN 116471412B CN 202310399100 A CN202310399100 A CN 202310399100A CN 116471412 B CN116471412 B CN 116471412B
Authority
CN
China
Prior art keywords
matrix
determining
data
pixel
pixel point
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
CN202310399100.5A
Other languages
Chinese (zh)
Other versions
CN116471412A (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.)
Yancheng Institute of Technology
Original Assignee
Yancheng Institute of Technology
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 Yancheng Institute of Technology filed Critical Yancheng Institute of Technology
Priority to CN202310399100.5A priority Critical patent/CN116471412B/en
Publication of CN116471412A publication Critical patent/CN116471412A/en
Application granted granted Critical
Publication of CN116471412B publication Critical patent/CN116471412B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • H04N19/126Details of normalisation or weighting functions, e.g. normalisation matrices or variable uniform quantisers
    • 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)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Analysis (AREA)

Abstract

本发明提供一种基于密度聚类的自适应图像压缩方法及系统,其中,方法包括:对待处理图片数据进行预处理,获取第一图像数据;计算第一图像数据中两两像素点之间的欧式距离并基于欧式距离构建第一矩阵;确定第一矩阵对应的随机游走型拉普拉斯矩阵并对随机游走型拉普拉斯矩阵进行特征值分解,确定像素点聚类簇数;基于像素点聚类簇数,对第一图像数据进行聚类处理,获取多个像素点簇;确定每个像素点簇对应的代表像素点;基于代表像素点的RGB三色值,确定同簇内其他像素点的RGB三色值。本发明的基于密度聚类的自适应图像压缩方法,计算复杂度低;并且实现智能确定压缩后的颜色种类。

The present invention provides an adaptive image compression method and system based on density clustering. The method includes: preprocessing image data to be processed to obtain first image data; calculating the distance between two pixels in the first image data. Euclidean distance and construct the first matrix based on Euclidean distance; determine the random walk Laplacian matrix corresponding to the first matrix and perform eigenvalue decomposition of the random walk Laplacian matrix to determine the number of pixel point clusters; Based on the number of pixel clusters, cluster the first image data to obtain multiple pixel clusters; determine the representative pixel corresponding to each pixel cluster; determine the same cluster based on the RGB trichromatic value of the representative pixel RGB trichromatic values of other pixels within it. The adaptive image compression method based on density clustering of the present invention has low computational complexity and realizes intelligent determination of compressed color types.

Description

Self-adaptive image compression method and system based on density clustering
Technical neighborhood
The invention relates to the technical field of image processing, in particular to a self-adaptive image compression method and system based on density clustering.
Background
Digital images (rawRGB) occupy a lot of memory space if not compressed. For example, a 24-bit true color image with a resolution of 1024×768 has a data size of 1024×768×24/8=2,359, 298 bytes (about 2.36 MB). This presents great difficulties for the storage, processing, and transfer of images. There is a certain correlation between pixels of an image, both in the row direction and in the column direction (e.g., adjacent pixels may have the same color or areas with the same color over the entire image): huffman coding compression, arithmetic compression, JPEG methods, methods of compressing images using neural networks (CN 202210182212), and the like. However, the Huffman coding compression needs to build a binary tree and traverse the binary tree to form codes, and the data compression and the recovery speed are low; arithmetic compression is suitable for files consisting of identical repeated sequences; the image compression method based on the neural network has higher requirements on hardware of a computer and has high time cost.
Disclosure of Invention
The invention aims at providing a self-adaptive image compression method based on density clustering, which has low calculation complexity; and intelligent determination of the type of color after compression is achieved.
The embodiment of the invention provides a self-adaptive image compression method based on density clustering, which comprises the following steps:
preprocessing picture data to be processed to obtain first image data;
calculating Euclidean distance between every two pixel points in the first image data and constructing a first matrix based on the Euclidean distance;
determining a random walk-type Laplace matrix corresponding to the first matrix, decomposing eigenvalues of the random walk-type Laplace matrix, and determining the number of pixel point clusters;
clustering the first image data based on the number of pixel point clusters to obtain a plurality of pixel point clusters;
determining a representative pixel point corresponding to each pixel point cluster;
and determining RGB tristimulus values of other pixel points in the same cluster based on the RGB tristimulus values of the representative pixel points.
Preferably, preprocessing the picture data to be processed to obtain first image data includes:
determining the pixel width and the pixel height of a picture to be processed corresponding to the picture to be processed data;
and reading the values of three color channels of each pixel RGB in the picture to be processed, and carrying out normalization processing on the values of the three color channels of each pixel RGB.
Preferably, the calculation formula of each element in the first matrix is as follows:
in dist m,n Elements representing the mth row and the nth column of the first matrix; dist (dist) n,m Elements representing the nth row and mth column of the first matrix; r is (r) m,n 、g m,n 、b m,n RGB tristimulus values for pixels of an mth row and an nth column in the first image data; r is (r) m,n-1 、g m,n-1 、b m,n-1 RGB tristimulus values for pixels of an nth row and an nth column of the first image data.
Preferably, determining a random walk-type laplace matrix corresponding to the first matrix and performing eigenvalue decomposition on the random walk-type laplace matrix, and determining the number of pixel point clusters includes:
constructing an adjacent matrix corresponding to the first matrix; the adjacency matrix is expressed as
Constructing a degree matrix corresponding to the first matrix; the degree matrix is expressed as
D wh×wh =diag(sum(W wh×wh ));
Determining a random walk-type Laplacian matrix based on the adjacency matrix and the degree matrix; the random walk-type Laplace matrix is denoted as L rw =I-D wh×wh -1 W wh×wh
Performing eigenvalue decomposition on the random walk type Laplace matrix, and sequencing eigenvalues according to ascending order to obtain an eigenvalue sequence;
and determining the clustering number of the pixel points based on the characteristic value sequence.
Preferably, the clustering processing is performed on the first image data based on the number of pixel point clusters to obtain a plurality of pixel point clusters, including:
determining the value of the cluster number of the pixel points as a reference value;
determining a neighborhood radius and a neighborhood threshold;
determining a result queue based on the neighborhood radius and the neighborhood threshold;
drawing an reachable distance graph based on the result queue;
the pixel points in the first image data are divided into pixel point clusters of which the number corresponds to the reference value based on the maximum value points of the front reference value of the reachable distance graph.
Preferably, determining a representative pixel corresponding to each pixel cluster includes:
calculating a distance matrix between every two pixel points in each pixel point cluster;
and determining a pixel point with the smallest sum of the distances between the pixel point and other pixel points in the pixel point clusters from each pixel point cluster as a representative pixel point.
Preferably, determining the neighborhood radius, the neighborhood threshold, includes:
acquiring first parameter data corresponding to the picture data to be processed, second parameter data of shooting equipment corresponding to the picture data to be processed, third parameter data of a transmission path for transmitting the picture data to be processed, and fourth parameter data of a target object for receiving the picture data to be processed;
performing feature extraction on the first parameter data based on a preset first feature extraction template to obtain a plurality of first feature values;
performing feature extraction on the second parameter data based on a preset second feature extraction template to obtain a plurality of second feature values;
performing feature extraction on the third parameter data based on a preset third feature extraction template to obtain a plurality of third feature values;
performing feature extraction on the fourth parameter data based on a preset fourth feature extraction template to obtain a plurality of fourth feature values;
constructing an analysis parameter set based on the first feature value, the second feature value, the third feature value and the fourth feature value;
determining a parameter set based on the analysis parameter set and a preset analysis library;
and analyzing the parameter set, and determining a neighborhood radius and a neighborhood threshold.
Preferably, the adaptive image compression method based on density clustering further comprises:
acquiring compressed second image data;
determining a plurality of evaluation parameters representing the compression effect based on the first image data and the second image data;
correlating the evaluation parameters, parameter sets and analysis parameter sets corresponding to the second image data to form analysis data and storing the analysis data into a database to be analyzed;
classifying and grouping analysis data in the database to be analyzed based on the analysis parameter set;
when the data quantity in the group reaches a preset quantity threshold value, the group is extracted to be used as an analysis data group;
determining the adaptation condition of the parameter set and the analysis parameter set based on the evaluation parameters of each analysis data in the analysis data set;
triggering an update mode when the adaptation condition belongs to a preset update triggering condition;
taking an analysis parameter set corresponding to the analysis data set as an analysis parameter set to be updated;
based on a plurality of preset adjustment parameter sets, adjusting the parameter sets, obtaining a plurality of adjusted parameter sets to be verified, and arranging the parameter sets to be verified to form a list to be called;
when the parameter set corresponding to the analysis parameter set to be updated is called, sequentially calling based on the sequence of the list to be called;
when the parameter set to be verified in the list to be called is called for preset times;
based on a preset evaluation analysis library, analyzing a plurality of evaluation parameters corresponding to the parameter sets to be verified, and determining evaluation values corresponding to the parameter sets to be verified;
and extracting the parameter set to be verified with the highest evaluation value to replace the parameter set corresponding to the analysis parameter set to be updated in the analysis library.
The invention also provides a self-adaptive image compression system based on density clustering, which comprises:
the acquisition module is used for preprocessing the picture data to be processed to acquire first image data;
the construction module is used for calculating Euclidean distance between every two pixel points in the first image data and constructing a first matrix based on the Euclidean distance;
the first determining module is used for determining a random walk type Laplace matrix corresponding to the first matrix, decomposing characteristic values of the random walk type Laplace matrix and determining the number of pixel point clusters;
the clustering module is used for carrying out clustering processing on the first image data based on the number of the pixel point clusters to obtain a plurality of pixel point clusters;
the second determining module is used for determining a representative pixel point corresponding to each pixel point cluster;
and the replacement module is used for determining RGB tristimulus values of other pixel points in the same cluster based on the RGB tristimulus values of the representative pixel points.
Preferably, the obtaining module performs preprocessing on the image data to be processed to obtain first image data, and performs the following operations:
determining the pixel width and the pixel height of a picture to be processed corresponding to the picture to be processed data;
and reading the values of three color channels of each pixel RGB in the picture to be processed, and carrying out normalization processing on the values of the three color channels of each pixel RGB.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
The technical scheme of the invention is further described in detail through the drawings and the embodiments.
Drawings
The accompanying drawings are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate the invention and together with the embodiments of the invention, serve to explain the invention. In the drawings:
FIG. 1 is a schematic diagram of an adaptive image compression method based on density clustering in an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a compression method according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating the preprocessing of picture data according to an embodiment of the present invention
FIG. 4 is a flow chart of generating a distance matrix in an embodiment of the invention;
FIG. 5 is a flowchart of determining the number of clusters of pixel points according to an embodiment of the present invention;
FIG. 6 is a flowchart of clustering all pixels using an OPTICS method according to an embodiment of the invention;
FIG. 7 is a flowchart of selecting representative pixels according to an embodiment of the present invention;
fig. 8 is a schematic diagram of an adaptive image compression system based on density clustering in an embodiment of the present invention.
Detailed Description
The preferred embodiments of the present invention will be described below with reference to the accompanying drawings, it being understood that the preferred embodiments described herein are for illustration and explanation of the present invention only, and are not intended to limit the present invention.
The embodiment of the invention provides a self-adaptive image compression method based on density clustering, which is shown in fig. 1 and comprises the following steps:
step S1: preprocessing picture data to be processed to obtain first image data;
step S2: calculating Euclidean distance between every two pixel points in the first image data and constructing a first matrix based on the Euclidean distance;
step S3: determining a random walk-type Laplace matrix corresponding to the first matrix, decomposing eigenvalues of the random walk-type Laplace matrix, and determining the number of pixel point clusters;
step S4: clustering the first image data based on the number of pixel point clusters to obtain a plurality of pixel point clusters;
step S5: determining a representative pixel point corresponding to each pixel point cluster;
step S6: and determining RGB tristimulus values of other pixel points in the same cluster based on the RGB tristimulus values of the representative pixel points.
The method for preprocessing the picture data to be processed to obtain first image data comprises the following steps:
determining the pixel width and the pixel height of a picture to be processed corresponding to the picture to be processed data;
and reading the values of three color channels of each pixel RGB in the picture to be processed, and carrying out normalization processing on the values of the three color channels of each pixel RGB.
Wherein, the calculation formula of each element in the first matrix is as follows:
in dist m,n Representing the mth row in the first matrixAn element of column n; dist (dist) n,m Elements representing the nth row and mth column of the first matrix; r is (r) m,n 、g m,n 、b m,n RGB tristimulus values for pixels of an mth row and an nth column in the first image data; r is (r) m,n-1 、g m,n-1 、b m,n-1 RGB tristimulus values for pixels of an nth row and an nth column of the first image data.
The method for determining the pixel cluster number comprises the steps of determining a random walk type Laplacian matrix corresponding to a first matrix, performing eigenvalue decomposition on the random walk type Laplacian matrix, and determining the pixel cluster number, wherein the method comprises the following steps:
constructing an adjacent matrix corresponding to the first matrix; the adjacency matrix is expressed as
Constructing a degree matrix corresponding to the first matrix; the degree matrix is expressed as
D wh×wh =diag(sum(W wh×wh ));
Determining a random walk-type Laplacian matrix based on the adjacency matrix and the degree matrix; the random walk-type Laplace matrix is denoted as L rw =I-D wh×wh -1 W wh×wh
Performing eigenvalue decomposition on the random walk type Laplace matrix, and sequencing eigenvalues according to ascending order to obtain an eigenvalue sequence;
and determining the clustering number of the pixel points based on the characteristic value sequence.
The method for clustering the first image data based on the pixel point cluster number to obtain a plurality of pixel point clusters comprises the following steps:
determining the value of the cluster number of the pixel points as a reference value;
determining a neighborhood radius and a neighborhood threshold;
determining a result queue based on the neighborhood radius and the neighborhood threshold;
drawing an reachable distance graph based on the result queue;
the pixel points in the first image data are divided into pixel point clusters of which the number corresponds to the reference value based on the maximum value points of the front reference value of the reachable distance graph.
Wherein determining the representative pixel point corresponding to each pixel point cluster comprises:
calculating a distance matrix between every two pixel points in each pixel point cluster;
and determining a pixel point with the smallest sum of the distances between the pixel point and other pixel points in the pixel point clusters from each pixel point cluster as a representative pixel point.
The working principle and the beneficial effects of the technical scheme are as follows:
as shown in fig. 2 to 7, firstly, preprocessing the picture data to be processed, and after preprocessing, constructing a matrix DIST (wh order symmetric square matrix) according to the euclidean distance between every two pixel points; performing eigenvalue decomposition on a random walk type Laplace matrix of the DIST, and determining the clustering cluster number k of the pixel points; using OPTICS clustering to gather wh pixel points into k classes; selecting a representative pixel from each pixel cluster; the RGB tristimulus values representing the pixel points are used to replace the RGB tristimulus values of other pixel points in the same cluster. The preprocessing of the picture data mainly comprises the following steps: acquiring a pixel width (w) and a pixel height (h) of a picture; reading the values R of three color channels of each pixel point RGB i,j ,G i,j ,B i,j (i is more than or equal to 1 and less than or equal to h, j is more than or equal to 1 and less than or equal to w); and normalize the RGB tristimulus values i,j =R i,j /255,g i,j =G i,j /(255,b i,j =B i,j 255); secondly, performing eigenvalue decomposition on a random walk-type Laplacian matrix of the DIST, and determining the clustering number k of the pixel points, wherein the steps are as follows: constructing an adjacency matrix (wh-order square matrix):build degree matrix (wh order matrix): d (D) wh×wh =diag(sum(W wh×wh ) A) is provided; calculating a random walk matrix: l (L) rw =I-D wh×wh -1 W wh×wh The method comprises the steps of carrying out a first treatment on the surface of the For L rw Decomposing the characteristic values, and arranging the characteristic values in ascending order to obtain lambda 1 ≤λ 2 ≤…≤λ wh The method comprises the steps of carrying out a first treatment on the surface of the There is a certain value k such thatλ k Strictly greater than lambda k+1 And determining the clustering number of the pixel points as k. And then clustering all the pixel points by using an OPTICS method, wherein the method comprises the following specific steps of: input neighborhood radius e=10/255, neighbor number threshold +.>(rounding off); outputting a result queue by an OPTICS method; drawing an reachable distance graph according to the result queue; dividing pixel points into k classes according to the first k maximum values of the reachable distance graph; finally, selecting a representative pixel from each pixel cluster comprises the following steps: calculating and generating a distance matrix between every two pixel points in k pixel point clusters: DIST (DIST) 1 ,…,DIST k The method comprises the steps of carrying out a first treatment on the surface of the Selecting a pixel point with the smallest Sum of Distances (SDIST) between the pixel point and all other pixel points in the cluster from each pixel point cluster as a representative pixel point, wherein the SDIST i =sum(DIST i ),1≤i≤k。SDIST i For the ith distance matrix DIST i The sum of the values of each column (or each row).
According to the self-adaptive image compression method based on density clustering, the color types are automatically determined according to the input static image; clustering the pixel points with the same and similar colors by using a density clustering method; using the kernel point of the pixel cluster (SDIST i Pixel point corresponding to the minimum value) to replace the colors of other pixel points in the same cluster, thereby completing image compression and having low calculation complexity; and intelligent determination of the type of color after compression is achieved.
In one embodiment, determining a neighborhood radius, a neighborhood threshold, includes:
acquiring first parameter data corresponding to the picture data to be processed, second parameter data of shooting equipment corresponding to the picture data to be processed, third parameter data of a transmission path for transmitting the picture data to be processed, and fourth parameter data of a target object for receiving the picture data to be processed;
performing feature extraction on the first parameter data based on a preset first feature extraction template to obtain a plurality of first feature values;
performing feature extraction on the second parameter data based on a preset second feature extraction template to obtain a plurality of second feature values;
performing feature extraction on the third parameter data based on a preset third feature extraction template to obtain a plurality of third feature values;
performing feature extraction on the fourth parameter data based on a preset fourth feature extraction template to obtain a plurality of fourth feature values;
constructing an analysis parameter set based on the first feature value, the second feature value, the third feature value and the fourth feature value;
determining a parameter set based on the analysis parameter set and a preset analysis library;
and analyzing the parameter set, and determining a neighborhood radius and a neighborhood threshold.
The working principle and the beneficial effects of the technical scheme are as follows:
comprehensively analyzing first parameter data (picture size, resolution, picture type and the like) of the picture data to be processed, second parameter data (shooting parameters, model number, brand and the like) of shooting equipment corresponding to the picture data to be processed, third parameter data (bandwidth, maximum transmission rate, current residual bandwidth and the like) of a transmission path of the picture data to be transmitted, and fourth parameter data (receivable picture size, resolution and the like) of a target object of the picture data to be received; the parameters of the clusters, namely the neighborhood radius and the neighborhood threshold value, are determined through the autonomous analysis of a pre-constructed analysis library, and the adaptive compression is realized through analyzing the compressed scenes and carrying out parameter selection. The first characteristic value is a first quantized value after the first standard quantization corresponding to the first parameter data; the second characteristic value is a second quantized value after second standard quantization corresponding to second parameter data; the third characteristic value is a third quantized value after third standard quantization corresponding to third parameter data; the fourth characteristic value is a fourth quantized value after fourth standard quantization corresponding to the fourth parameter data. The analysis library is constructed by professionals in advance; in an analysis library, analyzing a parameter set and a parameter set in one-to-one correspondence; in the analysis process, based on an analysis parameter set and a preset analysis library, the parameter set is determined, specifically, the analysis parameter set is matched with the analysis parameter set in the library in a one-to-one correspondence manner, the parameter set associated with the analysis parameter set matched with the analysis parameter set is extracted, and the parameter set mainly comprises a neighborhood radius and a neighborhood threshold used for clustering. In addition, in order to improve the compression effect, a multi-time compression mode can be adopted, namely, a parameter set comprises a plurality of groups of neighborhood radii and neighborhood thresholds, and the neighborhood radii and the neighborhood thresholds are sequentially called for multi-time compression.
In one embodiment, the adaptive image compression method based on density clustering further comprises:
acquiring compressed second image data;
determining a plurality of evaluation parameters representing the compression effect based on the first image data and the second image data; the evaluation parameters included: distortion degree, compression ratio, etc.;
correlating the evaluation parameters, parameter sets and analysis parameter sets corresponding to the second image data to form analysis data and storing the analysis data into a database to be analyzed;
classifying and grouping analysis data in the database to be analyzed based on the analysis parameter set; data corresponding to the same analysis parameter set are classified into a group;
when the data quantity in the group reaches a preset quantity threshold (any value above 1000), extracting the group as an analysis data group;
determining the adaptation condition of the parameter set and the analysis parameter set based on the evaluation parameters of each analysis data in the analysis data set;
triggering an update mode when the adaptation condition belongs to a preset update triggering condition;
taking an analysis parameter set corresponding to the analysis data set as an analysis parameter set to be updated;
based on a plurality of preset adjustment parameter sets, adjusting the parameter sets, obtaining a plurality of adjusted parameter sets to be verified, and arranging the parameter sets to be verified to form a list to be called;
when the parameter set corresponding to the analysis parameter set to be updated is called, sequentially calling based on the sequence of the list to be called;
when the parameter set to be verified in the list to be called is called for preset times (for example, 1000 times);
based on a preset evaluation analysis library, analyzing a plurality of evaluation parameters corresponding to the parameter sets to be verified, and determining evaluation values corresponding to the parameter sets to be verified;
and extracting the parameter set to be verified with the highest evaluation value to replace the parameter set corresponding to the analysis parameter set to be updated in the analysis library.
The working principle and the beneficial effects of the technical scheme are as follows:
the compressed effect is analyzed and monitored, the parameter set in the analysis library and the adaptation condition of the analysis parameter set are determined to be verified, when the adaptation condition is not ideal, the update is triggered, the parameter set is adjusted through a plurality of preset adjustment parameter sets, then the parameter sets are respectively evaluated according to the adjusted parameter sets, and the appropriate parameter sets are selected for re-association, so that the update of the analysis library is realized, and the compression effect is ensured. The method comprises the steps of determining the adaptation condition of a parameter set and an analysis parameter set based on evaluation parameters of all analysis data in an analysis data set, wherein the adaptation condition is specifically as follows: firstly, carrying out feature extraction on evaluation parameters based on a preset evaluation feature extraction template to determine a plurality of evaluation features, and then adopting a preset scoring rule corresponding to each evaluation feature to determine a scoring value corresponding to each evaluation feature; and then the sum of the scoring values is referred to as an adaptation condition, and the triggering of the updating mode can be specifically triggered when the sum of the scoring values is smaller than or equal to a preset triggering threshold value. Wherein the evaluation features include: average and variance of compression ratio, average and variance of distortion, and the like. The evaluation analysis library comprises: and the evaluation feature extraction template and the scoring rule corresponding to each evaluation feature.
The invention also provides a self-adaptive image compression system based on density clustering, as shown in fig. 8, comprising:
the acquisition module 1 is used for preprocessing the picture data to be processed to acquire first image data;
the construction module 2 is used for calculating Euclidean distance between every two pixel points in the first image data and constructing a first matrix based on the Euclidean distance;
the first determining module 3 is used for determining a random walk type Laplace matrix corresponding to the first matrix, decomposing characteristic values of the random walk type Laplace matrix and determining the number of pixel point clusters;
the clustering module 4 is used for carrying out clustering processing on the first image data based on the number of the pixel point clusters to obtain a plurality of pixel point clusters;
the second determining module 5 is configured to determine a representative pixel point corresponding to each pixel point cluster;
and the replacing module 6 is used for determining RGB tristimulus values of other pixel points in the same cluster based on the RGB tristimulus values of the representative pixel points.
The obtaining module 1 pre-processes the picture data to be processed to obtain first image data, and performs the following operations:
determining the pixel width and the pixel height of a picture to be processed corresponding to the picture to be processed data;
and reading the values of three color channels of each pixel RGB in the picture to be processed, and carrying out normalization processing on the values of the three color channels of each pixel RGB.
Wherein, the calculation formula of each element in the first matrix is as follows:
in dist m,n Elements representing the mth row and the nth column of the first matrix; dist (dist) n,m Elements representing the nth row and mth column of the first matrix; r is (r) m,n 、g m,n 、b m,n RGB tristimulus values for pixels of an mth row and an nth column in the first image data; r is (r) m,n-1 、g m,n-1 、b m,n-1 RGB tristimulus values for pixels of an nth row and an nth column of the first image data.
The first determining module 3 determines a random walk type laplace matrix corresponding to the first matrix, performs eigenvalue decomposition on the random walk type laplace matrix, determines the number of pixel point clusters, and performs the following operations:
constructing an adjacent matrix corresponding to the first matrix; the adjacency matrix is expressed as
Constructing a degree matrix corresponding to the first matrix; the degree matrix is expressed as
D wh×wh =diag(sum(W wh×wh ));
Determining a random walk-type Laplacian matrix based on the adjacency matrix and the degree matrix; the random walk-type Laplace matrix is denoted as L rw =I-D wh×wh -1 W wh×wh
Performing eigenvalue decomposition on the random walk type Laplace matrix, and sequencing eigenvalues according to ascending order to obtain an eigenvalue sequence;
and determining the clustering number of the pixel points based on the characteristic value sequence.
The clustering module 4 performs clustering processing on the first image data based on the number of pixel point clusters to obtain a plurality of pixel point clusters, and performs the following operations:
determining the value of the cluster number of the pixel points as a reference value;
determining a neighborhood radius and a neighborhood threshold;
determining a result queue based on the neighborhood radius and the neighborhood threshold;
drawing an reachable distance graph based on the result queue;
the pixel points in the first image data are divided into pixel point clusters of which the number corresponds to the reference value based on the maximum value points of the front reference value of the reachable distance graph.
The second determining module 5 determines a representative pixel point corresponding to each pixel point cluster, and performs the following operations:
calculating a distance matrix between every two pixel points in each pixel point cluster;
and determining a pixel point with the smallest sum of the distances between the pixel point and other pixel points in the pixel point clusters from each pixel point cluster as a representative pixel point.
In one embodiment, clustering module 4 determines a neighborhood radius, a neighborhood threshold, and performs the following:
acquiring first parameter data corresponding to the picture data to be processed, second parameter data of shooting equipment corresponding to the picture data to be processed, third parameter data of a transmission path for transmitting the picture data to be processed, and fourth parameter data of a target object for receiving the picture data to be processed;
performing feature extraction on the first parameter data based on a preset first feature extraction template to obtain a plurality of first feature values;
performing feature extraction on the second parameter data based on a preset second feature extraction template to obtain a plurality of second feature values;
performing feature extraction on the third parameter data based on a preset third feature extraction template to obtain a plurality of third feature values;
performing feature extraction on the fourth parameter data based on a preset fourth feature extraction template to obtain a plurality of fourth feature values;
constructing an analysis parameter set based on the first feature value, the second feature value, the third feature value and the fourth feature value;
determining a parameter set based on the analysis parameter set and a preset analysis library;
and analyzing the parameter set, and determining a neighborhood radius and a neighborhood threshold.
In one embodiment, the adaptive image compression system based on density clustering further comprises: a monitoring module and an updating module;
the monitoring module performs the following operations:
acquiring compressed second image data;
determining a plurality of evaluation parameters representing the compression effect based on the first image data and the second image data;
correlating the evaluation parameters, parameter sets and analysis parameter sets corresponding to the second image data to form analysis data and storing the analysis data into a database to be analyzed;
classifying and grouping analysis data in the database to be analyzed based on the analysis parameter set;
when the data quantity in the group reaches a preset quantity threshold value, the group is extracted to be used as an analysis data group;
determining the adaptation condition of the parameter set and the analysis parameter set based on the evaluation parameters of each analysis data in the analysis data set;
triggering an update mode when the adaptation condition belongs to a preset update triggering condition;
after the monitoring module triggers the update mode, the update module executes the following operations:
taking an analysis parameter set corresponding to the analysis data set as an analysis parameter set to be updated;
based on a plurality of preset adjustment parameter sets, adjusting the parameter sets, obtaining a plurality of adjusted parameter sets to be verified, and arranging the parameter sets to be verified to form a list to be called;
when the parameter set corresponding to the analysis parameter set to be updated is called, sequentially calling based on the sequence of the list to be called;
when the parameter set to be verified in the list to be called is called for preset times;
based on a preset evaluation analysis library, analyzing a plurality of evaluation parameters corresponding to the parameter sets to be verified, and determining evaluation values corresponding to the parameter sets to be verified;
and extracting the parameter set to be verified with the highest evaluation value to replace the parameter set corresponding to the analysis parameter set to be updated in the analysis library.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (8)

1. An adaptive image compression method based on density clustering is characterized by comprising the following steps:
preprocessing picture data to be processed to obtain first image data;
calculating Euclidean distance between every two pixel points in the first image data and constructing a first matrix based on the Euclidean distance;
determining a random walk-type Laplace matrix corresponding to the first matrix, decomposing eigenvalues of the random walk-type Laplace matrix, and determining the number of pixel point clustering clusters;
clustering the first image data based on the pixel point cluster number to obtain a plurality of pixel point clusters;
determining a representative pixel point corresponding to each pixel point cluster;
determining RGB tristimulus values of other pixel points in the same cluster based on the RGB tristimulus values of the representative pixel points;
wherein, the calculation formula of each element in the first matrix is as follows:
;
in the method, in the process of the invention,representing the +.o in the first matrix>Line->Elements of a column; />Representing the +.o in the first matrix>Line->Elements of a column; />、/>、/>Is the +.>Line->RGB tristimulus values of pixels of a column; />、/>、/>Is the +.>Line->RGB tristimulus values of pixels of a column;
the determining the random walk type Laplace matrix corresponding to the first matrix and performing eigenvalue decomposition on the random walk type Laplace matrix, and determining the pixel point cluster number comprises the following steps:
constructing an adjacent matrix corresponding to the first matrix; the adjacency matrix is expressed as;
Constructing a degree matrix corresponding to the first matrix; the degree matrix is expressed as;
Based on the adjacency matrix and the degreeThe matrix is used for determining a random walk type Laplace matrix; the random walk-type Laplace matrix is expressed as
Performing eigenvalue decomposition on the random walk type Laplace matrix, and sequencing eigenvalues according to ascending order to obtain an eigenvalue sequence;
and determining the clustering number of the pixel points based on the characteristic value sequence.
2. The adaptive image compression method based on density clustering as claimed in claim 1, wherein preprocessing the picture data to be processed to obtain first image data includes:
determining the pixel width and the pixel height of a picture to be processed corresponding to the picture to be processed data;
and reading the values of three color channels of each pixel RGB in the picture to be processed and carrying out normalization processing on the values of the three color channels of each pixel RGB.
3. The adaptive image compression method based on density clustering as claimed in claim 1, wherein the clustering processing is performed on the first image data based on the number of clusters of pixels to obtain a plurality of clusters of pixels, including:
determining the value of the pixel point cluster number as a reference value;
determining a neighborhood radius and a neighborhood threshold;
determining a result queue based on the neighborhood radius and the neighborhood threshold;
drawing an reachable distance graph based on the result queue;
and dividing the pixel points in the first image data into pixel point clusters with the number corresponding to the reference value based on the maximum value points of the front reference value of the reachable distance graph.
4. The adaptive image compression method based on density clustering as claimed in claim 1, wherein said determining a representative pixel point corresponding to each of the pixel point clusters includes:
calculating a distance matrix between every two pixel points in each pixel point cluster;
and determining a pixel point with the smallest sum of the distances between the pixel point and other pixel points in the pixel point clusters from each pixel point cluster as a representative pixel point.
5. The adaptive image compression method based on density clustering as claimed in claim 3, wherein the determining a neighborhood radius, a neighborhood threshold, comprises:
acquiring first parameter data corresponding to picture data to be processed, second parameter data of shooting equipment corresponding to the picture data to be processed, third parameter data of a transmission path for transmitting the picture data to be processed, and fourth parameter data of a target object for receiving the picture data to be processed;
performing feature extraction on the first parameter data based on a preset first feature extraction template to obtain a plurality of first feature values;
performing feature extraction on the second parameter data based on a preset second feature extraction template to obtain a plurality of second feature values;
performing feature extraction on the third parameter data based on a preset third feature extraction template to obtain a plurality of third feature values;
performing feature extraction on the fourth parameter data based on a preset fourth feature extraction template to obtain a plurality of fourth feature values;
constructing an analysis parameter set based on the first feature value, the second feature value, the third feature value and the fourth feature value;
determining a parameter set based on the analysis parameter set and a preset analysis library;
and analyzing the parameter set, and determining the neighborhood radius and the neighborhood threshold.
6. The adaptive image compression method based on density clustering as claimed in claim 5, further comprising:
acquiring compressed second image data;
determining a plurality of evaluation parameters representing compression effects based on the first image data and the second image data;
correlating the evaluation parameters, parameter sets and analysis parameter sets corresponding to the second image data to form analysis data and storing the analysis data into a database to be analyzed;
classifying and grouping the analysis data in the database to be analyzed based on the analysis parameter set;
when the data quantity in the group reaches a preset quantity threshold value, the group is extracted to be used as an analysis data group;
determining the adaptation of a parameter set and an analysis parameter set based on the evaluation parameters of each analysis data in the analysis data set;
triggering an update mode when the adaptation condition belongs to a preset update triggering condition;
taking the analysis parameter set corresponding to the analysis data set as an analysis parameter set to be updated;
based on a plurality of preset adjustment parameter sets, adjusting the parameter sets, obtaining a plurality of adjusted parameter sets to be verified, and arranging the parameter sets to be verified to form a list to be called;
when the parameter set corresponding to the analysis parameter set to be updated is called, sequentially calling based on the sequence of the list to be called;
when the parameter set to be verified in the list to be called is called for preset times;
analyzing a plurality of evaluation parameters corresponding to the parameter sets to be verified based on a preset evaluation analysis library, and determining evaluation values corresponding to the parameter sets to be verified;
and extracting the parameter set to be verified with the highest evaluation value to replace the parameter set corresponding to the analysis parameter set to be updated in the analysis library.
7. An adaptive image compression system based on density clustering, comprising:
the acquisition module is used for preprocessing the picture data to be processed to acquire first image data;
the construction module is used for calculating Euclidean distance between every two pixel points in the first image data and constructing a first matrix based on the Euclidean distance;
the first determining module is used for determining a random walk type Laplace matrix corresponding to the first matrix, decomposing characteristic values of the random walk type Laplace matrix and determining the number of pixel point clustering clusters;
the clustering module is used for carrying out clustering processing on the first image data based on the pixel point cluster number to obtain a plurality of pixel point clusters;
the second determining module is used for determining a representative pixel point corresponding to each pixel point cluster;
the replacing module is used for determining RGB tristimulus values of other pixel points in the same cluster based on the RGB tristimulus values of the representative pixel points;
wherein, the calculation formula of each element in the first matrix is as follows:
;
in the method, in the process of the invention,representing the +.o in the first matrix>Line->Elements of a column; />Representing the +.o in the first matrix>Line->Elements of a column; />、/>、/>Is the +.>Line->RGB tristimulus values of pixels of a column; />、/>、/>Is the +.>Line->RGB tristimulus values of pixels of a column;
the first determining module determines a random walk type Laplace matrix corresponding to the first matrix, performs eigenvalue decomposition on the random walk type Laplace matrix, determines the number of pixel point cluster clusters, and executes the following operations:
constructing an adjacent matrix corresponding to the first matrix; the adjacency matrix is expressed as;
Constructing a degree matrix corresponding to the first matrix; the degree matrix is expressed as;
Determining a random walk-type Laplacian matrix based on the adjacency matrix and the degree matrix; the random walk-type Laplace matrix is expressed as
Performing eigenvalue decomposition on the random walk type Laplace matrix, and sequencing eigenvalues according to ascending order to obtain an eigenvalue sequence;
and determining the clustering number of the pixel points based on the characteristic value sequence.
8. The adaptive image compression system based on density clustering as claimed in claim 7, wherein the obtaining module performs preprocessing on the picture data to be processed to obtain the first image data, and performs the following operations:
determining the pixel width and the pixel height of a picture to be processed corresponding to the picture to be processed data;
and reading the values of three color channels of each pixel RGB in the picture to be processed and carrying out normalization processing on the values of the three color channels of each pixel RGB.
CN202310399100.5A 2023-04-13 2023-04-13 Self-adaptive image compression method and system based on density clustering Active CN116471412B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310399100.5A CN116471412B (en) 2023-04-13 2023-04-13 Self-adaptive image compression method and system based on density clustering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310399100.5A CN116471412B (en) 2023-04-13 2023-04-13 Self-adaptive image compression method and system based on density clustering

Publications (2)

Publication Number Publication Date
CN116471412A CN116471412A (en) 2023-07-21
CN116471412B true CN116471412B (en) 2024-03-08

Family

ID=87178361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310399100.5A Active CN116471412B (en) 2023-04-13 2023-04-13 Self-adaptive image compression method and system based on density clustering

Country Status (1)

Country Link
CN (1) CN116471412B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117576493B (en) * 2024-01-16 2024-04-02 武汉明炀大数据科技有限公司 Cloud storage compression method and system for large sample data
CN117788873B (en) * 2024-02-26 2024-05-03 山东和润恒建筑工程有限公司 Engineering building BIM data security management method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622753A (en) * 2012-02-28 2012-08-01 西安电子科技大学 Semi-supervised spectral clustering synthetic aperture radar (SAR) image segmentation method based on density reachable measure
CN104899899A (en) * 2015-06-12 2015-09-09 天津大学 Color quantification method based on density peak value
CN106529588A (en) * 2016-11-02 2017-03-22 浙江工业大学 Nonlinear manifold learning dimension reduction method based on adaptive density clustering

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9699468B2 (en) * 2014-02-10 2017-07-04 Microsoft Technology Licensing, Llc Adaptive screen and video coding scheme
US11816149B2 (en) * 2020-02-11 2023-11-14 Samsung Electronics Co., Ltd. Electronic device and control method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622753A (en) * 2012-02-28 2012-08-01 西安电子科技大学 Semi-supervised spectral clustering synthetic aperture radar (SAR) image segmentation method based on density reachable measure
CN104899899A (en) * 2015-06-12 2015-09-09 天津大学 Color quantification method based on density peak value
CN106529588A (en) * 2016-11-02 2017-03-22 浙江工业大学 Nonlinear manifold learning dimension reduction method based on adaptive density clustering

Also Published As

Publication number Publication date
CN116471412A (en) 2023-07-21

Similar Documents

Publication Publication Date Title
CN116471412B (en) Self-adaptive image compression method and system based on density clustering
CN115914634B (en) A method and system for managing environmental security engineering monitoring data
CN110198444B (en) Video frame encoding method, video frame encoding apparatus, and device having storage function
EP3942475B1 (en) Using rate distortion cost as a loss function for deep learning
EP1022682A2 (en) Color clustering for scene change detection and object tracking in video sequences
CN115834895B (en) Efficient data compression and storage method for unmanned aerial vehicle
JPH0799581A (en) Picture processing device
CN112861135B (en) Malicious code detection method based on attention mechanism
Xie et al. Bag-of-words feature representation for blind image quality assessment with local quantized pattern
Žalik et al. Comparison of K-means, K-means++, X-means and Single Value Decomposition for Image Compression
CN116343201A (en) Grain class identification method and device and computer equipment
CN114463450A (en) Computer image compression method and system based on artificial intelligence
CN114511732A (en) Citrus spotted disease and insect pest fine-grained image identification method
Halder et al. An evolutionary dynamic clustering based colour image segmentation
Begum An efficient algorithm for codebook design in transform vector quantization
CN117640931A (en) VVC intra-frame coding rapid block division method based on graph neural network
CN113723410A (en) Digital tube digital identification method and device
CN116996685A (en) Image compression processing method and device based on multiple channels
Mei et al. Lightweight high-performance blind image quality assessment
CN112738521B (en) Video encoding method and apparatus, electronic device, and storage medium
CN112070851B (en) Index Graph Prediction Method Based on Genetic Algorithm and BP Neural Network
Tai et al. Genetic algorithm for single bit map absolute moment block truncation coding of color images
Rhee et al. Lossless compression of raw images by learning the prediction and frequency decomposition
CN113469922A (en) Image processing method, computer device, and computer-readable storage medium
CN120151551B (en) Conference information processing method and system based on big data

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
GR01 Patent grant
GR01 Patent grant