Homework 5
a. Erosion
//check if me is white
if (me == 255) {
//check if me is touching black
if (ne == 0 || n_ == 0 || nw == 0 || _e == 0 || _w == 0 || se == 0 || s_ == 0 || sw == 0) {
me = 0;
}
}
pixelsAltered1[pixIndex] = me;
Team JAB (Joseph, Antoninus, Bruce) working on the algorithm for erosion. Click on the image for a larger view.
b. Dilation
//check if me is white
if (me == 0) {
//check if me is touching white
if (ne == 255 || n_ == 255 || nw == 255 || _e == 255 || _w == 255 || se == 255 || s_ == 255 || sw == 255) {
me = 255;
}
}
pixelsAltered1[pixIndex] = me;
Team JAB (Joseph, Antoninus, Bruce) working on the algorithm for dilation. Click on the image for a larger view.
b. Connected Components
7 blobs
340 blobs
5 blobs
1 blob
8 blobs
Team JAB (Joseph, Antoninus, Bruce) working on the algorithm for connected components. Click on the images for a larger views.






