View Single Post
  #11   Spotlight this post!  
Unread 04-02-2009, 06:42
yoyodyne yoyodyne is offline
Registered User
AKA: Greg Smith
FRC #0116 (Epsilon Delta)
Team Role: Engineer
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Reston, VA
Posts: 61
yoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to beholdyoyodyne is a splendid one to behold
Re: TrackTwoColors execution time

I agree that the imaq functions are called but I still can't find any information on the format of the image structure and for instance where the storage for the actual image is allocated. By looking at the value of the Image pointer it is clear that the delta between the pointers to different images is not large enough to accomodate the image so it looks like there are subsequent structure members that hold the pointer to the actual image storage area.

Also it is very confusing as to whether you have to call imaqDispose() for each image created or if a single call destroys all images that are currently created. The documentation says that frcDispose disposes all images but the documentation for imaqDispose() talks about just disposing the image associated with the object. Furthermore, the documentation states that frcCreateImage() returns 1 or 0 but that is clearly not the case from debugging the program.

I'm still looking for the definition of the Image structure.

Actually the WIPLIB trackapi.cpp file shows how multiple images can be Disposed of in a single call:


What is interesting to me is how in FindColor the camera image is copied to histImage but histImage is never used?

/* save a copy of the image to another image for color thresholding later */
Image* histImage = frcCreateImage(IMAQ_IMAGE_HSL);
if (!histImage) { frcDispose(cameraImage); return success; }
success = frcCopyImage(histImage,cameraImage);
if ( !success ) {
errorCode = GetLastVisionError();
frcDispose(funcName,cameraImage,histImage,NULL);
return success;
}
Reply With Quote