覆盖模式增加可选择分类器

pull/29/head
thenk008 5 years ago
parent 12549458b0
commit ce889e439b

@ -71,7 +71,7 @@ public class Operation {//进行计算
int ySize = maxY - minY;
ThreeChannelMatrix threeChannelMatrix1 = convolution.getRegionMatrix(threeChannelMatrix, minX, minY, xSize, ySize);
List<Double> feature = convolution.getCenterColor(threeChannelMatrix1, templeConfig.getPoolSize(),
templeConfig.getSensoryNerves().size());
templeConfig.getFeatureNub());
if (templeConfig.isShowLog()) {
System.out.println(feature);
}
@ -80,7 +80,11 @@ public class Operation {//进行计算
case Classifier.DNN:
Map<Integer, Double> map = new HashMap<>();
map.put(tag, 1.0);
if (templeConfig.getSensoryNerves().size() == templeConfig.getFeatureNub()) {
intoDnnNetwork(1, feature, templeConfig.getSensoryNerves(), true, map, null);
} else {
throw new Exception("nerves number is not equal featureNub");
}
break;
case Classifier.LVQ:
Matrix vector = MatrixOperation.listToRowVector(feature);
@ -119,7 +123,7 @@ public class Operation {//进行计算
int ySize = maxY - minY;
ThreeChannelMatrix threeChannelMatrix1 = convolution.getRegionMatrix(threeChannelMatrix, minX, minY, xSize, ySize);
List<Double> feature = convolution.getCenterColor(threeChannelMatrix1, templeConfig.getPoolSize(),
templeConfig.getSensoryNerves().size());
templeConfig.getFeatureNub());
if (templeConfig.isShowLog()) {
System.out.println(feature);
}
@ -131,8 +135,12 @@ public class Operation {//进行计算
id = getIdByLVQ(myMatrix);
break;
case Classifier.DNN:
if (templeConfig.getSensoryNerves().size() == templeConfig.getFeatureNub()) {
intoDnnNetwork(IdCreator.get().nextId(), feature, templeConfig.getSensoryNerves(), false, null, maxPoint);
id = maxPoint.getId();
} else {
throw new Exception("nerves number is not equal featureNub");
}
break;
case Classifier.VAvg:
Matrix myMatrix1 = MatrixOperation.listToRowVector(feature);

@ -63,6 +63,15 @@ public class TempleConfig {
private int regionNub = 100;//一张图行或列分多少个区块
private double hTh = 0.88;//灰度阈值
private double maxRain = 340;//不降雨RGB阈值
private int featureNub = 4;//聚类特征数量
public int getFeatureNub() {
return featureNub;
}
public void setFeatureNub(int featureNub) {
this.featureNub = featureNub;
}
public double getMaxRain() {
return maxRain;

@ -32,7 +32,7 @@ public class FoodTest {
templeConfig.setStudyPoint(0.01);
templeConfig.sethTh(0.86);
templeConfig.setRegionNub(200);
templeConfig.setMaxRain(340);
templeConfig.setMaxRain(360);
templeConfig.setSoftMax(true);
List<Specifications> specificationsList = new ArrayList<>();
Specifications specifications = new Specifications();

Loading…
Cancel
Save