-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSvd.java
More file actions
60 lines (49 loc) · 1.53 KB
/
Copy pathSvd.java
File metadata and controls
60 lines (49 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package cn.edu.ustc.aaron.common;
import Jama.*;
public class Svd {
SingularValueDecomposition[] svdResult;
Matrix[] matU;
Matrix[] matV;
Matrix[] matS;
public Svd (Matrix[] toBeSvdMat, boolean codeCbCr) {
svdResult = new SingularValueDecomposition[3];
matU = new Matrix[3];
matV = new Matrix[3];
matS = new Matrix[3];
svdResult[0] = new SingularValueDecomposition(toBeSvdMat[0]);
matU[0] = svdResult[0].getU();
matV[0] = svdResult[0].getV();
matS[0] = svdResult[0].getS();
if (codeCbCr) {
svdResult[1] = new SingularValueDecomposition(toBeSvdMat[1]);
matU[1] = svdResult[1].getU();
matV[1] = svdResult[1].getV();
matS[1] = svdResult[1].getS();
svdResult[2] = new SingularValueDecomposition(toBeSvdMat[2]);
matU[2] = svdResult[2].getU();
matV[2] = svdResult[2].getV();
matS[2] = svdResult[2].getS();
}
}
public SingularValueDecomposition[] getSvdResult () {
return svdResult;
}
public Matrix[] getMatU () {
return matU;
}
public Matrix getMatU (int color) {
return matU[color];
}
public Matrix[] getMatV () {
return matV;
}
public Matrix getMatV (int color) {
return matV[color];
}
public Matrix[] getMatS () {
return matS;
}
public Matrix getMatS (int color) {
return matS[color];
}
}