Discussion:
Null pointer (NULL array pointer is passed) in function cvGetMat C:\...\cxarray
aneuryzma
2008-06-15 12:22:28 UTC
Permalink
Hi,

this is my code:

IplImage *image = 0;

...

if( !image ) {
image = cvCreateImage( cvGetSize(frame), 8, 3 );
image->origin = frame->origin;

}

myMethod(image);

cvShowImage( "CamShiftDemo", image );

...


Why do I receive this error ? I'm just passing the pointer image by
reference.. when myMethod finishes, I should have the same pointer to
the modified image instead it is NULL.. ?


------------------------------------

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-***@yahoogroups.com
Lim Yeen Fei
2008-06-16 01:07:01 UTC
Permalink
well looks like you forgot to post 'myMethod'... probably porblem
with it.... try use ptr of ptr instead if you plan to deallocate and
do data manipulation inside the function.
Post by aneuryzma
Hi,
IplImage *image = 0;
...
if( !image ) {
image = cvCreateImage( cvGetSize(frame), 8, 3 );
image->origin = frame->origin;
}
myMethod(image);
cvShowImage( "CamShiftDemo", image );
...
Why do I receive this error ? I'm just passing the pointer image by
reference.. when myMethod finishes, I should have the same pointer to
the modified image instead it is NULL.. ?
------------------------------------

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-***@yahoogroups.com
aneuryzma
2008-06-18 09:42:05 UTC
Permalink
do you mean a pointer to a pointer ?
Post by Lim Yeen Fei
well looks like you forgot to post 'myMethod'... probably porblem
with it.... try use ptr of ptr instead if you plan to deallocate and
do data manipulation inside the function.
Post by aneuryzma
Hi,
IplImage *image = 0;
...
if( !image ) {
image = cvCreateImage( cvGetSize(frame), 8, 3 );
image->origin = frame->origin;
}
myMethod(image);
cvShowImage( "CamShiftDemo", image );
...
Why do I receive this error ? I'm just passing the pointer image by
reference.. when myMethod finishes, I should have the same pointer
to
Post by aneuryzma
the modified image instead it is NULL.. ?
------------------------------------

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-***@yahoogroups.com
Lim Yeen Fei
2008-06-20 00:27:21 UTC
Permalink
-yes
its something like IplImage** ppImg;
Post by aneuryzma
do you mean a pointer to a pointer ?
Post by Lim Yeen Fei
well looks like you forgot to post 'myMethod'... probably porblem
with it.... try use ptr of ptr instead if you plan to deallocate and
do data manipulation inside the function.
Post by aneuryzma
Hi,
IplImage *image = 0;
...
if( !image ) {
image = cvCreateImage( cvGetSize(frame), 8, 3 );
image->origin = frame->origin;
}
myMethod(image);
cvShowImage( "CamShiftDemo", image );
...
Why do I receive this error ? I'm just passing the pointer
image by
Post by aneuryzma
Post by Lim Yeen Fei
Post by aneuryzma
reference.. when myMethod finishes, I should have the same
pointer
Post by aneuryzma
Post by Lim Yeen Fei
to
Post by aneuryzma
the modified image instead it is NULL.. ?
------------------------------------

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-***@yahoogroups.com
jose_h_c
2011-12-19 18:04:14 UTC
Permalink
Hi,
I'm running an OpenCV app, and I get this same message:

OpenCV GUI Error Handler

Null pointer (NULL array pointer is passed) in function cvGetMat, .\cxarray.cpp(2780)

How can I fix this?? PLEASE HELP ME! I've been working on this 24/7 for the past 2 weeks

Thanks



------------------------------------

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-***@yahoogroups.com
Guilherme Orlandini
2011-12-20 23:03:35 UTC
Permalink
Generaly, this problem is related to wrong path of image, or error in the
name of image.....can you post your code?
guilherme_orlandini
2011-12-21 14:36:27 UTC
Permalink
But, only with this code I didn´t unterstand what happen.

what you want do? capture imagem from webcam? And the variable frame, where it´s from?
Post by aneuryzma
Hi,
IplImage *image = 0;
...
if( !image ) {
image = cvCreateImage( cvGetSize(frame), 8, 3 );
image->origin = frame->origin;
}
myMethod(image);
cvShowImage( "CamShiftDemo", image );
...
Why do I receive this error ? I'm just passing the pointer image by
reference.. when myMethod finishes, I should have the same pointer to
the modified image instead it is NULL.. ?
------------------------------------

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-***@yahoogroups.com
Loading...