wholebrain icon indicating copy to clipboard operation
wholebrain copied to clipboard

InterpImg class

Open tractatus opened this issue 7 years ago • 0 comments

Both ThinPlateSPline.cpp and CoherentPointDrift.cpp should contain reference to imwrite class for interpolation from mx and my.

This should be made into its own class possibly called InterpImg()

	Mat displayoutput;
	Mat img8bit;
	Mat displayoutputDST;
	Mat img8bitDST;
	double min, max;
	if(Max>0){
		min = Min;
		max = Max;
	}else{
		minMaxLoc(img, &min, &max);
	}
	img.convertTo(img8bit,CV_8UC1,255.0/(max-min) );
	normalize(img8bit, displayoutput, 0, 255, NORM_MINMAX, CV_8UC1);
	dst.convertTo(img8bitDST,CV_8UC1,255.0/(max-min) );
	normalize(img8bitDST, displayoutputDST, 0, 255, NORM_MINMAX, CV_8UC1);

	string filepath;
    filepath = off + "_undistorted.png";

	imwrite(filepath,displayoutput);
	filepath = off + "_distorted.png";

	imwrite(filepath,displayoutputDST);
	filepath = off + "_undistorted.tif";
    imwrite(filepath,img);
    filepath = off + "_distorted.tif";
	imwrite(filepath,dst);

tractatus avatar Aug 04 '17 23:08 tractatus