public void stateChanged(ChangeEvent e) {
		if(imageMat != null){
			int oldIdx = viewTabs.getSelectedIndex();
			viewTabs.removeAll();
			viewTabs.addTab("Output", null, outputViewPanel, null);
			viewTabs.addTab("Overlay", null, overlayViewPanel, null);

			Mat localMat = imageMat.clone();
			Mat overlayMat = new Mat(imageMat.height(), imageMat.width(), imageMat.type());
			imgInfo.setOverlayMat(overlayMat);
			imgInfo.setOriginalMat(imageMat);
			if(imgInfo.getMetaFile() != null)imgInfo.getMetaFile().clearMetadata();

			for(Component comp : compManager.getComponents()){
				if(comp.isApplyEnabled()){
					//					System.out.print(comp.getTitle() + ": " + CvType.typeToString(localMat.type()) + " -> ");
					comp.applyComponent(localMat, imgInfo);
					//					System.out.println(CvType.typeToString(localMat.type()));
					if(comp.shouldVisualize()){
						addVisual(comp.getTitle(), localMat);
					}
				}
			}

			Core.add(localMat, overlayMat, localMat);
			Core.add(imageMat, overlayMat, overlayMat);

			outputViewPanel.setMat(localMat);
			overlayViewPanel.setMat(overlayMat);
			viewTabs.setSelectedIndex(Math.min(viewTabs.getTabCount()-1, oldIdx));
		}
	}