tags:

views:

153

answers:

1

I am running the simple code below and expecting the depth of o to become 32. But it still remains 8. Am I missing something ???

  IplImage *o = cvCreateImage(cvSize(100,100), 8,1);
  IplImage *n = cvCreateImage(cvSize(100,100), 32,1);

  cvConvertScale(o,n,1.0,0.0);

  printf("The depth of o is %d\n", o->depth);
  printf("The depth of n is %d\n", n->depth); 
A: 

ALright, the behavior correct. The datatype in the source image is not converted into the datatype of the destination.

Just that the source is multiplied with the scaling constant and cast into the type of the destination, and stores the result in the destination.

So there is no change in the types of either the source or the destination. Just the data in the destination changes for a scaling constant other than 1.0

Geeta V