static Location findEdge(Pixel inputPixel, WritableRaster imageRaster,
			EdgeType edgeType) {
		int x = 0, y = 0;
		int[] pixelArray = new int[1];
		int i = 0;
		switch (edgeType) {
		case TOP: {
			x = 0;
			y = -1;
		}
		case BOTTOM: {
			x = 0;
			y = 1;
		}
		case LEFT: {
			x = -1;
			y = 0;
		}
		case RIGHT: {
			x = 1;
			y = 0;
		}
		}
		while (true) {
			i++;
			pixelArray = imageRaster.getPixel(inputPixel.getPositionX()
					+ (i * x), inputPixel.getPositionY() + (i * y), pixelArray);
			if (!inputPixel.compareToPixelFromValue(pixelArray[0])) {

				break;
			}
		}
		i--;
		Location locationOfEdge = new Location(inputPixel.getPositionX() + (i * x), inputPixel.getPositionY() + (i * y));

		return locationOfEdge;
	}