Skip to content

Commit d874b7d

Browse files
committed
lots of edge detection and starting on image filters
1 parent 10c79b4 commit d874b7d

24 files changed

Lines changed: 225 additions & 132 deletions
99.6 KB
Binary file not shown.
99.6 KB
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import gab.opencvpro.*;
2+
import org.opencv.core.Mat;
3+
import org.opencv.imgproc.Imgproc;
4+
5+
OpenCVPro thresholdFilter;
6+
PImage img, thresh;
7+
void setup() {
8+
thresholdFilter = new OpenCVPro(this, "test.jpg");
9+
size(thresholdFilter.width, thresholdFilter.height);
10+
11+
12+
13+
img = opencv.getInputImage();
14+
}
15+
16+
void draw() {
17+
scale(0.5);
18+
image(img, 0, 0);
19+
img
20+
}
99.8 KB
Loading
Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
11
import gab.opencvpro.*;
2-
import java.awt.Rectangle;
3-
import org.opencv.core.Mat;
4-
import org.opencv.core.CvType;
52

6-
import org.opencv.imgproc.Imgproc;
7-
8-
OpenCVPro cannyFilter, sobelFilter;
9-
10-
PImage src, canny, sobel;
3+
OpenCVPro cannyFilter, scharrFilter, sobelFilter;
4+
PImage src, canny, scharr, sobel;
115

126
void setup() {
137
src = loadImage("test.jpg");
8+
size(src.width, src.height);
9+
1410
cannyFilter = new OpenCVPro(this, src);
11+
scharrFilter = new OpenCVPro(this, src);
1512
sobelFilter = new OpenCVPro(this, src);
1613

17-
size(cannyFilter.width, cannyFilter.height);
18-
19-
20-
//sobel = createImage(src.width, src.height, RGB);
21-
//sobel = sobelFilter.findSobelEdges(2,2);
22-
sobel = sobelFilter.findScharrX();
23-
canny = cannyFilter.findCannyEdges(20, 75);
24-
25-
// Mat src = sobelFilter.getColorBuffer();
26-
// Mat dst = new Mat(src.height(), src.width(), src.type());
27-
//
28-
// Imgproc.Sobel(src, dst, -1, 1, 1);
29-
30-
//Imgproc.Scharr(src, dst, -1, 1, 0);
31-
32-
//
33-
//sobelFilter.toPImage(dst, sobel);
34-
35-
//opencv.toPImage(opencv.findSobelEdges(20, 75), canny);
36-
37-
noFill();
38-
stroke(0, 255, 0);
39-
strokeWeight(3);
14+
15+
cannyFilter.findCannyEdges(20, 75);
16+
scharrFilter.findScharrX();
17+
sobelFilter.findSobelEdges(1,0);
18+
19+
canny = cannyFilter.getOutputImage();
20+
21+
// FIXME: need a better API for getting the gray image...
22+
sobel = createImage(src.width, src.height, RGB);
23+
sobelFilter.toPImage(sobelFilter.getBufferGray(), sobel);
24+
25+
// FIXME: Why doesn't this work?
26+
// scharr = scharrFilter.getOutputImage();
27+
scharr = createImage(src.width, src.height, RGB);
28+
scharrFilter.toPImage(scharrFilter.getBufferColor(), scharr);
4029
}
4130

31+
4232
void draw() {
33+
34+
pushMatrix();
4335
scale(0.5);
4436
image(src, 0, 0);
45-
image(canny,src.width,0);
46-
image(sobel,src.width, src.height);
37+
image(canny, src.width, 0);
38+
image(scharr, 0, src.height);
39+
image(sobel, src.width, src.height);
40+
41+
popMatrix();
42+
43+
text("Source", 10, 25);
44+
text("Canny", src.width/2 + 10, 25);
45+
text("Scharr", 10, src.height/2 + 25);
46+
text("Sobel", src.width/2 + 10, src.height/2 + 25);
4747
}
4848

distribution/OpenCVPro-1/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ <h1>OpenCVPro</h1>
4242
<h2>OpenCVPro</h2>
4343
<p>
4444
A library by <a href="http://gregborenstein.com">Greg Borenstein</a> for the <a href="http://www.processing.org" target="_blank">Processing</a> programming environment.<br>
45-
Last update, 04/09/2013.
45+
Last update, 04/10/2013.
4646
</p>
4747
<p>
4848
Computer vision with OpenCV based on the official OpenCV Java API.<br>
@@ -78,7 +78,7 @@ <h2>Installation</h2>
7878
<h2>Examples</h2>
7979
<p>Find a list of examples in the current distribution of OpenCVPro, or have a look at them by following the links below.</p>
8080
<ul>
81-
<li><a href="examples/FaceDetection/FaceDetection.pde">FaceDetection</a></li> <li><a href="examples/FindEdges/FindEdges.pde">FindEdges</a></li> <li><a href="examples/LoadAndDisplayImage/LoadAndDisplayImage.pde">LoadAndDisplayImage</a></li>
81+
<li><a href="examples/FaceDetection/FaceDetection.pde">FaceDetection</a></li> <li><a href="examples/FilterImages/FilterImages.pde">FilterImages</a></li> <li><a href="examples/FindEdges/FindEdges.pde">FindEdges</a></li> <li><a href="examples/LoadAndDisplayImage/LoadAndDisplayImage.pde">LoadAndDisplayImage</a></li>
8282
</ul>
8383
</div>
8484

distribution/OpenCVPro-1/reference/allclasses-frame.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<!--NewPage-->
33
<HTML>
44
<HEAD>
5-
<!-- Generated by javadoc (build 1.6.0_37) on Tue Apr 09 14:54:12 EDT 2013 -->
5+
<!-- Generated by javadoc (build 1.6.0_37) on Wed Apr 10 02:18:25 EDT 2013 -->
66
<TITLE>
77
All Classes (Javadocs: OpenCVPro)
88
</TITLE>
99

10-
<META NAME="date" CONTENT="2013-04-09">
10+
<META NAME="date" CONTENT="2013-04-10">
1111

1212
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
1313

distribution/OpenCVPro-1/reference/allclasses-noframe.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<!--NewPage-->
33
<HTML>
44
<HEAD>
5-
<!-- Generated by javadoc (build 1.6.0_37) on Tue Apr 09 14:54:12 EDT 2013 -->
5+
<!-- Generated by javadoc (build 1.6.0_37) on Wed Apr 10 02:18:25 EDT 2013 -->
66
<TITLE>
77
All Classes (Javadocs: OpenCVPro)
88
</TITLE>
99

10-
<META NAME="date" CONTENT="2013-04-09">
10+
<META NAME="date" CONTENT="2013-04-10">
1111

1212
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
1313

distribution/OpenCVPro-1/reference/constant-values.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<!--NewPage-->
33
<HTML>
44
<HEAD>
5-
<!-- Generated by javadoc (build 1.6.0_37) on Tue Apr 09 14:54:12 EDT 2013 -->
5+
<!-- Generated by javadoc (build 1.6.0_37) on Wed Apr 10 02:18:25 EDT 2013 -->
66
<TITLE>
77
Constant Field Values (Javadocs: OpenCVPro)
88
</TITLE>
99

10-
<META NAME="date" CONTENT="2013-04-09">
10+
<META NAME="date" CONTENT="2013-04-10">
1111

1212
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
1313

distribution/OpenCVPro-1/reference/deprecated-list.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<!--NewPage-->
33
<HTML>
44
<HEAD>
5-
<!-- Generated by javadoc (build 1.6.0_37) on Tue Apr 09 14:54:12 EDT 2013 -->
5+
<!-- Generated by javadoc (build 1.6.0_37) on Wed Apr 10 02:18:25 EDT 2013 -->
66
<TITLE>
77
Deprecated List (Javadocs: OpenCVPro)
88
</TITLE>
99

10-
<META NAME="date" CONTENT="2013-04-09">
10+
<META NAME="date" CONTENT="2013-04-10">
1111

1212
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
1313

0 commit comments

Comments
 (0)