Problems with cvCreateImageHeader

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

Problems with cvCreateImageHeader

dmronga
Hi I have problems with cvCreateImageHeader:

I do the following:

IplImage *image
= cvCreateImageHeader(cvSize(width, height),IPL_DEPTH_8U,1);

When using width = 640 and heigth = 480, there is no problem.

Now we switched to a camera with a resolution of 782x582. When initializing the
image header, OpenCV sets the widthStep to 784, instead of 782. Obviously, the
captured images are of no use like this.

Can anyone tell me why this happens?




Reply | Threaded
Open this post in threaded view
|

Re: Problems with cvCreateImageHeader

Jean-Pierre Landry
If I remember correctly this is by design...
IplImage are always stored with 'widthstep' being a multiple of 4 (for
performance reasons I would guess... )


dmronga wrote:

> Hi I have problems with cvCreateImageHeader:
>
> I do the following:
>
> IplImage *image
> = cvCreateImageHeader(cvSize(width, height),IPL_DEPTH_8U,1);
>
> When using width = 640 and heigth = 480, there is no problem.
>
> Now we switched to a camera with a resolution of 782x582. When initializing the
> image header, OpenCV sets the widthStep to 784, instead of 782. Obviously, the
> captured images are of no use like this.
>
> Can anyone tell me why this happens?
>
>
>
>
>
>
> ------------------------------------
>
> 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]

Reply | Threaded
Open this post in threaded view
|

Re: Problems with cvCreateImageHeader

Robin Hewitt
In reply to this post by dmronga
Why do you say these are "obviously" of no use? Don't you want widthStep to be correct?

- Robin




________________________________
From: dmronga <[hidden email]>
To: [hidden email]
Sent: Fri, February 19, 2010 6:06:10 AM
Subject: [OpenCV] Problems with cvCreateImageHeader

 
Hi I have problems with cvCreateImageHeader :

I do the following:

IplImage *image
= cvCreateImageHeader (cvSize(width, height),IPL_ DEPTH_8U, 1);

When using width = 640 and heigth = 480, there is no problem.

Now we switched to a camera with a resolution of 782x582. When initializing the
image header, OpenCV sets the widthStep to 784, instead of 782. Obviously, the
captured images are of no use like this.

Can anyone tell me why this happens?


 


     

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