Skip to content

Commit

Permalink
replaced Pmage resize with opencv resize method to avoid conflicts wi…
Browse files Browse the repository at this point in the history
…th Processing4 #8
  • Loading branch information
cansik committed Feb 23, 2021
1 parent 2f9a106 commit 6606efb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group 'ch.bildspur'
version '0.6.0'
version '0.6.1'

sourceCompatibility = 1.8

Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ authors=[Florian Bruggisser](https://broox.ch)
url=https://github.com/cansik/deep-vision-processing
sentence=Deep computer-vision algorithms for Processing
paragraph=Run deep neural networks on images in Processing.
version=006000
prettyVersion=0.6.0
version=006100
prettyVersion=0.6.1
minRevision=0
maxRevision=0
9 changes: 5 additions & 4 deletions src/main/java/ch/bildspur/vision/MidasNetwork.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

import static org.bytedeco.opencv.global.opencv_core.*;
import static org.bytedeco.opencv.global.opencv_dnn.*;
import static org.bytedeco.opencv.global.opencv_imgproc.CV_INTER_AREA;
import static org.bytedeco.opencv.global.opencv_imgproc.cvResize;
import static org.bytedeco.opencv.global.opencv_imgproc.*;

public class MidasNetwork extends BaseNeuralNetwork<ImageResult> {
private Path model;
Expand Down Expand Up @@ -68,10 +67,12 @@ public ImageResult run(Mat frame) {

output = output.reshape(1, height);

// resize output instead of PImage to avoid Processing4 problems
resize(output, output, inputSize);

// todo: result a depth frame instead of a color image!
PImage result = new PImage(output.size().width(), output.size().height());
PImage result = new PImage(inputSize.width(), inputSize.height());
mapDepthToImage(output, result);
result.resize(inputSize.width(), inputSize.height());
return new ImageResult(result);
}

Expand Down

0 comments on commit 6606efb

Please sign in to comment.