Skip to content

Commit 275a018

Browse files
committed
Adds stacking functionality
1 parent 243a80b commit 275a018

33 files changed

+879
-57
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import milchreis.imageprocessing.*;
2+
3+
PImage image;
4+
PImage[] faces;
5+
6+
void setup() {
7+
size(128, 155);
8+
// Load faces grid
9+
image = loadImage(dataPath("yaleBfaces.jpg"));
10+
11+
// Dimensions for each face
12+
int gridWidth = 128;
13+
int gridHeight = 155;
14+
15+
// Create an array of images for each face
16+
faces = new PImage[(image.width/gridWidth) * (image.height/gridHeight)];
17+
int index = 0;
18+
19+
for(int x=0; x < image.width; x+=gridWidth) {
20+
for(int y=0; y < image.height; y+=gridHeight) {
21+
faces[index++] = image.get(x, y, gridWidth, gridHeight);
22+
}
23+
}
24+
}
25+
26+
void draw() {
27+
if(mousePressed == true) {
28+
// Alternative algorithm is average
29+
image(Stacker.apply(Stacker.ALGORITHM.AVERAGE, faces), 0, 0);
30+
} else {
31+
// Default algorithm is median
32+
image(Stacker.apply(faces), 0, 0);
33+
}
34+
35+
// The array is not necessary. If you save your images in different variables use this:
36+
// Stacker.apply(image1, image2, image3); // works also
37+
}
38+
70.6 KB
Loading

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ paragraph = Easy access for bluring or coloring images or video streams.
4141
# compare different versions of the same Library, and check if an update is
4242
# available. You should think of it as a counter, counting the total number of
4343
# releases you've had.
44-
version = 2 # This must be parsable as an int
44+
version = 3 # This must be parsable as an int
4545

4646
# The version as the user will see it. If blank, the version attribute will be
4747
# used here. This should be a single word, with no spaces.

library/ImageProcessing.jar

1.49 KB
Binary file not shown.

reference/allclasses-frame.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- NewPage -->
33
<html lang="de">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_151) on Sat Jan 06 21:38:06 CET 2018 -->
5+
<!-- Generated by javadoc (1.8.0_151) on Sun Jan 07 23:55:42 CET 2018 -->
66
<title>All Classes (Javadocs: ImageProcessing)</title>
7-
<meta name="date" content="2018-01-06">
7+
<meta name="date" content="2018-01-07">
88
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
99
<script type="text/javascript" src="script.js"></script>
1010
</head>
@@ -25,6 +25,8 @@ <h1 class="bar">All&nbsp;Classes</h1>
2525
<li><a href="milchreis/imageprocessing/LUT.STYLE.html" title="enum in milchreis.imageprocessing" target="classFrame">LUT.STYLE</a></li>
2626
<li><a href="milchreis/imageprocessing/RegionGrowing.html" title="class in milchreis.imageprocessing" target="classFrame">RegionGrowing</a></li>
2727
<li><a href="milchreis/imageprocessing/Sharpen.html" title="class in milchreis.imageprocessing" target="classFrame">Sharpen</a></li>
28+
<li><a href="milchreis/imageprocessing/Stacker.html" title="class in milchreis.imageprocessing" target="classFrame">Stacker</a></li>
29+
<li><a href="milchreis/imageprocessing/Stacker.ALGORITHM.html" title="enum in milchreis.imageprocessing" target="classFrame">Stacker.ALGORITHM</a></li>
2830
<li><a href="milchreis/imageprocessing/Threshold.html" title="class in milchreis.imageprocessing" target="classFrame">Threshold</a></li>
2931
<li><a href="milchreis/imageprocessing/Tools.html" title="class in milchreis.imageprocessing" target="classFrame">Tools</a></li>
3032
</ul>

reference/allclasses-noframe.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- NewPage -->
33
<html lang="de">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_151) on Sat Jan 06 21:38:06 CET 2018 -->
5+
<!-- Generated by javadoc (1.8.0_151) on Sun Jan 07 23:55:42 CET 2018 -->
66
<title>All Classes (Javadocs: ImageProcessing)</title>
7-
<meta name="date" content="2018-01-06">
7+
<meta name="date" content="2018-01-07">
88
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
99
<script type="text/javascript" src="script.js"></script>
1010
</head>
@@ -25,6 +25,8 @@ <h1 class="bar">All&nbsp;Classes</h1>
2525
<li><a href="milchreis/imageprocessing/LUT.STYLE.html" title="enum in milchreis.imageprocessing">LUT.STYLE</a></li>
2626
<li><a href="milchreis/imageprocessing/RegionGrowing.html" title="class in milchreis.imageprocessing">RegionGrowing</a></li>
2727
<li><a href="milchreis/imageprocessing/Sharpen.html" title="class in milchreis.imageprocessing">Sharpen</a></li>
28+
<li><a href="milchreis/imageprocessing/Stacker.html" title="class in milchreis.imageprocessing">Stacker</a></li>
29+
<li><a href="milchreis/imageprocessing/Stacker.ALGORITHM.html" title="enum in milchreis.imageprocessing">Stacker.ALGORITHM</a></li>
2830
<li><a href="milchreis/imageprocessing/Threshold.html" title="class in milchreis.imageprocessing">Threshold</a></li>
2931
<li><a href="milchreis/imageprocessing/Tools.html" title="class in milchreis.imageprocessing">Tools</a></li>
3032
</ul>

reference/constant-values.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- NewPage -->
33
<html lang="de">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_151) on Sat Jan 06 21:38:06 CET 2018 -->
5+
<!-- Generated by javadoc (1.8.0_151) on Sun Jan 07 23:55:42 CET 2018 -->
66
<title>Constant Field Values (Javadocs: ImageProcessing)</title>
7-
<meta name="date" content="2018-01-06">
7+
<meta name="date" content="2018-01-07">
88
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
99
<script type="text/javascript" src="script.js"></script>
1010
</head>

reference/deprecated-list.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- NewPage -->
33
<html lang="de">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_151) on Sat Jan 06 21:38:06 CET 2018 -->
5+
<!-- Generated by javadoc (1.8.0_151) on Sun Jan 07 23:55:42 CET 2018 -->
66
<title>Deprecated List (Javadocs: ImageProcessing)</title>
7-
<meta name="date" content="2018-01-06">
7+
<meta name="date" content="2018-01-07">
88
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
99
<script type="text/javascript" src="script.js"></script>
1010
</head>

reference/help-doc.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- NewPage -->
33
<html lang="de">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_151) on Sat Jan 06 21:38:06 CET 2018 -->
5+
<!-- Generated by javadoc (1.8.0_151) on Sun Jan 07 23:55:42 CET 2018 -->
66
<title>API Help (Javadocs: ImageProcessing)</title>
7-
<meta name="date" content="2018-01-06">
7+
<meta name="date" content="2018-01-07">
88
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
99
<script type="text/javascript" src="script.js"></script>
1010
</head>

reference/index-all.html

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<!-- NewPage -->
33
<html lang="de">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_151) on Sat Jan 06 21:38:06 CET 2018 -->
5+
<!-- Generated by javadoc (1.8.0_151) on Sun Jan 07 23:55:42 CET 2018 -->
66
<title>Index (Javadocs: ImageProcessing)</title>
7-
<meta name="date" content="2018-01-06">
7+
<meta name="date" content="2018-01-07">
88
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
99
<script type="text/javascript" src="script.js"></script>
1010
</head>
@@ -114,6 +114,10 @@ <h2 class="title">A</h2>
114114
<dd>
115115
<div class="block">Sharps an image by convolution and a specified intensity.</div>
116116
</dd>
117+
<dt><span class="memberNameLink"><a href="milchreis/imageprocessing/Stacker.html#apply-processing.core.PImage...-">apply(PImage...)</a></span> - Static method in class milchreis.imageprocessing.<a href="milchreis/imageprocessing/Stacker.html" title="class in milchreis.imageprocessing">Stacker</a></dt>
118+
<dd>&nbsp;</dd>
119+
<dt><span class="memberNameLink"><a href="milchreis/imageprocessing/Stacker.html#apply-milchreis.imageprocessing.Stacker.ALGORITHM-processing.core.PImage...-">apply(Stacker.ALGORITHM, PImage...)</a></span> - Static method in class milchreis.imageprocessing.<a href="milchreis/imageprocessing/Stacker.html" title="class in milchreis.imageprocessing">Stacker</a></dt>
120+
<dd>&nbsp;</dd>
117121
<dt><span class="memberNameLink"><a href="milchreis/imageprocessing/Threshold.html#apply-processing.core.PImage-double-">apply(PImage, double)</a></span> - Static method in class milchreis.imageprocessing.<a href="milchreis/imageprocessing/Threshold.html" title="class in milchreis.imageprocessing">Threshold</a></dt>
118122
<dd>&nbsp;</dd>
119123
<dt><span class="memberNameLink"><a href="milchreis/imageprocessing/Threshold.html#apply-processing.core.PImage-">apply(PImage)</a></span> - Static method in class milchreis.imageprocessing.<a href="milchreis/imageprocessing/Threshold.html" title="class in milchreis.imageprocessing">Threshold</a></dt>
@@ -311,6 +315,14 @@ <h2 class="title">S</h2>
311315
<dd>&nbsp;</dd>
312316
<dt><span class="memberNameLink"><a href="milchreis/imageprocessing/Sharpen.html#Sharpen--">Sharpen()</a></span> - Constructor for class milchreis.imageprocessing.<a href="milchreis/imageprocessing/Sharpen.html" title="class in milchreis.imageprocessing">Sharpen</a></dt>
313317
<dd>&nbsp;</dd>
318+
<dt><a href="milchreis/imageprocessing/Stacker.html" title="class in milchreis.imageprocessing"><span class="typeNameLink">Stacker</span></a> - Class in <a href="milchreis/imageprocessing/package-summary.html">milchreis.imageprocessing</a></dt>
319+
<dd>
320+
<div class="block">The Stacker takes a bunch of images and grabs the median pixel of each images.</div>
321+
</dd>
322+
<dt><span class="memberNameLink"><a href="milchreis/imageprocessing/Stacker.html#Stacker--">Stacker()</a></span> - Constructor for class milchreis.imageprocessing.<a href="milchreis/imageprocessing/Stacker.html" title="class in milchreis.imageprocessing">Stacker</a></dt>
323+
<dd>&nbsp;</dd>
324+
<dt><a href="milchreis/imageprocessing/Stacker.ALGORITHM.html" title="enum in milchreis.imageprocessing"><span class="typeNameLink">Stacker.ALGORITHM</span></a> - Enum in <a href="milchreis/imageprocessing/package-summary.html">milchreis.imageprocessing</a></dt>
325+
<dd>&nbsp;</dd>
314326
</dl>
315327
<a name="I:T">
316328
<!-- -->
@@ -338,11 +350,20 @@ <h2 class="title">V</h2>
338350
<dd>
339351
<div class="block">Returns the enum constant of this type with the specified name.</div>
340352
</dd>
353+
<dt><span class="memberNameLink"><a href="milchreis/imageprocessing/Stacker.ALGORITHM.html#valueOf-java.lang.String-">valueOf(String)</a></span> - Static method in enum milchreis.imageprocessing.<a href="milchreis/imageprocessing/Stacker.ALGORITHM.html" title="enum in milchreis.imageprocessing">Stacker.ALGORITHM</a></dt>
354+
<dd>
355+
<div class="block">Returns the enum constant of this type with the specified name.</div>
356+
</dd>
341357
<dt><span class="memberNameLink"><a href="milchreis/imageprocessing/LUT.STYLE.html#values--">values()</a></span> - Static method in enum milchreis.imageprocessing.<a href="milchreis/imageprocessing/LUT.STYLE.html" title="enum in milchreis.imageprocessing">LUT.STYLE</a></dt>
342358
<dd>
343359
<div class="block">Returns an array containing the constants of this enum type, in
344360
the order they are declared.</div>
345361
</dd>
362+
<dt><span class="memberNameLink"><a href="milchreis/imageprocessing/Stacker.ALGORITHM.html#values--">values()</a></span> - Static method in enum milchreis.imageprocessing.<a href="milchreis/imageprocessing/Stacker.ALGORITHM.html" title="enum in milchreis.imageprocessing">Stacker.ALGORITHM</a></dt>
363+
<dd>
364+
<div class="block">Returns an array containing the constants of this enum type, in
365+
the order they are declared.</div>
366+
</dd>
346367
</dl>
347368
<a href="#I:A">A</a>&nbsp;<a href="#I:B">B</a>&nbsp;<a href="#I:C">C</a>&nbsp;<a href="#I:D">D</a>&nbsp;<a href="#I:E">E</a>&nbsp;<a href="#I:G">G</a>&nbsp;<a href="#I:H">H</a>&nbsp;<a href="#I:K">K</a>&nbsp;<a href="#I:L">L</a>&nbsp;<a href="#I:M">M</a>&nbsp;<a href="#I:O">O</a>&nbsp;<a href="#I:R">R</a>&nbsp;<a href="#I:S">S</a>&nbsp;<a href="#I:T">T</a>&nbsp;<a href="#I:V">V</a>&nbsp;</div>
348369
<!-- ======= START OF BOTTOM NAVBAR ====== -->

0 commit comments

Comments
 (0)