|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.brownsoft.codec.KLTHelper
Title: Proyecto Codificacion de Imagenes y Video
Description:
Esta clase es un helper que trabaja con matrices. Implemento aqui varias operaciones como ser aplicar la transformada de Karhunen-Loève, convertir imagenes de un espacio de color a otro, etcCopyright: Copyright (c) 2004
Company:
Field Summary | |
private int |
BLOCK_SIZE
|
private int |
BLOCK_WIDTH
|
Matrix |
eigenValues
|
Matrix |
eigenVectors
|
private int |
imageHeight
|
private double[][] |
imageMatrix
|
private int |
imageWidth
|
Matrix |
invEigenVectors
|
Matrix |
pcaMatrix
|
private static double[][] |
RGBToYCrCbMatrix
|
private static double[][] |
YCrCbToRGBMatrix
|
Constructor Summary | |
KLTHelper(int BLOCK_WIDTH,
int BLOCK_SIZE,
double[][] imageMatrix)
Crea una instancia de KLTHelper |
|
KLTHelper(int BLOCK_WIDTH,
int BLOCK_SIZE,
double[][] imageMatrix,
double[][] invBasis)
|
Method Summary | |
static double[][] |
apply(double[][] invBasis,
int imageWidth,
int imageHeight,
int BLOCK_WIDTH,
double[][] coeffs)
|
double[][] |
applyKLTByNumberOfCoefficients(int cantCoeffs)
Aplica la transformación de Karhunen-Loève utilizando cantCoeffs vectores de la base |
double[][] |
blockRearrange(double[][] imageMatrix)
Obtiene el array de vectores con la imagen, donde cada vector es un bloque de M*M |
private static double[][][] |
convertColorSpace(Matrix cvtMatrix,
double[][][] imageMatrix)
Convierte una imagen de un espacio de color a otro (RGB <--> YCrCb) |
static double[][][] |
convertToRGB(double[][][] imageMatrix)
Convierte una imagen del espacio YCrCb a RGB |
static double[][][] |
convertToYCrCb(double[][][] imageMatrix)
Convierte una imagen del espacio RGB a YCrCb |
Matrix |
cov(Matrix inputMatrix)
Obtiene la matrix de covarianza |
double[] |
getBlockAsVector(double[][] imageMatrix,
int x,
int y)
Obtiene un bloque de la matriz y lo retorna como un vector |
double[][] |
getInvBasis()
Obtiene la matriz inversa de base de la KLT |
void |
initialize()
|
void |
pruneCoeffs(double[][] matrix,
int cantToLeave)
Elimina los N vectores de menor peso |
Matrix |
pruneEigenVectors(Matrix vectors,
int cantToLeave)
Elimina los N vectores de menor peso |
static double[][] |
unblockRearrange(double[][] imageMatrix,
int pixelsWidth,
int pixelsHeight,
int BLOCK_WIDTH)
A partir de un array de vectores con la imagen, obtiene la matriz de la imagen |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private int BLOCK_SIZE
private int BLOCK_WIDTH
public Matrix eigenValues
public Matrix eigenVectors
private int imageHeight
private double[][] imageMatrix
private int imageWidth
public Matrix invEigenVectors
public Matrix pcaMatrix
private static final double[][] RGBToYCrCbMatrix
private static final double[][] YCrCbToRGBMatrix
Constructor Detail |
public KLTHelper(int BLOCK_WIDTH, int BLOCK_SIZE, double[][] imageMatrix)
public KLTHelper(int BLOCK_WIDTH, int BLOCK_SIZE, double[][] imageMatrix, double[][] invBasis)
Method Detail |
public static double[][] apply(double[][] invBasis, int imageWidth, int imageHeight, int BLOCK_WIDTH, double[][] coeffs)
public double[][] applyKLTByNumberOfCoefficients(int cantCoeffs)
cantCoeffs
- cantidad de coeficientes de la base a utilizarpublic double[][] blockRearrange(double[][] imageMatrix)
private static double[][][] convertColorSpace(Matrix cvtMatrix, double[][][] imageMatrix)
cvtMatrix
- matriz de conversiónimageMatrix
- double[][][] con la imagen a convertir
public static double[][][] convertToRGB(double[][][] imageMatrix)
imageMatrix
- matriz de la imagen a convertir (en YCrCb)
public static double[][][] convertToYCrCb(double[][][] imageMatrix)
imageMatrix
- matriz de la imagen a convertir (en RGB)
public Matrix cov(Matrix inputMatrix)
public double[] getBlockAsVector(double[][] imageMatrix, int x, int y)
public double[][] getInvBasis()
public void initialize()
public void pruneCoeffs(double[][] matrix, int cantToLeave)
public Matrix pruneEigenVectors(Matrix vectors, int cantToLeave)
public static double[][] unblockRearrange(double[][] imageMatrix, int pixelsWidth, int pixelsHeight, int BLOCK_WIDTH)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |