Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
nfeybesse committed May 17, 2018
1 parent 37e966d commit 3dc9f64
Show file tree
Hide file tree
Showing 19 changed files with 579 additions and 1,793 deletions.
14 changes: 3 additions & 11 deletions gs-cv/src/main/java/org/genericsystem/cv/Img.java
Original file line number Diff line number Diff line change
Expand Up @@ -909,19 +909,11 @@ public void close() {
src.release();
}

// public Layout buildLayout() {
// return this.buildLayout(new Size(0.04, 0.008), 5);
// }

public Layout buildLayout(Size morph, int level) {
Layout root = new Layout(null, 0, 1, 0, 1);// .tighten(this);
return root.recursiveSplit(morph, level, this);
public Layout buildLayout(Size constantClose, Size linearClose, int level) {
Layout root = new Layout(null, 0, 1, 0, 1);
return root.recursiveSplit(constantClose, linearClose, level, this);
}

// public static void main(String[] args) {
// System.out.println(Arrays.toString(open(Arrays.asList(true, true, false, true, true, false, true, false, true), 2)));
// }

public static boolean[] close(List<Boolean> histo, int k) {
boolean[] closed = new boolean[histo.size()];
for (int i = 0; i < histo.size() - 1; i++)
Expand Down
320 changes: 0 additions & 320 deletions gs-cv/src/main/java/org/genericsystem/cv/LinesDetector5.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.opencv.core.Point;
import org.opencv.core.Rect;
import org.opencv.core.Scalar;
import org.opencv.core.Size;
import org.opencv.imgproc.Imgproc;

import javafx.application.Platform;
Expand Down Expand Up @@ -169,10 +168,10 @@ protected org.genericsystem.cv.Img buildDisplay() {
// Mat image = superReferenceTemplate5.getDisplay().getSrc();

SuperContourInterpolator interpolator = new SuperContourInterpolator(filteredSuperContour, 2);
MeshGrid meshGrid = new MeshGrid(new Size(16, 9), interpolator, 20, 20, superReferenceTemplate5.getFrame().getSrc());
meshGrid.build();
MeshGrid meshGrid = new MeshGrid(16, 9, interpolator, 20, 20, superReferenceTemplate5.getFrame().getSrc());
meshGrid.buildGrid();

Mat image = meshGrid.drawOnCopy(new Scalar(0, 255, 0));
Mat image = meshGrid.drawOnCopy(new Scalar(0, 255, 0), new Scalar(0, 0, 255));
Mat internal = new Mat(image, new Rect(new Point(20, 20), new Point(image.width() - 20, image.height() - 20)));
filteredSuperContour.stream().forEach(c -> Imgproc.line(internal, c.top, c.bottom, new Scalar(255, 255, 255), 1));
filteredSuperContour.stream().forEach(c -> Imgproc.line(internal, c.vBottom, c.vTop, new Scalar(0, 0, 255), 2));
Expand Down Expand Up @@ -217,8 +216,10 @@ protected org.genericsystem.cv.Img buildDisplay() {

SuperTemplate layoutTemplate = new SuperTemplate(referenceTemplate, CvType.CV_8UC3, SuperFrameImg::getDisplay);
Layout layout = layoutTemplate.layout();
layoutTemplate.drawLayout(layout);
images[9] = layoutTemplate.getDisplay().toJfxImage();
if (layout != null) {
layoutTemplate.drawLayout(layout);
images[9] = layoutTemplate.getDisplay().toJfxImage();
}

return images;
}
Expand Down
Loading

0 comments on commit 3dc9f64

Please sign in to comment.