@Override
	public void run() {
		
		ImageSegFrame frame = null;
		BufferedImage screenshot = null;
       	while (true) {
			// capture an image
		    screenshot = ActionRobot.doScreenShot();
			// analyse and show image
			//int[][] meta = computeMetaInformation(screenshot);
		    
		    if(!useRealshape)
		    	screenshot = drawMBRs(screenshot);
		    else
		    	screenshot = drawRealshape(screenshot);
		    
			if (frame == null) {

				frame = new ImageSegFrame("Image Segmentation", screenshot,
						null);
			} else {
				frame.refresh(screenshot, null);
			}

			// sleep for 50ms
			try {
				Thread.sleep(50);
			} catch (InterruptedException e) {
				System.err.println(" Thread Interrupt");
			}
		}
	}