CN108492337B - PCA-based gray scale image simplification method, device, apparatus and storage medium - Google Patents

PCA-based gray scale image simplification method, device, apparatus and storage medium Download PDF

Info

Publication number
CN108492337B
CN108492337B CN201810123063.4A CN201810123063A CN108492337B CN 108492337 B CN108492337 B CN 108492337B CN 201810123063 A CN201810123063 A CN 201810123063A CN 108492337 B CN108492337 B CN 108492337B
Authority
CN
China
Prior art keywords
matrix
gray level
level image
transposed
image matrix
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.)
Expired - Fee Related
Application number
CN201810123063.4A
Other languages
Chinese (zh)
Other versions
CN108492337A (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.)
China Agricultural University
Original Assignee
China Agricultural University
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 China Agricultural University filed Critical China Agricultural University
Priority to CN201810123063.4A priority Critical patent/CN108492337B/en
Publication of CN108492337A publication Critical patent/CN108492337A/en
Application granted granted Critical
Publication of CN108492337B publication Critical patent/CN108492337B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T9/00Image coding

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Multimedia (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Image Processing (AREA)

Abstract

The invention provides a PCA-based gray scale image simplification method, which comprises the following steps: extracting a gray level image matrix of the gray level image; compressing the gray level image matrix to obtain a primary compressed gray level image matrix; compressing the primary compressed gray level image matrix to obtain a secondary compressed gray level image matrix; and restoring the secondary compression gray level image matrix to obtain a simplified gray level image. The invention also provides the active interaction equipment, the non-transitory readable storage medium and a device, which are used for realizing the method. The invention can reduce the redundant information of the gray level image and reduce the space occupied by the gray level image in the electronic equipment.

Description

PCA-based gray scale image simplification method, device, apparatus and storage medium
Technical Field
The present invention relates to the field of image processing, and more particularly, to a method, an apparatus, a device, and a storage medium for simplifying a grayscale image based on PCA.
Background
In many fields of research and application, a large number of observations of a plurality of variables reflecting things are often required, and a large amount of data is collected to analyze for rules. Multivariate large samples undoubtedly provide abundant information for research and application, but also increase the workload of data acquisition to some extent. If each index is analyzed separately, the analysis is often isolated rather than integrated. Blindly reducing the index will lose much information and easily produce erroneous conclusions. Therefore, a reasonable method is needed to be found, so that the loss of information contained in the original index is reduced as much as possible while the index required to be analyzed is reduced, and the purpose of comprehensively analyzing the collected data is achieved. Therefore, finding a method that can reduce redundant information of an image, realize compression of the image, and simultaneously realize a very small error of the image through a reduction algorithm is a problem of concern in the industry.
Disclosure of Invention
To overcome the above problems or to at least partially solve the above problems, the present invention provides a PCA-based grayscale image reduction method, apparatus, device, and storage medium.
In one aspect, the invention provides a PCA-based grayscale image simplification method, which comprises the following specific steps: extracting a gray level image matrix of the gray level image; compressing the gray level image matrix to obtain a primary compressed gray level image matrix; compressing the primary compressed gray level image matrix to obtain a secondary compressed gray level image matrix; and restoring the secondary compression gray level image matrix to obtain a simplified gray level image.
In another aspect, the invention provides an active interaction device and a non-transitory readable storage medium. The active interaction device comprises: at least one processor; and at least one memory communicatively coupled to the processor, wherein: the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the PCA-based grayscale image reduction method. The one non-transitory readable storage medium stores program instructions for performing the one PCA-based grayscale image reduction method. The invention also provides a device for realizing the method.
The invention provides a method, equipment, a device and a storage medium for simplifying a gray image based on PCA (principal component analysis), which can reduce redundant information of the gray image and reduce the space occupied by the gray image in electronic equipment by compressing the gray image by adopting the PCA method.
Drawings
FIG. 1 is a general flow chart of a PCA-based grayscale image reduction method according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating specific steps of compressing a grayscale image matrix to obtain a once-compressed grayscale image matrix according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating specific steps of compressing a primary compressed grayscale image matrix to obtain a secondary compressed grayscale image matrix according to an embodiment of the present invention;
FIG. 4 is a simplified schematic diagram of the effect of gray scale images according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a grayscale image matrix and an original image matrix according to an embodiment of the invention;
FIG. 6 is a hardware device operational diagram of an embodiment of the present invention;
FIG. 7 is a schematic diagram of a PCA-based grayscale image reduction apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the following description of the embodiments of the present invention will be further described with reference to the accompanying drawings, and specific technical details are set forth below only for better understanding of the technical solutions of the readers, and do not represent that the present invention is limited only to the following technical details.
The embodiment of the invention provides a PCA-based gray scale image simplification method, equipment, a device and a storage medium. Referring to fig. 1, fig. 1 is an overall flowchart of a PCA-based grayscale image simplification method in an embodiment of the present invention, where the method is implemented by hardware devices, and includes the specific steps of:
s101: extracting a grayscale image matrix of a grayscale image, the grayscale image including: any one or any combination of three primary color gray image, the element types of the gray image matrix include: a floating point double precision type.
S102: and compressing the gray level image matrix to obtain a primary compressed gray level image matrix.
S103: and compressing the primary compression gray level image matrix to obtain a secondary compression gray level image matrix.
S104: and restoring the secondary compression gray level image matrix to obtain a simplified gray level image.
Referring to fig. 2, fig. 2 is a flowchart of specific steps of compressing a grayscale image matrix to obtain a primary compressed grayscale image matrix in an embodiment of the present invention, where the flowchart includes:
s201: and calculating the average value of each column element of the gray-scale image matrix.
S202: and subtracting the element mean value of the column from each element of the gray level image matrix to obtain a mean value difference matrix.
S203: and performing principal component analysis on the mean difference matrix to obtain the eigenvalue and the eigenvector of the mean difference matrix.
S204: setting a contribution rate individual quantity threshold value of principal component analysis, and selecting the feature vector of the mean difference matrix to form a feature vector matrix according to the contribution rate individual quantity threshold value, wherein the method specifically comprises the following steps: the individual number threshold of the contribution rate is 100, the contribution rates are sorted from large to small, and 100 eigenvectors which are 100 th of the contribution rate in the mean difference matrix are selected to form the eigenvector matrix.
S205: and the average value difference matrix is right-multiplied by the characteristic vector matrix to obtain a primary compression gray level image matrix.
Referring to fig. 3, fig. 3 is a flowchart of specific steps of compressing a primary compressed grayscale image matrix to obtain a secondary compressed grayscale image matrix in the embodiment of the present invention, including:
s301: and transposing the primary compressed gray level image matrix to obtain a transposed matrix, and calculating the mean value of each row of elements of the transposed matrix.
S302: and subtracting the element mean value of the column from each element of the transposed matrix to obtain a transposed mean value difference matrix.
S303: and performing principal component analysis on the transposed mean difference matrix to obtain the eigenvalue and the eigenvector of the transposed mean difference matrix.
S304: setting a critical value of the individual number of contribution rates of principal component analysis, selecting the feature vector of the transposed average value difference matrix to form a transposed feature vector matrix according to the critical value of the individual number of contribution rates, and specifically comprising the following steps: the critical value of the individual number of the contribution rates is 60, and 60 eigenvectors of the first 60 contribution rates in the transposed mean difference matrix are selected to form the transposed eigenvector matrix according to the descending order of the contribution rates.
S305: and the transposed average value difference matrix is multiplied by the transposed eigenvector matrix to obtain a secondary compression gray level image matrix.
The restoring the secondary compression gray level image matrix to obtain a simplified gray level image specifically includes: the secondary compression gray level image matrix is multiplied by the transposed matrix of the transposed eigenvector matrix to obtain an inverse matrix; and the inverted matrix is right-multiplied by the transposed matrix of the eigenvector matrix to obtain a simplified gray level image.
Referring to fig. 4, fig. 4 is a schematic diagram of a simplified gray scale image effect in an embodiment of the present invention, including: an original image 401, a red primary color grayscale image 402, a red primary color simplified grayscale image 403, a green primary color grayscale image 404, a green primary color simplified grayscale image 405, a blue primary color grayscale image 406, and a blue primary color simplified grayscale image 407. The original image 401 is decomposed into a red primary color grayscale image 402, a green primary color grayscale image 404, and a blue primary color grayscale image 406. The red-base gray image 402 is compressed and restored to obtain a red-base simplified gray image 403. The green-primary grayscale image 404 is compressed and restored to obtain a green-primary simplified grayscale image 405. The blue-primary grayscale image 406 is compressed and restored to obtain a blue-primary simplified grayscale image 407. As can be seen in the figure, the elements in the simplified image are significantly reduced, and the compression ratio reaches 829.47.
Referring to fig. 5, fig. 5 is a schematic diagram of a grayscale image matrix and an original image matrix in an embodiment of the invention, including: a red primary grayscale image matrix 501, an original image matrix 502, a minimum value of an element 503, and a maximum value of an element 504. Where 520x520 represents a total of 270400 elements, 520x520x3 represents 811200 elements, where 3 represents the three primary colors, uint8 represents the data type of the element, and the minimum value 503 of the element represents that of 270400 elements in the red-primary-color grayscale image matrix 501, the minimum element value is 3. The element maximum value 504 indicates that of 270400 elements in the red primary color grayscale image matrix 501, the maximum element value is 255.
Referring to fig. 6, fig. 6 is a schematic diagram of a hardware device according to an embodiment of the present invention, where the hardware device specifically includes: a PCA-based grayscale image reduction device 601, a processor 602, and a storage medium 603.
The PCA-based grayscale image reduction device 601: the one PCA-based grayscale image reduction apparatus 601 implements the one PCA-based grayscale image reduction method.
The processor 602: the processor 602 loads and executes the instructions and data in the storage medium 603 for implementing a PCA-based grayscale image reduction method.
Storage medium 603: the storage medium 603 stores instructions and data; the storage medium 603 is used to implement a PCA-based grayscale image reduction method.
Referring to fig. 7, fig. 7 is a schematic diagram of a PCA-based grayscale image simplifying apparatus according to an embodiment of the present invention, including: a grayscale image matrix extraction module 701, a primary compression module 702, a secondary compression module 703 and a compression reduction module 704; the grayscale image matrix extraction module 701 extracts a grayscale image matrix of a grayscale image and transmits the grayscale image matrix to the primary compression module 702; the primary compression module 702 compresses the grayscale image matrix to obtain a primary compressed grayscale image matrix, and transmits the primary compressed grayscale image matrix to the secondary compression module 703; the secondary compression module 703 compresses the primary compressed grayscale image matrix to obtain a secondary compressed grayscale image matrix, and transmits the secondary compressed grayscale image matrix to the compression and restoration module 704, and the compression and restoration module 704 restores the secondary compressed grayscale image matrix to obtain a simplified grayscale image
All the technical features of the claims of the present invention are elaborated upon by implementing the embodiments of the present invention.
Different from the prior art, embodiments of the present invention provide a method, an apparatus, a device, and a storage medium for simplifying a grayscale image based on PCA, and the method, the apparatus, the device, and the storage medium are used for compressing the grayscale image by using the PCA method, so that redundant information of the grayscale image can be reduced, and a space occupied by the grayscale image in an electronic device can be reduced.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (8)

1. A PCA-based grayscale image simplification method is characterized by comprising the following steps:
step 1: extracting a gray level image matrix of the gray level image;
step 2: compressing the gray level image matrix to obtain a primary compressed gray level image matrix;
and step 3: compressing the primary compressed gray level image matrix to obtain a secondary compressed gray level image matrix;
and 4, step 4: restoring the secondary compression gray level image matrix to obtain a simplified gray level image;
the compressing the gray level image matrix to obtain a primary compressed gray level image matrix specifically comprises the following steps:
step 21: calculating the mean value of each row of elements of the gray level image matrix;
step 22: subtracting the element mean value of the column from each element of the gray level image matrix to obtain a mean value difference matrix;
step 23: performing principal component analysis on the mean difference matrix to obtain a characteristic value and a characteristic vector of the mean difference matrix;
step 24: selecting the characteristic vectors of the mean difference matrix to form a characteristic vector matrix according to the individual number threshold of the contribution rate;
step 25: right multiplying the mean difference matrix by the eigenvector matrix to obtain a primary compression gray level image matrix;
the compressing the primary compression gray level image matrix to obtain a secondary compression gray level image matrix specifically comprises the following steps:
step 31: transposing the primary compressed gray level image matrix to obtain a transposed matrix, and calculating the mean value of each row of elements of the transposed matrix;
step 32: subtracting the element mean value of the column from each element of the transposed matrix to obtain a transposed mean value difference matrix;
step 33: performing principal component analysis on the transposed mean difference matrix to obtain a characteristic value and a characteristic vector of the transposed mean difference matrix;
step 34: selecting the eigenvectors of the transposed average value difference matrix to form a transposed eigenvector matrix according to the critical value of the number of the contribution rates;
step 35: and right-multiplying the transposed average value difference matrix by the transposed eigenvector matrix to obtain a secondary compression gray level image matrix.
2. The method of claim 1, wherein the grayscale image includes: any one or any combination of three primary color gray scale images.
3. The method of claim 1, wherein the rate of contribution individual quantity threshold is 100; selecting the feature vector of the mean difference matrix to form a feature vector matrix according to the individual number threshold of the contribution rate, which specifically comprises the following steps: and sorting the contribution rates from large to small, and selecting the first 100 eigenvectors of the contribution rate in the mean difference matrix to form an eigenvector matrix.
4. The method of claim 1, wherein the contribution rate individual quantity threshold is 60; selecting the eigenvector of the transposed average value difference matrix to form a transposed eigenvector matrix according to the critical value of the number of the individual contributions, specifically comprising: and sorting according to the contribution rate from large to small, and selecting the first 60 eigenvectors of the contribution rate in the transposed mean difference matrix to form a transposed eigenvector matrix.
5. The method according to claim 1, wherein the restoring the matrix of the twice-compressed grayscale image to obtain a simplified grayscale image comprises: the secondary compression gray level image matrix is multiplied by the transposed matrix of the transposed eigenvector matrix to obtain an inverse matrix; and the inverted matrix is right-multiplied by the transposed matrix of the eigenvector matrix to obtain a simplified gray level image.
6. An active interaction device, comprising:
at least one processor; and
at least one memory communicatively coupled to the processor, wherein:
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the method of any of claims 1 to 5.
7. A non-transitory readable storage medium storing program instructions for executing the method according to any one of claims 1 to 5.
8. An apparatus for implementing the method of any one of claims 1 to 5, comprising: the device comprises a gray level image matrix extraction module, a primary compression module, a secondary compression module and a compression reduction module; the gray image matrix extraction module extracts a gray image matrix of a gray image and transmits the gray image matrix to the primary compression module; the primary compression module compresses the gray level image matrix to obtain a primary compressed gray level image matrix, and transmits the primary compressed gray level image matrix to the secondary compression module; the secondary compression module compresses the primary compression gray level image matrix to obtain a secondary compression gray level image matrix, transmits the secondary compression gray level image matrix to the compression and restoration module, and the compression and restoration module restores the secondary compression gray level image matrix to obtain a simplified gray level image.
CN201810123063.4A 2018-02-07 2018-02-07 PCA-based gray scale image simplification method, device, apparatus and storage medium Expired - Fee Related CN108492337B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810123063.4A CN108492337B (en) 2018-02-07 2018-02-07 PCA-based gray scale image simplification method, device, apparatus and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810123063.4A CN108492337B (en) 2018-02-07 2018-02-07 PCA-based gray scale image simplification method, device, apparatus and storage medium

Publications (2)

Publication Number Publication Date
CN108492337A CN108492337A (en) 2018-09-04
CN108492337B true CN108492337B (en) 2020-07-03

Family

ID=63344693

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810123063.4A Expired - Fee Related CN108492337B (en) 2018-02-07 2018-02-07 PCA-based gray scale image simplification method, device, apparatus and storage medium

Country Status (1)

Country Link
CN (1) CN108492337B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103955676A (en) * 2014-05-12 2014-07-30 苏州大学 Human face identification method and system
CN104616000A (en) * 2015-02-27 2015-05-13 苏州大学 Human face recognition method and apparatus
CN104820696A (en) * 2015-04-29 2015-08-05 山东大学 Large-scale image retrieval method based on multi-label least square Hash algorithm

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103955676A (en) * 2014-05-12 2014-07-30 苏州大学 Human face identification method and system
CN104616000A (en) * 2015-02-27 2015-05-13 苏州大学 Human face recognition method and apparatus
CN104820696A (en) * 2015-04-29 2015-08-05 山东大学 Large-scale image retrieval method based on multi-label least square Hash algorithm

Also Published As

Publication number Publication date
CN108492337A (en) 2018-09-04

Similar Documents

Publication Publication Date Title
CN108154222B (en) Deep neural network training method and system and electronic equipment
US20190244358A1 (en) Method and system for scene parsing and storage medium
US10034005B2 (en) Banding prediction for video encoding
US20190394477A1 (en) Devices for compression/decompression, system, chip, and electronic device
US11328184B2 (en) Image classification and conversion method and device, image processor and training method therefor, and medium
US11216913B2 (en) Convolutional neural network processor, image processing method and electronic device
CN106407363A (en) Ultra-high-dimensional data dimension reduction algorithm based on information entropy
El-Said Image quantization using improved artificial fish swarm algorithm
Phien et al. Efficient tensor completion: Low-rank tensor train
CN113808044B (en) Encryption mask determining method, device, equipment and storage medium
CN111696038A (en) Image super-resolution method, device, equipment and computer-readable storage medium
CN107239532B (en) Data mining method and device
CN111881920A (en) Network adaptation method of large-resolution image and neural network training device
CN111696026A (en) Reversible gray scale map algorithm and computing device based on L0 regular term
CN114529750A (en) Image classification method, device, equipment and storage medium
CN114048322A (en) Noise identification method and device of knowledge graph and computer readable storage medium
CN108492337B (en) PCA-based gray scale image simplification method, device, apparatus and storage medium
CN113888560A (en) Method, apparatus, device and storage medium for processing image
CN111860557B (en) Image processing method and device, electronic equipment and computer storage medium
CN116704281A (en) Model training method, device, image recognition method and computer equipment
CN115346080B (en) Quantum computation-based image processing method and related equipment
CN1996343A (en) Data processing method and apparatus, image processing method and apparatus, image sorting method and apparatus, and storage medium
CN116543257A (en) Training method and device for target detection model, computer equipment and storage medium
CN112785501B (en) Text image processing method, text image processing device, text image processing equipment and storage medium
CN113038134B (en) Picture processing method, intelligent terminal and storage medium

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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200703

Termination date: 20210207