fixed some typos

This commit is contained in:
2020-05-07 14:58:09 +02:00
parent 544f0f5dcc
commit d9947d100c
5 changed files with 30 additions and 22 deletions
@@ -5,12 +5,14 @@ import org.opencv.core.MatOfDMatch;
import org.opencv.core.MatOfKeyPoint;
import org.opencv.imgcodecs.Imgcodecs;
import de.unidue.nes.gpu.testframework.input.MatInput;
import de.unidue.nes.gpu.testframework.input.MatTuple;
import de.unidue.nes.gpu.testframework.input.MatTupleInput;
import de.unidue.nes.gpu.testframework.opencv.DescriptorMatcher;
import de.unidue.nes.gpu.testframework.opencv.Features2d;
import de.unidue.nes.gpu.testframework.opencv.Imgproc;
import de.unidue.nes.gpu.testframework.opencv.ORB;
import de.unidue.nes.gpu.testframework.tasks.CustomTask;
import de.unidue.nes.gpu.testframework.tasks.DebugTask;
import de.unidue.nes.gpu.testframework.tasks.DummyTask;
/**
* @author Roch P., Shahbaz Nejad B.
@@ -24,14 +26,15 @@ public class Main {
// main method only used to test
public static void main(String[] args) {
TestUtils<Mat> utils = new TestUtils<>();
utils.setCommandPipeline(input -> {
Mat mat = input.get();
Mat other = new Mat();
mat.copyTo(other);
TestUtils<MatTuple> utils = new TestUtils<>();
utils.setCommandPipeline(tuple -> {
Mat mat = tuple.get().left;
Mat other = tuple.get().right;
Imgproc.cvtColor(mat, mat, org.opencv.imgproc.Imgproc.COLOR_BGR2GRAY);
Imgproc.cvtColor(other, other, org.opencv.imgproc.Imgproc.COLOR_BGR2GRAY);
ORB orb = ORB.create();
ORB.create(500);
ORB.create(500, 0.5f);
MatOfKeyPoint keypoints = new MatOfKeyPoint();
Mat descriptors = new Mat();
orb.detectAndCompute(mat, new Mat(), keypoints, descriptors);
@@ -43,22 +46,23 @@ public class Main {
DescriptorMatcher matcher = DescriptorMatcher.create(org.opencv.features2d.DescriptorMatcher.BRUTEFORCE_HAMMING);
MatOfDMatch matches = new MatOfDMatch();
matcher.match(descriptors2, descriptors, matches);
Mat out = new Mat();
Mat otherOut = new Mat();
Features2d.drawMatches(mat, keypoints, other, keypoints2, matches, out);
Features2d.drawKeypoints(mat, keypoints, otherOut);
CustomTask.addTask(new DebugTask(mat, out, otherOut));
CustomTask.addTask(new DummyTask(mat, out, otherOut));
});
utils.setInput(new MatInput(Imgcodecs.imread("src/main/resources/left_small.png")));
utils.setInput(new MatTupleInput(Imgcodecs.imread("src/main/resources/left_large.png"), Imgcodecs.imread("src/main/resources/right_large.png")));
// utils.setInput(new MatInput(Imgcodecs.imread("src/main/resources/car.jpg")));
// utils.setInput(new MatInput(Imgcodecs.imread("src/main/resources/skyscraper_small.jpg")));
utils.initializeCommands();
utils.warmupCPUTests(1);
// utils.runCPUTests(10);
// utils.warmupGPUTests(5);
// utils.runGPUTests(10);
// utils.evaluate();
utils.warmupCPUTests(5);
utils.runCPUTests(10);
utils.warmupGPUTests(5);
utils.runGPUTests(10);
utils.evaluate();
}
}
@@ -65,7 +65,7 @@ public class DescriptorMatcher_create implements Task {
@Override
public String getDescription() {
return " DescriptorMatcher.create(" + this.matcherType + ")";
return "DescriptorMatcher.create(" + this.matcherType + ")";
}
@Override
@@ -36,7 +36,7 @@ public class DrawKeypoints implements Task {
@Override
public CpuTask toCpuTask() {
return () -> Features2d.drawKeypoints(this.image, this.keypoints, this.originalOutImage);
return () -> Features2d.drawKeypoints(this.image, this.keypoints, this.outImage);
}
@Override
@@ -46,7 +46,7 @@ public class DrawKeypoints implements Task {
@Override
public String getDescription() {
return "Features2d.drawKeypoints(" + this.image + ", " + this.keypoints + ", " + this.originalOutImage + ")";
return "Features2d.drawKeypoints(" + this.image + ", " + this.keypoints + ", " + this.outImage + ")";
}
@Override
@@ -52,7 +52,9 @@ public class DrawMatches implements Task {
@Override
public CpuTask toCpuTask() {
return () -> Features2d.drawMatches(this.img1, this.keypoints1, this.img2, this.keypoints2, this.matches1to2, this.originalOutImg);
return () -> {
Features2d.drawMatches(this.img1, this.keypoints1, this.img2, this.keypoints2, this.matches1to2, this.outImg);
};
}
@Override
@@ -63,7 +65,7 @@ public class DrawMatches implements Task {
@Override
public String getDescription() {
return "Features2d.drawMatches(" + this.img1 + ", " + this.keypoints1 + ", " + this.img2 + ", " + this.keypoints2 + ", " + this.matches1to2 + ", "
+ this.originalOutImg + ")";
+ this.outImg + ")";
}
@Override
@@ -55,7 +55,9 @@ public class ORB_detectAndCompute implements Task {
@Override
public CpuTask toCpuTask() {
return () -> this.theOrb.detectAndCompute(this.image, this.mask, this.keypoints, this.descriptors);
return () -> {
this.theOrb.detectAndCompute(this.image, this.mask, this.keypoints, this.descriptors);
};
}
@Override