"imread" read binary tiff failed

asked 2016-01-19 08:44:25 -0500

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");".Doesn`t work either, do imread support binary tiff? should i convert ID.tif to 8bit before calling imread? Any response will be appreciated!

edit retag flag offensive close merge delete


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

berak gravatar imageberak ( 2016-01-19 08:53:14 -0500 )edit

sorry,mistype the path,in the programe, the path is correct,it is generated from getPath().

pioneer604 gravatar imagepioneer604 ( 2016-01-19 14:39:15 -0500 )edit