Robust card detection/persecutive correction OpenCV
I currently have a method for detecting a card in an image and for the most part it works when the lighting is fairly consistent and the background is very calm. Here is the code I am using to preform this operation: Mat img = inImg.clone(); outImg = Mat(inImg.size(), CV_8UC1); inImg.copyTo(outImg); Mat img_fullRes = img.clone(); pyrDown(img, img); Mat imgGray; cvtColor(img, imgGray, CV_RGB2GRAY); outImg_gray = imgGray.clone(); // Find Edges // Mat detectedEdges = imgGray.clone(); bilateralFilter(imgGray, detectedEdges, 0, 185, 3, 0); Canny( detectedEdges, detectedEdges, 20, 65, 3 ); dilate