Skip to content

Commit 21135f2

Browse files
authored
Merge pull request atduskgreg#95 from ncmikkelsen/master
Update size() parameters of examples
2 parents ff4c702 + 940fd38 commit 21135f2

25 files changed

Lines changed: 53 additions & 70 deletions

File tree

examples/BrightestPoint/BrightestPoint.pde

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ OpenCV opencv;
55
void setup() {
66
PImage src = loadImage("robot_light.jpg");
77
src.resize(800, 0);
8-
size(src.width, src.height);
8+
size(800, 533);
99

1010
opencv = new OpenCV(this, src);
1111
}
@@ -18,5 +18,4 @@ void draw() {
1818
strokeWeight(4);
1919
noFill();
2020
ellipse(loc.x, loc.y, 10, 10);
21-
}
22-
21+
}

examples/BrightnessContrast/BrightnessContrast.pde

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@ OpenCV opencv;
55

66
void setup(){
77
img = loadImage("test.jpg");
8-
size(img.width, img.height);
8+
size(1080, 720);
99
opencv = new OpenCV(this, img);
1010
}
1111

1212
void draw(){
1313
opencv.loadImage(img);
1414
opencv.brightness((int)map(mouseX, 0, width, -255, 255));
1515
image(opencv.getOutput(),0,0);
16-
}
17-
16+
}

examples/CalibrationDemo/CalibrationDemo.pde

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ OpenCV opencv;
77
void setup() {
88
src = loadImage("checkerboard.jpg");
99
src.resize(500, 0);
10-
size(src.width, src.height);
10+
size(500, 333);
1111

1212
opencv = new OpenCV(this, src);
1313
opencv.gray();
@@ -22,4 +22,4 @@ void draw() {
2222
for(PVector p : cornerPoints){
2323
ellipse(p.x, p.y, 5, 5);
2424
}
25-
}
25+
}

examples/ColorChannels/ColorChannels.pde

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ void setup() {
99
src = loadImage("green_object.png");
1010
src.resize(800,0);
1111
opencv = new OpenCV(this, src);
12-
size(int(opencv.width*1.5), int(opencv.height * 1.5));
12+
size(1200, 672);
1313

1414
imgH = src.height/2;
1515
imgW = src.width/2;
@@ -43,4 +43,4 @@ void draw() {
4343
image(h, 0, 2*imgH, imgW, imgH);
4444
image(s, imgW, 2*imgH, imgW, imgH);
4545
image(v, 2*imgW, 2*imgH, imgW, imgH);
46-
}
46+
}

examples/DepthFromStereo/DepthFromStereo.pde

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ void setup() {
1515

1616
ocvR = new OpenCV(this, imgR);
1717

18-
size(ocvL.width * 2, ocvL.height*2);
19-
18+
size(768, 576);
19+
2020
ocvL.gray();
2121
ocvR.gray();
2222
Mat left = ocvL.getGray();
@@ -54,5 +54,4 @@ void draw() {
5454
text("right", 10 + imgL.width, 20);
5555
text("stereo SGBM", 10, imgL.height + 20);
5656
text("stereo BM", 10 + imgL.width, imgL.height+ 20);
57-
}
58-
57+
}

examples/DilationAndErosion/DilationAndErosion.pde

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ OpenCV opencv;
66
void setup() {
77
src = loadImage("pen_sketch.jpg");
88
src.resize(src.width/2, 0);
9-
size(src.width*2, src.height*2);
9+
size(800, 786);
1010

1111
opencv = new OpenCV(this, src);
1212

@@ -47,5 +47,4 @@ void draw() {
4747
text("erode", src.width + 20, 20);
4848
text("dilate", 20, src.height+20);
4949
text("dilate then erode\n(close holes)", src.width+20, src.height+20);
50-
}
51-
50+
}

examples/FaceDetection/FaceDetection.pde

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Rectangle[] faces;
66

77
void setup() {
88
opencv = new OpenCV(this, "test.jpg");
9-
size(opencv.width, opencv.height);
9+
size(1080, 720);
1010

1111
opencv.loadCascade(OpenCV.CASCADE_FRONTALFACE);
1212
faces = opencv.detect();
@@ -21,5 +21,4 @@ void draw() {
2121
for (int i = 0; i < faces.length; i++) {
2222
rect(faces[i].x, faces[i].y, faces[i].width, faces[i].height);
2323
}
24-
}
25-
24+
}

examples/FilterImages/FilterImages.pde

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PImage img, thresh, blur, adaptive;
55

66
void setup() {
77
img = loadImage("test.jpg");
8-
size(img.width, img.height);
8+
size(1080, 720);
99

1010
opencv = new OpenCV(this, img);
1111
PImage gray = opencv.getSnapshot();
@@ -36,5 +36,4 @@ void draw() {
3636
text("threshold", img.width - 100, 20 );
3737
text("blur", img.width/2 - 100, img.height/2 + 20 );
3838
text("adaptive threshold", img.width - 150, img.height/2 + 20 );
39-
}
40-
39+
}

examples/FindContours/FindContours.pde

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ArrayList<Contour> polygons;
88

99
void setup() {
1010
src = loadImage("test.jpg");
11-
size(src.width, src.height/2);
11+
size(1080, 360);
1212
opencv = new OpenCV(this, src);
1313

1414
opencv.gray();
@@ -38,5 +38,4 @@ void draw() {
3838
}
3939
endShape();
4040
}
41-
}
42-
41+
}

examples/FindEdges/FindEdges.pde

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ PImage src, canny, scharr, sobel;
55

66
void setup() {
77
src = loadImage("test.jpg");
8-
size(src.width, src.height);
8+
size(1080, 720);
99

1010
opencv = new OpenCV(this, src);
1111
opencv.findCannyEdges(20,75);
@@ -34,5 +34,4 @@ void draw() {
3434
text("Canny", src.width/2 + 10, 25);
3535
text("Scharr", 10, src.height/2 + 25);
3636
text("Sobel", src.width/2 + 10, src.height/2 + 25);
37-
}
38-
37+
}

0 commit comments

Comments
 (0)