private static void testCamera(Dimension cameraDimension) throws IOException {
		DesktopMarkerFinder finder = new DesktopMarkerFinder();
		Webcam webcam = Webcam.getDefault();
		webcam.setViewSize(cameraDimension);
		webcam.open();
		final MainFrame mf = new MainFrame(webcam.getImage(), "Obraz", false);
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
				mf.setVisible(true);
			}
		});

		Timer timer = new Timer(1000, new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent arg0) {
				mf.setFPS();
			}
		});

		final MainFrame mf2 = new MainFrame(null, "Marker", false);
		if (DEBUG) {
			SwingUtilities.invokeLater(new Runnable() {
				@Override
				public void run() {
					mf2.setLocation(0, 350);
					mf2.setVisible(true);
				}
			});
		}

		final MainFrame mf3 = new MainFrame(null, "AR", true);
		SwingUtilities.invokeLater(new Runnable() {
			@Override
			public void run() {
				mf3.setLocation(350, 0);
				mf3.setVisible(true);
			}
		});

		timer.start();
		MarkerFilter insideFilter = new InsideMarkerFilter();
		MarkerFilter cornerFilter = new CornerMarkerFilter();
		MarkerFilter lengthFilter = new LengthMarkerFilter();
		MarkerFilter memoryFilter = new MemoryMarkerFilter(new MarkerFilter[] { cornerFilter, lengthFilter });

		Posit posit = new Posit(cameraDimension);
		CodeRetreiver cr = new CodeRetreiver();

		int i = 0;
		while (true) {
			BufferedImage img = webcam.getImage();
			if (img != null) {
				ImageIO.write(img, "png", new File("frames\\" + i + ".png"));
				i++;
				BufferedImage debugImage = ImageOperations.copyImage(img);
				BufferedImage erasedMarkers = ImageOperations.copyImage(img);
				List<Marker> markers = finder.findMarkers(img, debugImage);
				markers = insideFilter.filterMarkers(markers, img);
				markers = memoryFilter.filterMarkers(markers, img);
				try {
					if (markers != null && !markers.isEmpty()) {
						markers = new CornerBasedOrientationFinder().setMarkerOrinetation(markers, img);
						DesktopMarkerFinder.drawMarkers(debugImage, markers);
						mf.setImage(debugImage);
						ImageOperations.eraseMarkers(erasedMarkers, markers, Color.BLACK);
						mf3.setImage(erasedMarkers);
						for (Marker marker : markers) {
							double maxX = Marker.getMaxX(marker);
							double minX = Marker.getMinX(marker);
							double maxY = Marker.getMaxY(marker);
							double minY = Marker.getMinY(marker);
							Vector2d minV = new Vector2d(minX, minY);
							BufferedImage subImage = img.getSubimage((int) minX, (int) minY, (int) (maxX - minX), (int) (maxY - minY));
							File temp = new File("temp.png");
							ImageIO.write(subImage, "png", temp);
							subImage = ImageIO.read(temp);
							temp.delete();
							Marker subMarker = new Marker(marker.getCorner1().subtract(minV), marker.getCorner2().subtract(minV), marker.getCorner3().subtract(minV), marker.getCorner4().subtract(minV));
							PerspectiveFinder pFinder = new PerspectiveFinder(MarkerFinder.MARKER_DIMENSION.width, MarkerFinder.MARKER_DIMENSION.height);
							Matrix m = pFinder.findPerspectiveMatrix(subMarker);
							BufferedImage markerImage = pFinder.transformBufferedImage(m, subImage, MarkerFinder.MARKER_DIMENSION);
							int[] code = cr.retreiveCode(markerImage);
							int c = CodeDecryptor.decryptCode(code);
							if (DEBUG) {
								mf2.setImage(markerImage);
								mf2.setFPS(c);
							}
							posit.calculatePosit(marker);
							ArModel model = ModelLibrary.getModel(c);
							mf3.setModel(model, posit.getTranslate(), posit.getRotate(), 1.0);
						}
					} else {
						mf.setImage(img);
						mf3.setImage(img);
					}
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
			mf3.clearModels();
		}
	}