parent
12d2c40764
commit
0b8e030809
@ -0,0 +1,93 @@
|
|||||||
|
package org.wlld.imageRecognition.border;
|
||||||
|
|
||||||
|
import org.wlld.MatrixTools.Matrix;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lidapeng
|
||||||
|
* @description
|
||||||
|
*
|
||||||
|
* @date 8:49 上午 2020/1/24
|
||||||
|
*/
|
||||||
|
public class BorderBody {
|
||||||
|
private Matrix xW;//平移X权重
|
||||||
|
private Matrix yW;//平移Y权重
|
||||||
|
private Matrix wW;//缩放宽度权重
|
||||||
|
private Matrix hW;//缩放高度权重
|
||||||
|
private Matrix x;//参数矩阵
|
||||||
|
private Matrix tx;//X轴偏移量
|
||||||
|
private Matrix ty;//Y轴偏移量
|
||||||
|
private Matrix tw;//W缩放量
|
||||||
|
private Matrix th;//H缩放量
|
||||||
|
|
||||||
|
public Matrix getxW() {
|
||||||
|
return xW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setxW(Matrix xW) {
|
||||||
|
this.xW = xW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Matrix getyW() {
|
||||||
|
return yW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setyW(Matrix yW) {
|
||||||
|
this.yW = yW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Matrix getwW() {
|
||||||
|
return wW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setwW(Matrix wW) {
|
||||||
|
this.wW = wW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Matrix gethW() {
|
||||||
|
return hW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sethW(Matrix hW) {
|
||||||
|
this.hW = hW;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Matrix getX() {
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setX(Matrix x) {
|
||||||
|
this.x = x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Matrix getTx() {
|
||||||
|
return tx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTx(Matrix tx) {
|
||||||
|
this.tx = tx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Matrix getTy() {
|
||||||
|
return ty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTy(Matrix ty) {
|
||||||
|
this.ty = ty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Matrix getTw() {
|
||||||
|
return tw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTw(Matrix tw) {
|
||||||
|
this.tw = tw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Matrix getTh() {
|
||||||
|
return th;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTh(Matrix th) {
|
||||||
|
this.th = th;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package org.wlld;
|
||||||
|
|
||||||
|
import org.wlld.MatrixTools.Matrix;
|
||||||
|
import org.wlld.MatrixTools.MatrixOperation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lidapeng
|
||||||
|
* @description
|
||||||
|
* @date 3:35 下午 2020/1/23
|
||||||
|
*/
|
||||||
|
public class MatrixTest {
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
test2();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void test1() throws Exception {
|
||||||
|
Matrix matrix = new Matrix(2, 2);
|
||||||
|
Matrix matrix2 = new Matrix(1, 5);
|
||||||
|
String b = "[6,7,8,9,10]#";
|
||||||
|
String a = "[1,2]#" +
|
||||||
|
"[3,4]#";
|
||||||
|
matrix.setAll(a);
|
||||||
|
matrix2.setAll(b);
|
||||||
|
Matrix matrix1 = MatrixOperation.matrixToVector(matrix, true);
|
||||||
|
matrix1 = MatrixOperation.push(matrix1, 5);
|
||||||
|
matrix1 = MatrixOperation.pushVector(matrix1, matrix2, true);
|
||||||
|
System.out.println(matrix1.getString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void test2() throws Exception {
|
||||||
|
Matrix matrix = new Matrix(2, 2);
|
||||||
|
Matrix matrix1 = new Matrix(1, 5);
|
||||||
|
String a = "[1,2]#" +
|
||||||
|
"[3,4]#";
|
||||||
|
String b = "[6,7,8,9,10]#";
|
||||||
|
matrix.setAll(a);
|
||||||
|
matrix1.setAll(b);
|
||||||
|
matrix1 = MatrixOperation.matrixToVector(matrix1, false);
|
||||||
|
matrix = MatrixOperation.matrixToVector(matrix, false);
|
||||||
|
matrix = MatrixOperation.push(matrix, 5);
|
||||||
|
matrix = MatrixOperation.pushVector(matrix, matrix1, false);
|
||||||
|
System.out.println(matrix.getString());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue