private static void contourDetection(Mat src, Mat tpl)
	{
		Mat srcCanny = new Mat();
		Mat tplCanny = new Mat();;
		List<MatOfPoint> srcContours = new ArrayList<MatOfPoint>();
		List<MatOfPoint> tplContours = new ArrayList<MatOfPoint>();
		Mat srcHierarchy = new Mat();
		Mat tplHierarchy = new Mat();
		
		Imgproc.Canny(src, srcCanny, 100, 200);
		Imgproc.Canny(tpl, tplCanny, 100, 200);
		
		Imgproc.findContours(srcCanny, srcContours, srcHierarchy, Imgproc.RETR_TREE, Imgproc.CHAIN_APPROX_SIMPLE, new Point(0, 0));
		Imgproc.findContours(tplCanny, tplContours, tplHierarchy, Imgproc.RETR_TREE, Imgproc.CHAIN_APPROX_SIMPLE, new Point(0, 0));
		
		Mat srcDrawing = Mat.zeros(srcCanny.size(), CvType.CV_8UC3);
		for(int i = 0; i < srcContours.size(); i++)
		{
			Imgproc.drawContours(srcDrawing, srcContours, i, new Scalar(255, 255, 255), 1, 8, srcHierarchy, 0, new Point());
		}
		
		Mat tplDrawing = Mat.zeros(tplCanny.size(), CvType.CV_8UC3);
		for(int i = 0; i < tplContours.size(); i++)
		{
			Imgproc.drawContours(tplDrawing, tplContours, i,  new Scalar(255, 255, 255), 1, 8, tplHierarchy, 0, new Point());
		}
		
		Imshow.show(srcDrawing);
		Imshow.show(tplDrawing);
		
		Mat srcDrawingPolar = new Mat();
		Mat tplDrawingPolar = new Mat();
		Imgproc.logPolar(srcDrawing, srcDrawingPolar, new Point(srcDrawing.cols() * .5, srcDrawing.rows() * .5), 
                30, Imgproc.INTER_LINEAR + Imgproc.CV_WARP_FILL_OUTLIERS);
		Imgproc.logPolar(tplDrawing, tplDrawingPolar, new Point(tplDrawing.cols() * .5, tplDrawing.rows() * .5), 
				30, Imgproc.INTER_LINEAR + Imgproc.CV_WARP_FILL_OUTLIERS);
		
		Imshow.show(srcDrawingPolar);
		Imshow.show(tplDrawingPolar);
		
		Mat matchResult = new Mat();
		MinMaxLocResult minMaxLocation = new MinMaxLocResult();
		Imgproc.matchTemplate(srcDrawingPolar, tplDrawingPolar, matchResult, Imgproc.TM_SQDIFF_NORMED);
		minMaxLocation = Core.minMaxLoc(matchResult);
		
		System.out.println(minMaxLocation.minVal);
		System.out.println(minMaxLocation.maxVal);
		//Core.normalize(matchResult, matchResult, 0, 1, Core.NORM_MINMAX, -1, new Mat());
	}