cvShowImage Help

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

cvShowImage Help

Xue1
Dose any one know how  cvShowImage function convert double or float data to be displayed as image (i.e.  unsigned char)?
 
example
 
 CvMat *dct;
 dct = cvCreateMat(image->width, image->height, CV_64FC1);
 cvShowImage("Output", dct);  (it work correctly)
 
but if I convert data manually like this
  Image->imageData[Image->widthStep * y + x]=(unsigned char) cvmGet(dct,y,x);
  cvShowImage("Output", Image);
 
the result is a black image
 
I appricate you help
 


     

[Non-text portions of this message have been removed]

Reply | Threaded
Open this post in threaded view
|

Re: cvShowImage Help

Jean-Pierre Landry
You should try to assess the image minimum and maximum value and scale
it accordingly...

See  cvMinMaxLoc and cvConvertScale...


Xue wrote:

> Dose any one know how  cvShowImage function convert double or float data to be displayed as image (i.e.  unsigned char)?
>  
> example
>  
>  CvMat *dct;
>  dct = cvCreateMat(image->width, image->height, CV_64FC1);
>  cvShowImage("Output", dct);  (it work correctly)
>  
> but if I convert data manually like this
>   Image->imageData[Image->widthStep * y + x]=(unsigned char) cvmGet(dct,y,x);
>   cvShowImage("Output", Image);
>  
> the result is a black image
>  
> I appricate you help
>  
>
>
>      
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> 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 [hidden email]