logo       

Simple Question: Converting image from 8 bit to 32 bit: msg#00677

lib.opencv

Subject: Simple Question: Converting image from 8 bit to 32 bit

How to convert a single channel image of 8 bits to 32 bits?

I have one single channel 8 bit image like this:
IplImage *uImg = cvCreateImage( cvSize( 300, 300 ), IPL_DEPTH_8U, 1 );
and One single channel 32 Bit floating point image like this:
IplImage *fImg = cvCreateImage( cvSize( 300, 300 ), IPL_DEPTH_32F, 1 );

Now, how to convert that 8 bit uImg to 32 bit fImg?
Please help me with this one. I am stuck for 5 days!

I tried pixel by pixel copy like this:
---------------------------------------------------------------------
for (int i = 0; i < mean->width; i++ ){
for (int j = 0; j < mean->height; j++ ) {
CV_IMAGE_ELEM(fImg, float, j, i) =
CV_IMAGE_ELEM(uImg, uchar, j, i) =
}
}
---------------------------------------------------------------------
But the output is only a blank image.
I also tried widthStep instead of width, but the same result.

Please someone help me!!!!

Thank You very much,
Paramesh.





Change settings: http://www.yahoogroups.com/mygroups, select
Get Emails (get all posts)
Daily Digest (one summary email per day)
Read on the web (read posts on the web only)Or Unsubscribe by mailing
OpenCV-unsubscribe@xxxxxxxxxxxxxxx



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise