In the Learning OpenCV book:
.
.
CvCapture *capture = cvCreateFileCapture(argv[1]);
IplImage* frame;
while(1)
{
frame = cvQueryFrame(capture);
.
.
}
Here, we can see that *frame is a pointer. But, when we write the following frame = cvQueryFrame(capture);, we are not assigning an address to the pointer. What exactly will the values be that frame will hold in this case?
Thanks.
frameis pointer to an object of typeIplImage. Presumably, thecvQueryFrame()function allocates anIplImageobject and returns the address of this object. The statementassigns the value of this returned pointer to
frame. If indeed the function is allocating a new object you’ll probably be required to free this memory later by callingoperator deleteor some function likeAlso the statement you make at the end of your question (“
*frameis a pointer”) is not accurate –frameis a pointer;*framemeans you’re de-referencing the pointer which makes its typeIplImage.