//and then get IplImage.
ipimage-& gt; ImageData is an unsigned character.
Then use type conversion.
(unsigned int *)(IPL image-& gt; Image data)