CN112784859A - Image clustering method based on matrix - Google Patents
Image clustering method based on matrix Download PDFInfo
- Publication number
- CN112784859A CN112784859A CN201911061622.4A CN201911061622A CN112784859A CN 112784859 A CN112784859 A CN 112784859A CN 201911061622 A CN201911061622 A CN 201911061622A CN 112784859 A CN112784859 A CN 112784859A
- Authority
- CN
- China
- Prior art keywords
- matrix
- clustering
- image
- similarity
- column
- 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.)
- Pending
Links
- 239000011159 matrix material Substances 0.000 title claims abstract description 84
- 238000000034 method Methods 0.000 title claims abstract description 46
- 238000004364 calculation method Methods 0.000 claims abstract description 12
- 238000003491 array Methods 0.000 claims description 21
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 238000012545 processing Methods 0.000 abstract description 9
- 230000000007 visual effect Effects 0.000 abstract description 8
- 238000005516 engineering process Methods 0.000 abstract description 7
- 238000005259 measurement Methods 0.000 abstract description 4
- 230000008569 process Effects 0.000 description 11
- 230000000694 effects Effects 0.000 description 10
- 230000003595 spectral effect Effects 0.000 description 9
- 241000282414 Homo sapiens Species 0.000 description 7
- 230000011218 segmentation Effects 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000003709 image segmentation Methods 0.000 description 3
- 230000008447 perception Effects 0.000 description 3
- 230000009467 reduction Effects 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 2
- HPTJABJPZMULFH-UHFFFAOYSA-N 12-[(Cyclohexylcarbamoyl)amino]dodecanoic acid Chemical group OC(=O)CCCCCCCCCCCNC(=O)NC1CCCCC1 HPTJABJPZMULFH-UHFFFAOYSA-N 0.000 description 1
- 241000282412 Homo Species 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011840 criminal investigation Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000010191 image analysis Methods 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 230000002265 prevention Effects 0.000 description 1
- 238000011524 similarity measure Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Mathematical Analysis (AREA)
- Computational Mathematics (AREA)
- Pure & Applied Mathematics (AREA)
- Mathematical Optimization (AREA)
- General Engineering & Computer Science (AREA)
- Artificial Intelligence (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computing Systems (AREA)
- Evolutionary Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Algebra (AREA)
- Databases & Information Systems (AREA)
- Software Systems (AREA)
- Image Analysis (AREA)
Abstract
The invention provides a matrix-based image clustering method, which relates to the field of image processing and aims at solving the problems that the existing image clustering algorithm is high in computational complexity, low in clustering efficiency and difficult to adapt to the current big data environment. According to the technical scheme, the speed of clustering calculation of the images is increased, the high efficiency, convenience and rapidness of image clustering are realized, and the application of the image clustering technology in the fields of visual navigation, target measurement, target tracking and positioning and the like is optimized.
Description
Technical Field
The invention belongs to the field of image processing, relates to an image clustering method, in particular to an image clustering method which can be widely applied to various fields including machine vision navigation, target measurement, target tracking, positioning and the like, and specifically relates to a matrix calculation-based clustering method for color images by utilizing human vision multi-scale perception characteristics.
Background
Image clustering is to analyze images in an image library by using a computer, and classify each pixel or area in the images into one of a plurality of characteristic categories to replace visual discrimination of human beings on the images. The process of image clustering is essentially a knowledge-based image understanding process, and is also extension and development of human visual discrimination on images.
The image clustering technology is to search according to the semantic and perception characteristics of the image, and is realized by extracting specific information clues or characteristic indexes from the image data, searching from a large number of images stored in an image database according to the clues and searching the image data with similar characteristics. The image clustering technology is to cluster images according to a certain similarity principle, to group similar images into a class, and to perform the retrieval process in the class, thereby greatly reducing the image retrieval range and achieving the purpose of rapidly and accurately retrieving images.
The image clustering technology has wide application prospect in various industries. For example, in the public security industry, with the continuous development of public security informatization, an image recognition technology is widely applied in the public security industry, video pictures are obtained through means of camera snapshot, picture structuralization and the like, and a dynamic resource library is formed. The machine vision analysis technology based on image clustering can provide powerful support for public security prevention and control, criminal investigation and case solving, anti-terrorism and anti-riot and other works. In the field of navigation, for example, a visual automatic navigation system that uses ambient information to navigate using a camera mounted on a vehicle body is known. The position and attitude information of the vehicle relative to the road can be obtained through analysis and processing of the image information acquired by the camera, and corresponding path planning is made, so that automatic navigation of the vehicle is realized.
The current conventional image clustering method is spectral clustering. The main advantage of the spectral clustering method is that spectral clustering only requires a similarity matrix between data, so that clustering for processing sparse data is very effective, which is difficult to achieve by traditional clustering algorithms such as K-Means. And because dimension reduction is used, the complexity in processing high-dimensional data clustering is better than that of the traditional clustering algorithm. However, the main disadvantage of the spectral clustering method is that if the dimension of the final cluster is very high, the operation complexity of the dimension reduction is high, so the operation speed of the spectral clustering is slow and the final clustering effect is not ideal.
The current mainstream image clustering method has the defects that the visual features are lack of the autonomous learning ability, so that the image expression ability is not strong, and the traditional clustering algorithm has high computational complexity and low clustering efficiency and is difficult to adapt to the current big data environment. Therefore, currently, due to the limitation of low clustering speed, many concepts and applications cannot be substantially developed, and only the technical theory can be remained. Therefore, finding a method for classifying images efficiently, conveniently and quickly has become an important foundation and an essential important link for image processing.
Disclosure of Invention
The invention provides an image clustering method based on a matrix, aiming at solving the problems that the current image clustering algorithm has higher calculation complexity, low clustering efficiency and difficulty in adapting to the current big data environment in the prior art, and aiming at realizing high efficiency, convenience and quickness of image clustering work.
In order to achieve the purpose, the invention provides the following technical scheme:
a matrix-based image clustering method comprises the following steps:
firstly, segmenting superpixel image blocks of an image and extracting the center attribute of the superpixel in each superpixel image block;
secondly, obtaining an adjacency matrix reflecting the adjacent relation between the super-pixel image blocks;
thirdly, obtaining a similarity matrix reflecting the similarity of the super pixels between adjacent super pixel image blocks according to the adjacent matrix;
and fourthly, finishing clustering on the super-pixel image blocks according to the similarity matrix.
Preferably, the super-pixel center attribute includes the following attributes: coordinates center (x, y), color _ info (l, a, b), superpixel unique identifier id labels, superpixel number num _ pixels in the image.
Preferably, the specific algorithm for calculating the adjacency matrix is implemented as follows:
wherein, i, j represent the super pixel picture block sequence number respectively;
each element number E (i, j) in the adjacency matrix E satisfies the following functional relationship:
wherein the relationship between the superpixel tiles themselves and themselves is defined as the adjacency.
Preferably, the step of calculating the similarity matrix is to calculate the similarity of two superpixels according to the adjacent relationship of the superpixel blocks in the adjacent matrix, and when the similarity must be greater than a certain threshold, the corresponding element value is set to 1, otherwise, the element value is set to 0, and the specific algorithm is implemented as follows:
(1) conversion from CIE Lab color space to L θ M color space
θ '═ atan2(B, A) θ' ∈ (- π, π ] (equation 3-1)
l=L l∈[0,100]
(2) Similarity calculation
Wherein L isth,θth,Mth,Lth0,θth0Respectively threshold three components in the L theta M color space,MCththe threshold value for distinguishing color and black-and-white color spaces by the modulo length component is usually less than or equal to 2, Li,Lj,θi,θj,Mi,MjRespectively, the average values of the super-pixel image blocks i, j in the L theta M color space; w (i, j) represents the similarity of two superpixel blocks, wherein a value of 1 is similar, and a value of 0 is dissimilar.
Preferably, the clustering step uses the similarity W (i, j) to generate a similarity matrix W, where W is a clustering relation graph.
Preferably, the specific algorithm implementation for completing clustering based on the similarity matrix W includes: a step of converting the similarity matrix W into a triangular matrix,
similarity matrix
The triangular matrix is used for setting all the lower left corners to zero,
preferably, the specific algorithm implementation for completing clustering based on the similarity matrix W includes: the step of completing the clustering is carried out,
performing clustering algorithms on triangular matrices
The first step is as follows:
starting from the n-th row and n-th column of the matrix, searching all the arrays with 1 on the n-th column, if the array with 1 on the n-th column only has the n-th row, the a (n, n) is 1, otherwise the a (n, n) is 0.
The formula is as follows:
if it is not
a(n,n)=0
The arrays are logically ORed in "row descending" order by column (1, 2, 3 … … n) and the result is assigned to the non-zero array [0,0, … … a (i) with the smallest row number in the n columnsmin,imin),……,a(imin,n-1),a(imin,n)]Performing the following steps; the non-zero term OR algorithm for the columns is as follows:
a(imin,n)=a(imin,n)∪...∪a(n,n)
a(imin,n-1)=a(imin,n-1)∪...∪a(n,n-1)
…………………………………………
a(imin,imin)=a(imin,imin)∪...∪a(n,imin)
and (4) assignment operation:
a(n,n)=0
the operation is finished;
the second step is that:
starting from the n-1 th row and the n-1 th column of the matrix, searching all arrays with 1 on the n-1 th column, if the arrays with 1 on the n-1 th column only have the n-1 th row, a (n-1 ) ═ 1, otherwise a (n-1 ) ═ 0
The formula is as follows:
if it is not
a(n-1,n-1)=0
The arrays are logically ORed in "row descending" order for their columns (1, 2, 3 … … n-1) and the result is assigned to the non-zero array [0,0, … … a (i) with the smallest row number in column n-1min,imin),……,a(imin,n-1),a(imin,n)]Performing the following steps; the non-zero term OR algorithm for the columns is as follows:
a(imin,jn)=a(imin,jn)∪...∪a(n,jn)
a(imin,jn-1)=a(imin,jn-1)∪...∪a(n,jn-1)
…………………………………………
a(imin,imin)=a(imin,jmin)∪...∪a(n,imin)
and (4) assignment operation:
a(n-1,n~n-1)=0
ending the operation;
the third step:
and so on, starting from the ith row and the ith column of the matrix, searching all the arrays with 1 on the ith column, if the array with 1 on the ith column only has the ith row, then a (i, i) is 1, otherwise a (i, i) is 0
The formula is as follows:
if it is not
a(i,i)=0
The arrays are logically ORed in "row descending" order by column (1, 2, 3 … … n) and the result is assigned to the non-zero array [0,0, … … a (i) with the smallest row number in column imin,imin),……,a(imin,n-1),a(imin,n)]Performing the following steps; the non-zero term or algorithm in the column is as follows:
a(imin,jn)=a(imin,jn)∪...∪a(n,jn)
a(imin,jn-1)=a(imin,jn-1)∪...∪a(n,jn-1)
…………………………………………
a(imin,imin)=a(imin,jmin)∪...∪a(n,imin)
and (4) assignment operation:
a(i,n~n-i)=0
ending the operation;
the fourth step:
traversing each row of the triangular matrix once according to the above algorithm to obtain the following similar matrix:
all non-zero row number groups in the matrix are the groups of the cluster tiles.
Due to the adoption of the scheme, the invention has the beneficial effects that:
the invention relates to an image clustering method adopting a brand-new concept, which is different from any traditional image clustering method and is a clustering method simulating the process of identifying objects by human eyes.
The method of the invention compares the operation performance with the traditional spectral clustering and histogram clustering method as follows:
configuration of the computer: CPU + GPU
Wherein: CPU model i5 ═ 4590 dominant frequency: 3.3 GHz;
the CUDA core number of the GPU is 2880 dominant frequency 705 MHz.
The resolution of the computed image is: 1920 x 1080
Comparison of the operational performances of different image clustering methods:
name of clustering method | Number of iterations | Operation time (unit: second) |
Spectral clustering | 5 | 180 |
Histogram of the data | 5 | 60 |
Novel spectral clustering (patent) | 1 | 0.05 |
As can be seen from the comparison table, the method of the invention is obviously superior to the traditional spectral clustering and histogram clustering methods in the operational performance. Therefore, the technical scheme of the invention can improve the operation speed of image clustering calculation, thereby optimizing the application of the image clustering technology in the fields of visual navigation, target measurement, target tracking, positioning and the like.
Drawings
Fig. 1 to 3 show a first embodiment of the present invention: and (5) processing the cluster containing the face scene image.
Fig. 4 to 6 show a second embodiment of the present invention: and (5) clustering the road scene images.
Fig. 7 to 9 show a third embodiment of the present invention: and (5) clustering the indoor scene images.
Fig. 10 to 12 show a fourth embodiment of the present invention: and clustering the outdoor scene image I.
Fig. 13 to 15 show a fifth embodiment of the present invention: and clustering the outdoor scene image II.
Detailed Description
The following describes in more detail embodiments of the present invention with reference to the schematic drawings. The advantages and features of the present invention will become more apparent from the following description. It is to be noted that the drawings are in a very simplified form and are not to precise scale, which is merely for the purpose of facilitating and distinctly claiming the embodiments of the present invention.
The algorithm of the invention comprises the following steps:
step one, recalculating the clustering center Seed.
This step is a process of labeling each pixel in the image such that pixels with the same label have some common visual characteristic. The result of superpixel segmentation is a set of sub-regions on the image, the totality of which covers the entire image, or a set of contour lines extracted from the image, such as edge detection. Each pixel in a super-pixel tile is similar in some measure of characteristic or calculated characteristic, such as color, brightness, texture. The adjacent regions differ greatly in some measure of the characteristic.
In the field of computer vision, the super-pixels are widely applied to the initial stage of image segmentation and understanding, and the redundancy of local information of an image can be effectively reduced by using the super-pixels, so that the complexity of image processing is reduced. Pixels are not the focus of human vision. Since the human-acquired image is derived from a region of a combination of many pixels, a single pixel is of little practical significance and is only meaningful to humans when combined together. Thus in this case there is the concept of "super-pixels". The super-pixel is a small area composed of a series of pixels with similar characteristics such as color, brightness, texture and the like, which are adjacent in position in an image, and most of the small areas retain effective information for further image segmentation, and generally do not destroy boundary information of objects in the image. Therefore, the super pixels are used for replacing the original pixel points as the nodes of the graph to carry out image segmentation, so that the scale of image processing can be greatly reduced, and the advantage of calculation is brought.
The center attribute of the super pixel is defined as follows:
the code is implemented as follows:
the above codes are for reference only.
And step two, calculating an adjacency matrix E.
The step of the invention considers that in the clustering of the super pixel blocks, only the mutual clustering between the adjacent super pixel blocks is considered, and the calculation is not needed for the non-adjacent super pixel blocks, so that an adjacent matrix E is firstly given, and the calculation of the adjacent matrix in the step is served for the subsequent similarity clustering.
The invention adopts parallel computation:
(Note: i, j are respectively the numbers of the blocks representing the super pixels)
Each element number E (i, j) in the adjacency matrix E satisfies the following functional relationship:
(Note: the relationship between the superpixel tiles themselves and themselves is defined as being contiguous)
Step three, similarity matrix W
The similarity measure is used to compare a function of the images. Similarity between an image and an image or between a portion of an image is a very important issue at the bottom of the computer vision field. For the image clustering algorithm proposed by us, the similarity plays a decisive key role, and different similarity measurement modes can lead to distinct clustering effects.
The algorithm idea of the step of the invention is to calculate the similarity of two superpixels according to the adjacent relation of superpixel blocks in the adjacency matrix E, and when the similarity must be greater than a certain threshold, the corresponding element value is set to 1, otherwise, the element value is set to 0, and the specific algorithm is realized as follows.
(Note: the algorithm can be changed to different parameters and formulas depending on the scene)
The calculation formula is as follows:
first of all a transformation of the color space is performed,i.e. from the CIE Lab space to the L θ M space.
The step effectively simulates the conversion of human beings to the recognition mode based on the surface color and brightness of the object under the condition of different color saturation, realizes the effective clustering of the objects with different color saturation in the scene image, improves the clustering effect and the anti-interference capability of the image, has obvious dimension reduction effect on image clustering segmentation, and can effectively improve the efficiency and the accuracy of image analysis.
The color space can be specifically referred to the color space described in the chinese patent application publication No. CN104063707A and patent No. ZL 201410334974.3, "color image clustering segmentation method based on human visual multi-scale perception characteristics".
θ '═ atan2(B, A) θ' ∈ (- π, π ] (equation 3-1)
l=L l∈[0,100]
The code is implemented as follows:
then, the similarity calculation
Wherein L isth,θth,Mth,Lth0,θth0Thresholds, M, for three components in L θ M color space, respectivelyCthThe threshold value for distinguishing color and black-and-white color spaces by the modulo length component is usually less than or equal to 2, Li,Lj,θi,θj,Mi,MjRespectively, the average of the superpixel tiles i, j in L θ M color space. w (i, j) represents the similarity of two superpixel blocks, wherein a value of 1 is similar, and a value of 0 is dissimilar.
Step four, clustering
The algorithm of the step is to generate a similarity matrix W (W is a clustering relation graph) by utilizing the similarity W (i, j);
the algorithm for completing clustering based on the similarity matrix W comprises the following steps:
first, the similarity matrix W is converted into a triangular matrix
Similarity matrix
Triangular matrix (set the left lower corner to zero)
Then, clustering is completed
Performing clustering algorithms on triangular matrices
The first step is as follows:
starting from the n-th row and n-th column of the matrix, searching all the arrays with 1 on the n-th column, if the array with 1 on the n-th column only has the n-th row, the a (n, n) is 1, otherwise the a (n, n) is 0.
The formula is as follows:
if it is not
a(n,n)=0
The arrays are logically ORed in "row descending" order by column (1, 2, 3 … … n) and the result is assigned to the non-zero array [0,0, … … a (i) with the smallest row number in the n columnsmin,imin),……,a(imin,n-1),a(imin,n)]In (1). The non-zero term OR algorithm for the columns is as follows:
a(imin,n)=a(imin,n)∪...∪a(n,n)
a(imin,n-1)=a(imin,n-1)∪...∪a(n,n-1)
…………………………………………
a(imin,imin)=a(imin,imin)∪...∪a(n,imin)
and (4) assignment operation:
a(n,n)=0
the operation is finished.
The second step is that:
starting from the n-1 th row and the n-1 th column of the matrix, searching all arrays with 1 on the n-1 th column, if the arrays with 1 on the n-1 th column only have the n-1 th row, a (n-1 ) ═ 1, otherwise a (n-1 ) ═ 0
The formula is as follows:
if it is not
a(n-1,n-1)=0
The arrays are logically ORed in "row descending" order for their columns (1, 2, 3 … … n-1) and the result is assigned to the non-zero array [0,0, … … a (i) with the smallest row number in column n-1min,imin),……,a(imin,n-1),a(imin,n)]In (1). The non-zero term OR algorithm for the columns is as follows:
a(imin,jn)=a(imin,jn)∪...∪a(n,jn)
a(imin,jn-1)=a(imin,jn-1)∪...∪a(n,jn-1)
…………………………………………
a(imin,imin)=a(imin,jmin)∪...∪a(n,imin)
and (4) assignment operation:
a(n-1,n~n-1)=0
and ending the operation.
The third step:
and so on, starting from the ith row and the ith column of the matrix, searching all the arrays with 1 on the ith column, if the array with 1 on the ith column only has the ith row, then a (i, i) is 1, otherwise a (i, i) is 0
The formula is as follows:
if it is not
a(i,i)=0
The arrays are logically ORed in "row descending" order by column (1, 2, 3 … … n) and the result is assigned to the non-zero array [0,0, … … a (i) with the smallest row number in column imin,imin),……,a(imin,n-1),a(imin,n)]In (1). The non-zero term or algorithm in the column is as follows:
a(imin,jn)=a(imin,jn)∪...∪a(n,jn)
a(imin,jn-1)=a(imin,jn-1)∪...∪a(n,jn-1)
…………………………………………
a(imin,imin)=a(imin,jmin)∪...∪a(n,imin)
and (4) assignment operation:
a(i,n~n-i)=0
and ending the operation.
The fourth step:
traversing each row of the triangular matrix once according to the above algorithm to obtain the following similar matrix:
all non-zero row number groups in the matrix are the groups of the cluster tiles.
The calculation process and the clustering effect of the present invention are verified by several embodiments.
Example one
This embodiment shows the clustering process of an image containing a face scene by using the method of the present invention. Fig. 1 is an original image of the scene. FIG. 2 is a superpixel block image before clustering, where the super pixel block segmentation is performed on the image and the super pixel center attribute in each superpixel block is extracted. FIG. 3 is a diagram of the clustered image, which completes clustering the superpixel blocks according to the neighboring matrix and the similarity matrix. As can be seen from FIG. 3, the clustering algorithm of the present invention has an ideal clustering effect on such scene images, and achieves a machine-recognizable degree.
Example two
This embodiment shows the clustering process of the images of a road scene by using the method of the present invention. Fig. 4 is an original image of the road scene. FIG. 5 is a superpixel block image prior to clustering, where the image is segmented into superpixel blocks and superpixel center attributes in each superpixel block are extracted. FIG. 6 is a clustered image, which completes clustering superpixel tiles according to the neighboring matrix and the similarity matrix. As can be seen from FIG. 6, the clustering algorithm of the present invention has an ideal clustering effect on such scene images, and achieves a machine-recognizable degree.
EXAMPLE III
This embodiment shows the clustering process of an image of an indoor scene by using the method of the present invention. Fig. 7 is an original image of the indoor scene. FIG. 8 is a superpixel block image prior to clustering, where the image is segmented into superpixel blocks and the superpixel center attributes in each superpixel block are extracted. FIG. 9 is a clustered image, which completes clustering superpixel tiles according to the neighboring matrix and the similarity matrix. As can be seen from fig. 9, the clustering algorithm of the present invention has an ideal clustering effect on such scene images, and achieves a machine-recognizable degree.
Example four
This embodiment shows the clustering process of an image of an outdoor scene by using the method of the present invention. Fig. 10 is an original image of the outdoor scene. FIG. 11 is a superpixel block image prior to clustering, where the image is segmented into superpixel blocks and the superpixel center attributes in each superpixel block are extracted. FIG. 12 is a clustered image, which completes clustering superpixel tiles according to the neighboring matrix and the similarity matrix. As can be seen from fig. 12, the clustering algorithm of the present invention has an ideal clustering effect on such scene images, and achieves a machine-recognizable degree.
EXAMPLE five
This embodiment shows the clustering process of another image of the outdoor scene by using the method of the present invention. Fig. 13 is an original image of the outdoor scene. FIG. 14 is a superpixel block image prior to clustering, where the image is segmented into superpixel blocks and the superpixel center attributes in each superpixel block are extracted. FIG. 15 is a clustered image, which completes clustering superpixel tiles according to the neighboring matrix and the similarity matrix. As can be seen from fig. 15, the clustering algorithm of the present invention has an ideal clustering effect on such scene images, and achieves a machine-recognizable degree.
The above description is only a preferred embodiment of the present invention, and does not limit the present invention in any way. It will be understood by those skilled in the art that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (7)
1. A matrix-based image clustering method is characterized by comprising the following steps:
firstly, segmenting superpixel image blocks of an image and extracting superpixel center attributes in each superpixel image block, wherein the superpixel center attributes comprise a position center and a color center;
secondly, obtaining an adjacency matrix reflecting the adjacent relation between the super-pixel image blocks;
thirdly, obtaining a similarity matrix reflecting the similarity degree between adjacent super-pixel image blocks according to the adjacency matrix, wherein the similarity degree comprises the similarity degree of position adjacency relation and color;
and fourthly, finishing clustering on the super-pixel image blocks according to the similarity matrix.
2. The matrix-based image clustering method according to claim 1, wherein the superpixel center attributes include the following attributes: coordinates center (x, y) in the image center, color mean color _ info (l, a, b), superpixel unique identifier id labels, number of superpixels num _ pixels.
3. The matrix-based image clustering method according to claim 2, wherein the specific algorithm for computing the adjacency matrix is implemented as follows:
wherein, i, j represent the super pixel picture block sequence number respectively;
each element number E (i, j) in the adjacency matrix E satisfies the following functional relationship:
wherein the relationship between the superpixel tiles themselves and themselves is defined as the adjacency.
4. The matrix-based image clustering method according to claim 3, wherein the step of calculating the similarity matrix is to calculate the similarity of two adjacent superpixels according to the adjacent relationship of superpixel blocks in the adjacency matrix, and when the similarity must be greater than a certain threshold, the corresponding element value is set to 1, otherwise to 0, and the specific algorithm is implemented as follows:
(1) conversion from CIE Lab color space to L θ M color space
θ '═ atan2(B, A) θ' ∈ (- π, π ] (equation 3-1)
l=L l∈[0,100]
(2) Similarity calculation
Wherein L isth,θth,Mth,Lth0,θth0Thresholds, M, for three components in L θ M color space, respectivelyCthThe threshold value for distinguishing color and black-and-white color spaces by the modulo length component is usually less than or equal to 2, Li,Lj,θi,θj,Mi,MjRespectively, the average values of the super-pixel image blocks i, j in the L theta M color space; w (i, j) represents the similarity of two superpixel blocks, wherein a value of 1 is similar, and a value of 0 is dissimilar.
5. The method for clustering matrix-based images according to claim 4, wherein the clustering step uses the similarity W (i, j) to generate a similarity matrix W, which is a clustering relation graph.
6. The method for clustering images based on a matrix according to claim 5, wherein the specific algorithm implementation for completing clustering based on the similarity matrix W comprises: a step of converting the similarity matrix W into a triangular matrix,
similarity matrix
The triangular matrix is used for setting all the lower left corners to zero,
7. the method for clustering images based on a matrix according to claim 6, wherein the specific algorithm implementation for completing clustering based on the similarity matrix W comprises: the step of completing the clustering is carried out,
performing clustering algorithms on triangular matrices
The first step is as follows:
starting from the n-th row and n-th column of the matrix, searching all the arrays with 1 on the n-th column, if the array with 1 on the n-th column only has the n-th row, the a (n, n) is equal to 1, otherwise the a (n, n) is equal to 0
The formula is as follows:
if it is not
a(n,n)=0
The arrays are logically ORed in "row descending" order by column (1, 2, 3 … … n) and the result is assigned to the non-zero array [0,0, … … a (i) with the smallest row number in the n columnsmin,imin),……,a(imin,n-1),a(imin,n)]Performing the following steps; the non-zero term OR algorithm for the columns is as follows:
a(imin,n)=a(imin,n)∪...∪a(n,n)
a(imin,n-1)=a(imin,n-1)∪...∪a(n,n-1)
…………………………………………
a(imin,imin)=a(imin,imin)∪...∪a(n,imin)
and (4) assignment operation:
a(n,n)=0
the operation is finished;
the second step is that:
starting from the n-1 th row and the n-1 th column of the matrix, searching all arrays with 1 on the n-1 th column, if the arrays with 1 on the n-1 th column only have the n-1 th row, a (n-1 ) ═ 1, otherwise a (n-1 ) ═ 0
The formula is as follows:
if it is not
a(n-1,n-1)=0
The arrays are logically ORed in "row descending" order for their columns (1, 2, 3 … … n-1) and the result is assigned to the non-zero array [0,0, … … a (i) with the smallest row number in column n-1min,imin),……,a(imin,n-1),a(imin,n)]Performing the following steps; the non-zero term OR algorithm for the columns is as follows:
a(imin,jn)=a(imin,jn)∪...∪a(n,jn)
a(imin,jn-1)=a(imin,jn-1)∪...∪a(n,jn-1)
…………………………………………
a(imin,imin)=a(imin,jmin)∪...∪a(n,imin)
and (4) assignment operation:
a(n-1,n~n-1)=0,
the operation is finished;
the third step:
and so on, starting from the ith row and the ith column of the matrix, searching all the arrays with 1 on the ith column, if the array with 1 on the ith column only has the ith row, then a (i, i) is 1, otherwise a (i, i) is 0
The formula is as follows:
if it is not
a(i,i)=0
The arrays are logically ORed in "row descending" order by column (1, 2, 3 … … n) and the result is assigned to the non-zero array [0,0, … … a (i) with the smallest row number in column imin,imin),……,a(imin,n-1),a(imin,n)]Performing the following steps; the non-zero term or algorithm in the column is as follows:
a(imin,jn)=a(imin,jn)∪...∪a(n,jn)
a(imin,jn-1)=a(imin,jn-1)∪...∪a(n,jn-1)
…………………………………………
a(imin,imin)=a(imin,jmin)∪...∪a(n,imin)
and (4) assignment operation:
a(i,n~n-i)=0,
the operation is finished;
the fourth step:
traversing each row of the triangular matrix once according to the above algorithm to obtain the following similar matrix:
all non-zero row number groups in the matrix are the groups of the cluster tiles.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911061622.4A CN112784859A (en) | 2019-11-01 | 2019-11-01 | Image clustering method based on matrix |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911061622.4A CN112784859A (en) | 2019-11-01 | 2019-11-01 | Image clustering method based on matrix |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112784859A true CN112784859A (en) | 2021-05-11 |
Family
ID=75748742
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911061622.4A Pending CN112784859A (en) | 2019-11-01 | 2019-11-01 | Image clustering method based on matrix |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112784859A (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20130085698A (en) * | 2012-01-20 | 2013-07-30 | 한국과학기술원 | Image partitioning method using correlation clustering, system processing the method and recording medium |
CN104077603A (en) * | 2014-07-14 | 2014-10-01 | 金陵科技学院 | Outdoor scene monocular vision space recognition method in terrestrial gravity field environment |
WO2015049129A1 (en) * | 2013-10-02 | 2015-04-09 | Thomson Licensing | Method and apparatus for generating superpixel clusters |
CN105118049A (en) * | 2015-07-22 | 2015-12-02 | 东南大学 | Image segmentation method based on super pixel clustering |
EP3067859A1 (en) * | 2015-03-11 | 2016-09-14 | Thomson Licensing | Method and apparatus for generating a superpixel cluster |
KR101694697B1 (en) * | 2015-08-03 | 2017-01-10 | 안동대학교 산학협력단 | IMAGE PARTITIONING METHOD USING SLIC(Simple Linear Iterative Clustering) INCLUDING TEXTURE INFORMATION AND RECORDING MEDIUM |
WO2018119807A1 (en) * | 2016-12-29 | 2018-07-05 | 浙江工商大学 | Depth image sequence generation method based on convolutional neural network and spatiotemporal coherence |
CN109522908A (en) * | 2018-11-16 | 2019-03-26 | 董静 | Image significance detection method based on area label fusion |
-
2019
- 2019-11-01 CN CN201911061622.4A patent/CN112784859A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20130085698A (en) * | 2012-01-20 | 2013-07-30 | 한국과학기술원 | Image partitioning method using correlation clustering, system processing the method and recording medium |
WO2015049129A1 (en) * | 2013-10-02 | 2015-04-09 | Thomson Licensing | Method and apparatus for generating superpixel clusters |
CN104077603A (en) * | 2014-07-14 | 2014-10-01 | 金陵科技学院 | Outdoor scene monocular vision space recognition method in terrestrial gravity field environment |
EP3067859A1 (en) * | 2015-03-11 | 2016-09-14 | Thomson Licensing | Method and apparatus for generating a superpixel cluster |
CN105118049A (en) * | 2015-07-22 | 2015-12-02 | 东南大学 | Image segmentation method based on super pixel clustering |
KR101694697B1 (en) * | 2015-08-03 | 2017-01-10 | 안동대학교 산학협력단 | IMAGE PARTITIONING METHOD USING SLIC(Simple Linear Iterative Clustering) INCLUDING TEXTURE INFORMATION AND RECORDING MEDIUM |
WO2018119807A1 (en) * | 2016-12-29 | 2018-07-05 | 浙江工商大学 | Depth image sequence generation method based on convolutional neural network and spatiotemporal coherence |
CN109522908A (en) * | 2018-11-16 | 2019-03-26 | 董静 | Image significance detection method based on area label fusion |
Non-Patent Citations (2)
Title |
---|
刘汉强;赵静;: "基于半监督的超像素谱聚类彩色图像分割算法", 计算机工程与应用, no. 14 * |
汪昊;刘向阳;: "基于区域中心的交互式图像前景提取方法", 计算机技术与发展, no. 02 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112766291B (en) | Matching method for specific target object in scene image | |
Adarsh et al. | YOLO v3-Tiny: Object Detection and Recognition using one stage improved model | |
CN107316031B (en) | Image feature extraction method for pedestrian re-identification | |
CN109325484B (en) | Flower image classification method based on background prior significance | |
CN108629783B (en) | Image segmentation method, system and medium based on image feature density peak search | |
CN109101981B (en) | Loop detection method based on global image stripe code in streetscape scene | |
CN106780639B (en) | Hash coding method based on significance characteristic sparse embedding and extreme learning machine | |
CN104715251A (en) | Salient object detection method based on histogram linear fitting | |
Zohourian et al. | Superpixel-based Road Segmentation for Real-time Systems using CNN. | |
CN111709317B (en) | Pedestrian re-identification method based on multi-scale features under saliency model | |
CN110310263B (en) | SAR image residential area detection method based on significance analysis and background prior | |
Liao et al. | Deep-learning-based object-level contour detection with CCG and CRF optimization | |
Lu et al. | Spectral segmentation via midlevel cues integrating geodesic and intensity | |
CN113011444A (en) | Image identification method based on neural network frequency domain attention mechanism | |
CN110532867B (en) | Facial image clustering method based on golden section method | |
Ksibi et al. | Deep salient-Gaussian Fisher vector encoding of the spatio-temporal trajectory structures for person re-identification | |
Dornaika et al. | A comparative study of image segmentation algorithms and descriptors for building detection | |
Elashry et al. | Feature matching enhancement using the graph neural network (gnn-ransac) | |
Kara et al. | Image segmentation-based unsupervised multiple objects discovery | |
Divecha et al. | Large-scale geolocalization of overhead imagery | |
CN112784859A (en) | Image clustering method based on matrix | |
Jin et al. | A method for traffic signs detection, tracking and recognition | |
Gao et al. | Airborne lidar point cloud classification based on multilevel point cluster features | |
CN108596034B (en) | Pedestrian re-identification method based on target center coding appearance model | |
Wang et al. | Road detection via superpixels and interactive image segmentation |
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 |