views:

80

answers:

1

A single channel image is my input. ( defalut IPL_DEPTH_8U)

I am multiplying each pixel of my input image with scalar floating point numbers like 2.8085 (as a part of my algorithm).

So this needs me to increase the depth and change the image type to IPL_DEPTH_64F

But whenever I am trying to change my image datatype to IPL_DEPTH_64F and have a double* to access each pixel, my program execution stops abruptly, cribbing that "file.exe has stopped working. A problem caused the program to stop working."

Does it mean, my processor is not able to handle the double ptr arithmetic ???

+1  A: 

You have to create a new image - I'd recommend making a new image of depth IPL_DEPTH_64F and setting each pixel to the appropriate value (2.8085*value).

Also, can you post the code you used?

Jacob
U were right. It was easier to create a new image of 64depth and then do a cvconvertscale rather than pointer typecasting.
Geeta V
Pointer typecasting would not have worked since the memory allocated would've been `sizeof(uchar)*heigh*width` for `IPL_DEPTH_8U`
Jacob