I am using Template Matching of opencv for my java OCR application, when the format of image is jpg, "imread" perform well, but soon I found out change the format to binary tiff increasing the likelyhoods of recognizing,here comes the problem, when programe runs to "Mat img = Highgui.imread("D:\ID.tif");" it break,the path is correct,and ID.tif is the binary tiff which consists of only white and black,I also tried 3.1.0 which is "Mat img = Imgcodecs.imread("D:\ID.tif");".Doesnt work either, do imread support binary tiff? should i convert ID.tif to 8bit before calling imread? Any response will be appreciated!

edit retag close merge delete

btw, as always, use either / or \\ in filenames, never a single \`