修改合并选区BUG

pull/27/head
thenk008 5 years ago
parent e23aab9cb7
commit f17477db71

@ -378,7 +378,7 @@ public class Matrix {
if (j == 0) {
builder.append(number);
} else {
builder.append(",(j:" + j + ",i:" + i + ")" + number);
builder.append("," + j + ":" + number);
}
}
builder.append("]\r\n");

@ -13,7 +13,7 @@ public class Kernel {
public static final double Region_Th = 0.05;//区域分割阈值
public static final double th = 0.88;//分水岭灰度阈值
public static final double rgbN = 441.6729559300637;//RGB范数归一化最大值
public static final double maxRain = 381.051177665153;//超过此阈值则不降水
public static final double maxRain = 340; //381.051177665153;//超过此阈值则不降水
public static Matrix Vertical;
public static Matrix Horizontal;
public static Matrix All;

@ -1,9 +0,0 @@
package org.wlld.imageRecognition.segmentation;
import org.wlld.MatrixTools.Matrix;
public class Color {
private Matrix matrix;
private Matrix regionMap;
}

@ -15,25 +15,17 @@ public class RegionBody {
private int maxX;
private int maxY;
private int type;
private int xSize;
private int ySize;
private List<Integer> pointList = new ArrayList<>();
private Matrix regionMap;//分区图
private boolean isDestroy = false;
public boolean isDestroy() {
return isDestroy;
}
public void setDestroy(boolean destroy, int id) {
if (type == 168) {
// System.out.println("id===" + id);
}
isDestroy = destroy;
}
RegionBody(Matrix regionMap, int type) {
RegionBody(Matrix regionMap, int type, int xSize, int ySize) {
//System.out.println("type===" + type);
this.regionMap = regionMap;
this.type = type;
this.xSize = xSize;
this.ySize = ySize;
}
public List<Integer> getPointList() {
@ -70,10 +62,10 @@ public class RegionBody {
if (y > maxY) {
maxY = y;
}
//int pixel = x << 12 | y;
//pointList.add(pixel);
int pixel = x << 12 | y;
pointList.add(pixel);
//System.out.println("type==" + type);
// regionMap.setNub(x, y, type);
regionMap.setNub(x, y, type);
}
public void setX(int x) {
@ -95,18 +87,18 @@ public class RegionBody {
}
public int getMinX() {
return minX;
return minX * xSize;
}
public int getMinY() {
return minY;
return minY * ySize;
}
public int getMaxX() {
return maxX;
return maxX * xSize;
}
public int getMaxY() {
return maxY;
return maxY * ySize;
}
}

@ -30,8 +30,8 @@ public class FoodTest {
Picture picture = new Picture();
templeConfig.setSensoryNerveNub(4);
templeConfig.setStudyPoint(0.01);
templeConfig.setRegionTh(0);
templeConfig.sethTh(0.7);
templeConfig.setRegionTh(0.02);
templeConfig.sethTh(0.86);
templeConfig.setRegionNub(200);
templeConfig.setSoftMax(true);
List<Specifications> specificationsList = new ArrayList<>();
@ -41,7 +41,7 @@ public class FoodTest {
specificationsList.add(specifications);
templeConfig.init(StudyPattern.Cover_Pattern, true, 400, 400, 3);
Operation operation = new Operation(templeConfig);
ThreeChannelMatrix threeChannelMatrix = picture.getThreeMatrix("D:\\cai\\e/e1.jpg");
ThreeChannelMatrix threeChannelMatrix = picture.getThreeMatrix("D:\\cai\\e/e3.jpg");
operation.colorLook(threeChannelMatrix, specificationsList);
}

Loading…
Cancel
Save