private void locateTemplateMatchesDebug(Mat roiImage, Mat templateImage, org.opencv.core.Point matchLoc) {
if (logger.isDebugEnabled()) {
try {
Core.rectangle(roiImage, matchLoc, new org.opencv.core.Point(matchLoc.x + templateImage.cols(),
matchLoc.y + templateImage.rows()), new Scalar(0, 255, 0));
BufferedImage debugImage = OpenCvUtils.toBufferedImage(roiImage);
File file = Configuration.get().createResourceFile(
OpenCvVisionProvider.class, "debug_", ".png");
ImageIO.write(debugImage, "PNG", file);