Commit ce8e3796 authored by hvernier's avatar hvernier

maj 2020 sans otb

parent ad105391
......@@ -9,6 +9,8 @@ import javax.swing.JOptionPane;
import jsl.io.ImageData;
import jsl.segmentation.Segmenteur;
import multiCube.tools.image.reader.GDALImageReaderWrapper;
import multiCube.tools.image.reader.ReaderWrapper;
/**
*
......@@ -85,7 +87,19 @@ public class SegmenteurMeanShift extends Segmenteur {
try {
// ExecCommand.SegmentationMeanShift(this.path, name + "_seg.tif", (int)this.spatialRadius, this.rangeRadius, (int)this.minRegionSize);
double data[][][] = null;
ReaderWrapper reader;
reader = new GDALImageReaderWrapper(this.path);
double data[][][] = new double[reader.getChannelCount()]
[reader.getImageWidth()][reader.getImageHeight()];
for (int x = 0 ; x < reader.getImageWidth() ; x++) {
for (int y = 0 ; y < reader.getImageHeight() ; y++) {
double[] pixel = reader.getPixel(x, y);
for(int c = 0 ; c < reader.getChannelCount() ; c++) {
data[c][x][y] = pixel[c];
}
}
}
// data = new OtbImage().loadImage("./" + name + "_seg.tif",
// image.getXDim(), image.getYDim(), 1);
......
......@@ -907,6 +907,7 @@ public class SegmenteurRegionMerging extends Segmenteur {
for (int y = 0; y < img.getYDim(); y++) {
for (int b = 0; b < img.getBDim(); b++) {
imgRes.setPixelXYBInt(x, y, b, (img.getPixelXYBInt(x, y, b) / indiceSousQuantification));
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment