public static BufferedImage drawMBRs(BufferedImage screenshot) {


		// get game state
		GameStateExtractor game = new GameStateExtractor();
		GameStateExtractor.GameState state = game.getGameState(screenshot);
		if (state != GameStateExtractor.GameState.PLAYING) {
			screenshot = VisionUtils.convert2grey(screenshot);
			return screenshot;
		}

		
		// process image
		Vision vision = new Vision(screenshot);
		pigs = vision.getMBRVision().findPigsMBR();
		redBirds = vision.getMBRVision().findRedBirdsMBRs();
		blueBirds = vision.getMBRVision().findBlueBirdsMBRs();
		yellowBirds = vision.getMBRVision().findYellowBirdsMBRs();
		woodBlocks = vision.getMBRVision().findWoodMBR();
		stoneBlocks = vision.getMBRVision().findStonesMBR();
		iceBlocks = vision.getMBRVision().findIceMBR();
		whiteBirds = vision.getMBRVision().findWhiteBirdsMBRs();
		blackBirds = vision.getMBRVision().findBlackBirdsMBRs();
		TNTs = vision.getMBRVision().findTNTsMBR();
		trajPoints = vision.findTrajPoints();

		Rectangle sling = vision.findSlingshotMBR();


		// draw objects
		screenshot = VisionUtils.convert2grey(screenshot);
		VisionUtils.drawBoundingBoxes(screenshot, pigs, Color.GREEN);
		VisionUtils.drawBoundingBoxes(screenshot, redBirds, Color.RED);
		VisionUtils.drawBoundingBoxes(screenshot, blueBirds, Color.BLUE);
		VisionUtils.drawBoundingBoxes(screenshot, yellowBirds, Color.YELLOW);
		VisionUtils.drawBoundingBoxes(screenshot, woodBlocks, Color.WHITE,
				Color.ORANGE);
		VisionUtils.drawBoundingBoxes(screenshot, stoneBlocks, Color.WHITE,
				Color.GRAY);
		VisionUtils.drawBoundingBoxes(screenshot, iceBlocks, Color.WHITE,
				Color.CYAN);
		VisionUtils.drawBoundingBoxes(screenshot, whiteBirds, Color.WHITE,
				Color.lightGray);
		VisionUtils.drawBoundingBoxes(screenshot, TNTs, Color.WHITE,
				Color.PINK);
		VisionUtils.drawBoundingBoxes(screenshot, blackBirds,
				Color.BLACK);
		if (sling != null) {
			VisionUtils.drawBoundingBox(screenshot, sling, Color.ORANGE,
					Color.BLACK);

			// generate traj points using estimated parameters
			Matrix W = vision.getMBRVision().fitParabola(trajPoints);
			int p[][] = new int[2][100];
			int startx = (int) sling.getCenterX();
			for (int i = 0; i < 100; i++) {
				p[0][i] = startx;
				double tem = W.get(0, 0) * Math.pow(p[0][i], 2) + W.get(1, 0)
						* p[0][i] + W.get(2, 0);
				p[1][i] = (int) tem;
				startx += 10;
			}
			if (W.get(0, 0) > 0)
				VisionUtils.drawtrajectory(screenshot, p, Color.RED);

		}

		return screenshot;
	}