parent
4be832f0d5
commit
320c1dffc9
@ -0,0 +1,23 @@
|
||||
package org.wlld.imageRecognition;
|
||||
|
||||
import org.wlld.i.OutBack;
|
||||
import org.wlld.imageRecognition.border.FrameBody;
|
||||
|
||||
/**
|
||||
* @author lidapeng
|
||||
* @description
|
||||
* @date 3:44 下午 2020/1/26
|
||||
*/
|
||||
|
||||
public class ImageBack implements OutBack {
|
||||
private FrameBody frameBody;
|
||||
|
||||
public void setFrameBody(FrameBody frameBody) {
|
||||
this.frameBody = frameBody;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBack(double out, int id, long eventId) {
|
||||
frameBody.setPointAndId(out, id);
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package org.wlld.imageRecognition.border;
|
||||
|
||||
/**
|
||||
* @author lidapeng
|
||||
* @description 先验检测边框
|
||||
* @date 11:16 上午 2020/1/26
|
||||
*/
|
||||
public class Frame {
|
||||
private int width;//检测边框的宽
|
||||
private int height;//检测边框的高
|
||||
private int lengthWidth;//宽一次走多长
|
||||
private int lengthHeight;//高一次走多长
|
||||
|
||||
public boolean isReady() {
|
||||
if (width > 0 && height > 0 && lengthWidth > 0 && lengthHeight > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public int getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public void setWidth(int width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public int getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(int height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public int getLengthWidth() {
|
||||
return lengthWidth;
|
||||
}
|
||||
|
||||
public void setLengthWidth(int lengthWidth) {
|
||||
this.lengthWidth = lengthWidth;
|
||||
}
|
||||
|
||||
public int getLengthHeight() {
|
||||
return lengthHeight;
|
||||
}
|
||||
|
||||
public void setLengthHeight(int lengthHeight) {
|
||||
this.lengthHeight = lengthHeight;
|
||||
}
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package org.wlld.imageRecognition.border;
|
||||
|
||||
import org.wlld.MatrixTools.Matrix;
|
||||
|
||||
/**
|
||||
* @author lidapeng
|
||||
* @description 选区分类识别
|
||||
* @date 11:49 上午 2020/1/26
|
||||
*/
|
||||
public class FrameBody {
|
||||
private Matrix matrix;//图像区块矩阵
|
||||
private Matrix endMatrix;//卷积结束的矩阵
|
||||
private int id;//当前分类的ID
|
||||
private double point;//当前分类的概率
|
||||
private int x;//锚点X坐标
|
||||
private int y;//锚点Y坐标
|
||||
|
||||
public Matrix getEndMatrix() {
|
||||
return endMatrix;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public double getPoint() {
|
||||
return point;
|
||||
}
|
||||
|
||||
public void setPointAndId(double point, int id) {
|
||||
if (point > this.point) {
|
||||
this.point = point;
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
|
||||
public void setEndMatrix(Matrix endMatrix) {
|
||||
this.endMatrix = endMatrix;
|
||||
}
|
||||
|
||||
public Matrix getMatrix() {
|
||||
return matrix;
|
||||
}
|
||||
|
||||
public void setMatrix(Matrix matrix) {
|
||||
this.matrix = matrix;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(int x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public int getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(int y) {
|
||||
this.y = y;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue