000
28.11.2007, 13:42 Uhr
~abrissbirne
Gast
|
Hallo, ich habe gerade versucht ein Programmbeispiel von Matrox (Matrox Imaging Library) nachzuprogrammieren. Bei folgendem Quellcode bekomme ich die angesprochene Fehlermeldung:
C++: |
/* Regular includes. */ #include <stdio.h> #include <mil.h> #include <stdlib.h> /* Lens characteristics */ #define FOCUS_MAX_NB_POSITIONS 256 #define FOCUS_MIN_POSITION 0 #define FOCUS_MAX_POSITION 255 #define FOCUS_START_POSITION 0 /* Autofocus search properties */ #define FOCUS_MAX_POSITION_VARIATION 32 #define FOCUS_MODE M_SMART_SCAN #define FOCUS_SENSITIVITY 1 /* Autofocus hook function that is responsible to move the lens */ long MFTYPE MoveLensFunction(long HookType, long position, void MPTYPE *UserDataPtr); /* Main application function */ /****************************************************************/ void main(void) { MIL_ID MilApplication, /* Application identifier. */ MilSystem, /* System identifier. */ MilDisplay, /* Display identifier. */ MilDigitizer, /* Digitizer identifier. */ MilImage; /* Image buffer identifier. */ long FocusPos; /* Best focus position */ /* Allocate defaults */ MappAllocDefault(M_SETUP, &MilApplication, &MilSystem, &MilDisplay, &MilDigitizer, &MilImage); /* Grab continuously. */ MdigGrabContinuous(MilDigitizer, MilImage); /* Pause to show the original image. */ printf("An autofocus operation will be performed.\n"); printf("Press <Enter> to continue.\n"); getchar(); printf("Autofocusing...\n"); /* Perform autofocus by calling the MoveLensFunction iteratively */ MdigFocus (MilDigitizer, MilImage, M_DEFAULT, MoveLensFunction, M_NULL, FOCUS_MIN_POSITION, FOCUS_START_POSITION, FOCUS_MAX_POSITION, FOCUS_MAX_POSITION_VARIATION, FOCUS_MODE + FOCUS_SENSITIVITY, &FocusPos); /* Print the best focus position and number of iterations*/ printf("The best focus position is %d.\n", FocusPos); 32 Camera auto-focus (continued) printf("Press <Enter> to end.\n"); getchar(); /* Free all allocations */ MappFreeDefault(MilApplication, MilSystem, MilDisplay, MilDigitizer, MilImage); } /* Autofocus hook function that is responsible to move the lens */ /****************************************************************/ long MFTYPE MoveLensFunction(long HookType, long position, void MPTYPE *UserDataPtr) { /* If focus position must be changed */ if(HookType == M_CHANGE) { /* Move the camera lens to the specified position using the appropriate interface (e.g. serial port). */ MoveLens(position);//<< hier } return 0; }
|
Er meckert folgendermaßen: c:...focus image.cpp(71) : error C3861: 'MoveLens': identifier not found Dabei mach ich einfach nix anderes als das Programmbeispiel. |