Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

Save floating point TIFF images

$
0
0
Hi team, I work with a team that uses MATLAB for image analysis. They trade floating point TIFF files for analysis. I am working through the simple read/write tutorials but am frustrated by the fact that I cannot write out a floating point TIFF file. here is some code I've been using: #include #include using namespace cv; int main(int argc, char** argv ) { if ( argc != 4 ) { printf("usage: DisplayImage.out \n"); return -1; } //read images from memory Mat A; A = imread( argv[1], CV_LOAD_IMAGE_UNCHANGED ); Mat B; B = imread( argv[2], CV_LOAD_IMAGE_UNCHANGED ); Mat C; C = imread( argv[3], CV_LOAD_IMAGE_UNCHANGED ); //create floating point images for image manipulation Mat Aa; A.convertTo(Aa,5); Mat Bb; B.convertTo(Bb,5); Mat Cc; C.convertTo(Cc,5); if ( (!Aa.data) || (!Bb.data) || (!Cc.data) ) { printf("Missing image data \n"); return -1; } //subtract dark field from source image Mat D; D = Aa - Bb; Mat E; E = Cc/D; //save intermediate images imwrite("D.tiff",D); imwrite("E.tiff",E); //save image return 0; } This code compiles fine, and runs, yet it saves no images. If I rewrite the code to work with 16 bit images, it works fine. What's going on? Thanks in advance!

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>