All Projects → NourozR → Reconstruction-and-Compression-of-Color-Images

NourozR / Reconstruction-and-Compression-of-Color-Images

Licence: other
Reconstruction and Compression of Color Images Using Principal Component Analysis (PCA) Algorithm

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Reconstruction-and-Compression-of-Color-Images

ReductionWrappers
R wrappers to connect Python dimensional reduction tools and single cell data objects (Seurat, SingleCellExperiment, etc...)
Stars: ✭ 31 (+3.33%)
Mutual labels:  dimension-reduction
random-fourier-features
Implementation of random Fourier features for kernel method, like support vector machine and Gaussian process model
Stars: ✭ 50 (+66.67%)
Mutual labels:  principal-component-analysis
topometry
A comprehensive dimensional reduction framework to recover the latent topology from high-dimensional data.
Stars: ✭ 64 (+113.33%)
Mutual labels:  dimension-reduction
info-retrieval
Information Retrieval in High Dimensional Data (class deliverables)
Stars: ✭ 33 (+10%)
Mutual labels:  principal-component-analysis
scarf
Toolkit for highly memory efficient analysis of single-cell RNA-Seq, scATAC-Seq and CITE-Seq data. Analyze atlas scale datasets with millions of cells on laptop.
Stars: ✭ 54 (+80%)
Mutual labels:  dimension-reduction
ClassifierToolbox
A MATLAB toolbox for classifier: Version 1.0.7
Stars: ✭ 72 (+140%)
Mutual labels:  principal-component-analysis
R-stats-machine-learning
Misc Statistics and Machine Learning codes in R
Stars: ✭ 33 (+10%)
Mutual labels:  principal-component-analysis
Reinforcement-Learning-Feature-Selection
Feature selection for maximizing expected cumulative reward
Stars: ✭ 27 (-10%)
Mutual labels:  principal-component-analysis
Handwritten-Names-Recognition
The goal of this project is to solve the task of name transcription from handwriting images implementing a NN approach.
Stars: ✭ 54 (+80%)
Mutual labels:  principal-component-analysis
xmca
Maximum Covariance Analysis in Python
Stars: ✭ 41 (+36.67%)
Mutual labels:  principal-component-analysis
NMFADMM
A sparsity aware implementation of "Alternating Direction Method of Multipliers for Non-Negative Matrix Factorization with the Beta-Divergence" (ICASSP 2014).
Stars: ✭ 39 (+30%)
Mutual labels:  principal-component-analysis
Machine-Learning-and-Pattern-Recognition
Implementation of Machine Learning Algorithms
Stars: ✭ 43 (+43.33%)
Mutual labels:  principal-component-analysis
mathematics-for-machine-learning-coursera
quizzes/assignments for mathematics for machine learning specialization on coursera
Stars: ✭ 264 (+780%)
Mutual labels:  principal-component-analysis
pca
Principal component analysis (PCA) in Ruby
Stars: ✭ 25 (-16.67%)
Mutual labels:  principal-component-analysis
abess
Fast Best-Subset Selection Library
Stars: ✭ 266 (+786.67%)
Mutual labels:  principal-component-analysis
Fred
A fast, scalable and light-weight C++ Fréchet distance library, exposed to python and focused on (k,l)-clustering of polygonal curves.
Stars: ✭ 13 (-56.67%)
Mutual labels:  dimension-reduction
fastknn
Fast k-Nearest Neighbors Classifier for Large Datasets
Stars: ✭ 64 (+113.33%)
Mutual labels:  dimension-reduction

Reconstruction and Compression of Color Image Using Principal Component Analysis PCA

While reviewing linear algebra, I decided to work on some funny projects that will help me to understand the concepts more deeply. In this repo, I have reconstructed a [600,600,3] RGB image using PCA. To undestand this project, one may need to have solid knowledge of eigendecomposition and covariance matrix. I have another repository where i have included these concepts with python codes, basically using Numpy. Feel free to have a look there!

The input image:

dhoni

with 10 principal components:

screenshot from 2017-06-03 22-09-09

20 Principal Components:

screenshot from 2017-06-03 22-09-53

50 Principal Components:

screenshot from 2017-06-03 22-10-33

100 Principal Components:

screenshot from 2017-06-03 22-11-27

Conclusion:

Using first 100 PCs, a quite good image has been recontructed. Remember our input image had 600 columns, so we had 600 PCs in our eigendecomposition step. So, clearly a great dimension reduction is possible using PCA analysis on any image. Added, in the mean normalising step, you can tune. For example you can use: 0.5 * np.mean(2D_image, axis = 1). It will reduce noise to some extent. Chect it.

I have added two .py files here. One is main fuction to do it and another is my practice file which I did for myself from scratch - but that's too helpful if anyone wants to understand each steps more clearly.

To run the code on ubuntu, save input file "dhoni.jpg" and "image_reconstruction_using_PCA.py" in same directory and run the .py file. However, install all required packages before running the code. You can use this code on any image, with a bit of change, for similar purpose.

Update:

If you are working with rectangular image shapes, just change: axis = None from axis = 0/1. I could change the code and make more generalized but not doing that right now.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].