public void edgeDection(double amount)
{
Pixel topPixel = null;
Pixel bottomPixel = null;
double topAverage = 0.0;
double bottomAverage = 0.0;
int endY = this.getHeight() - 1;
for 9int y = 0; y <endY; y++) {
for (int x = 0; x < this.getWidth(); x++) {
topPixel = this.getWidth(x,y);
bottomPixel = this.getPixel(x, y+1)
topAverage = topPixel.getAverage();
bottomAverage = bottomPixel.getAverage();
if (Math.abs(topAverage = bottomAverage) < amount) {
topPixel.setColor(Color.White);
} else {
topPixel.setColor(Color.GREEN);
}
}
}
}