Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

imgSessionFitROI

I am trying to use the imgSessionFitROI function from the IMAQ C library but when i use it my values for fitTop, fitLeft, fitHeight, fitWidth are all returned as 0.

The prototype of the function is :

imgSessionFitROI(SESSION_ID boardid, IMG_ROI_FIT_MODE fitMode, uInt32 top, uInt32 left, uInt32 height, uInt32 width, uInt32* fittedTop, uInt32* fittedLeft, uInt32* fittedHeight, uInt32* fittedWidth);

and my code to interact with it is:

imgSessionFitROI(*Sid, IMG_ROI_FIT_LARGER, *top, *left, *height, *width, &fitTop, &fitLeft, &fitHeight, &fitWidth);

where Sid, top, left, height, width are pre-existing pointers
and fitTop, fitLeft, fitHeight, fitWidth are just variables

if i try to change the level of indirection of any of the values (such as instead of *top i use just top) I get:

warning C4047: 'function' : 'uInt32' differs in levels of indirection from 'uInt32 *'
warning C4024: 'imgSessionFitROI' : different types for formal and actual parameter 3


Does anyone have any ideas about what I am doing wrong?

Thanks
0 Kudos
Message 1 of 2
(3,137 Views)
HI Chico1st,
Are you getting any errors when it returns all zeroes for your dimensions, or does it appear to exit OK (with a return code of 0)?

What values are you trying to set for top, left, height, and width in the FitROI function? Also, if you use the imgSessionGetROI() function before doing this, does it return all zeros as well?
0 Kudos
Message 2 of 2
(3,109 Views)