This is very simple code, But don't know where it Went wrong,where i covert Image from 8 to 32
Same thread as like this
How to convert an 8-bit OpenCV IplImage* to a 32-bit IplImage*?
char * InputImagePath = "E:\\Inp\\lg1.jpg";
IplImage* ImageIn = cvLoadImage(InputImagePath,1);
IplImage *img32 = cvCreateImage(cvGetSize(ImageIn), 32 , 3);
cvConvertScale(ImageIn,img32,1/255.);
cvSaveImage("E:\\Inp\\zzout.jpg",img32);
Output : zzout.jpg is saved in my local hard disk but its empty ( blank image )
Please help me out from this.. fedup with this simple issue
In the case you are stuck on the old OpenCV here is a more complete answer:
As I can see, Pixel, you are operating on JPEGs which means, you will need to handle either 8 bit (Grayscale) or 24 bit (BGR) input.
Here is the code you need:
if (inputImage->nChannels == 1)
{
cvCvtColor(inputImage, image24bit, CV_GRAY2BGR);
}
else
{
cvCopy(inputImage, image24bit, NULL);
}