USB Kamera via DirectShow ansteuern..



  • Hallo ich bins mal wieder mit noch einem problem bzw möchte ich gerade erstmal ein bischen Aufwand abschätzen.

    Es geht um folgende Kamera http://www.ueye.com/frontend/catalog_detail.php?pID=454&form_KatTable=menue3&form_KatID=6&nav1=25&nav2=59&nav3=6

    Kamera: UI-2240-C

    Diese möchte ich unter windows ansteuern um von der Kamera einzelbilder zu bekommen
    also keinen live-stream sondern lediglich einzelne Bilder.

    jetzt hab ich unter downloads auf der seite ein DirectShow interface mit Headerdatei und zugehöriger dll gefunden
    "WDM/DirectShow Treiber V 1.03.07"

    hier mal die Headerdatei

    //The uEye Capture Device Filter supports a range of standard interfaces.
    //These interfaces are:
    // The Filter exposes:		IAMVideoProcAmp
    //							IAMVideoControl
    //							IAMDroppedFrames
    //							IAMFilterMiscFlags
    //							IKsPropertySet
    //							IuEyeCapture		-specific uEye interface
    //							ISpecifyPropertyPages
    // The Capture Pin exposes:	IAMCameraControl
    //							IKsPropertySet
    //							IAMStreamConfig
    //							IuEyeCapturePin		-specific uEye interface
    //							ISpecifyPropertyPages
    //Some functionalities of the cameras are not mentioned in this standards.
    //Therefore this file defines two additional interfaces, providing control
    //over the missing features.
    #include <initguid.h>
    
    // {67030826-2EE0-44e7-BE1A-6A3BDB5B47FE}
    DEFINE_GUID(IID_IuEyeCapturePin, 
    0x67030826, 0x2ee0, 0x44e7, 0xbe, 0x1a, 0x6a, 0x3b, 0xdb, 0x5b, 0x47, 0xfe);
    
    // ============================================================================
    // uEye Capture Pin Interface
    // Interface for extra functionality on the uEye Capture Device Pin
    // It controls mainly the Pixelclock settings for sensor read in
    // ============================================================================
    interface IuEyeCapturePin : public IUnknown
    {
    	//Returns the sum (in MHz) of pixelclocks for all connected cameras in the lClock parameter
    	STDMETHOD(GetUsedBandwith)(long *lClock) = 0;
    
    	//Returns the pixelclock for the connected camer in the lClock parameter
        STDMETHOD(GetPixelClock)(long *lClock) = 0;
    
    	//Returns the min, max and default value for the Pixelclock of the connected camera
        STDMETHOD(GetPixelClockRange)(long *lMin, long *lMax, long *lDefault) = 0;
    
    	//Sets the Pixelclock (in Mhz) for the connected device
        STDMETHOD(SetPixelClock)(long lClock) = 0;
    
    	//OBSOLETE function
        STDMETHOD(GetRGB8ColorMode)(long *lMode) = 0;
    
    	//OBSOLETE function
        STDMETHOD(SetRGB8ColorMode)(long lMode) = 0;
    
    	//Gets the actual min max and interval values for exposure time
    	STDMETHOD(GetExposureRange)(long *lMinExp, long *lMaxExp, long *lInterval) = 0;
    
    	//Gets the actual Exposure Time, multiplied by 1000
        STDMETHOD(GetExposureTime)(long *lExp ) = 0;
    
    	//Sets the Exposure Time, more finer than the IAMCameraControl Interface function can do (2^n vs )
    	// the parameter is divided by 1000.
        STDMETHOD(SetExposureTime)(long lExp) = 0;
    };
    
    // {7BDFA675-E6BF-449e-8349-5F62AE9E0023}
    DEFINE_GUID(IID_IuEyeCapture, 
    0x7bdfa675, 0xe6bf, 0x449e, 0x83, 0x49, 0x5f, 0x62, 0xae, 0x9e, 0x0, 0x23);
    
    //structs needed by some functions
    /*
    #ifdef CAMERAINFO
      #undef CAMERAINFO
    #endif
    typedef struct
    {
      char          SerNo[12];    // e.g. "1234501234"  (11 char)
      char          ID[20];       // e.g. "IDS GmbH"
      char          Version[10];  // e.g. "V1.00"  (9 char)
      char          Date[12];     // e.g "11.11.1999" (11 char)
      unsigned char Select;       // 0 (contains board select number for multi board support)
      unsigned char Type;         // 1 (contains board type)
      char          Reserved[8];  // (7 char)
    } CAMERAINFO, *PCAMERAINFO;
    
    #ifdef _SENSORINFO
      #undef _SENSORINFO
    #endif
    #ifdef SENSORINFO
      #undef SENSORINFO
    #endif
    typedef struct _SENSORINFO
    {
      WORD          SensorID;           // e.g. IS_SENSOR_UI121X_C
      char          strSensorName[32];  // e.g. "UI-121X-C"
      char          nColorMode;         // e.g. IS_COLORMODE_BAYER
      DWORD         nMaxWidth;          // e.g. 1280
      DWORD         nMaxHeight;         // e.g. 1024
      BOOL          bMasterGain;        // e.g. FALSE
      BOOL          bRGain;             // e.g. TRUE
      BOOL          bGGain;             // e.g. TRUE
      BOOL          bBGain;             // e.g. TRUE
      BOOL          bGlobShutter;       // e.g. TRUE
      char			Reserved[16];		// not used
    } SENSORINFO, *PSENSORINFO;
    */
    // ============================================================================
    // uEye Capture Interface
    // Interface for extra functionality on the uEye Capture Device Filter
    // It adds functions for listing and connecting other cameras
    // Support for Badpixel and Whitebalance Control are also supplied
    // ============================================================================
    interface IuEyeCapture : public IUnknown
    {
    	//Returns the actual multipliers for whitebalance as a long integer.
    	//Divide by hundred for the correct factors
        STDMETHOD(GetWhiteBalanceMultipliers)(long *lRed, long *lGreen, long *lBlue) = 0;
    
    	//Sets the factors for whitebalance. Values are multiplied by 100
        STDMETHOD(SetWhiteBalanceMultipliers)(long lRed, long lGreen, long lBlue) = 0;
    
    	//Returns the number of connected camera devices in the lNr parameter
    	STDMETHOD(GetNumberOfCameras)(long *lNr) = 0;
    	//Returns the device info for the connected camera as a pair of CAMERAINFO and SENSORINFO
    	STDMETHOD(GetDeviceInfo)(SENSORINFO *sInfo, CAMERAINFO *cInfo) = 0;
    
    	//Returns the version of underlying uEye Driver files
    	STDMETHOD(GetDLLVersion)(long *version) = 0;
    
    	// obsolete function
    	STDMETHOD(GetListOfCameras)(CAMERAINFO **cInfo, SENSORINFO **sInfo, long *lNr) = 0;
    
    	// obsolete function
    	STDMETHOD(ConnectToCamera)(long lIndex) = 0;
    
    	//Activates or deactivates the BadPixelCorrection, set 1 to activate, 0 to deactivate
    	STDMETHOD(SetBadPixelCorrection)(long lEn) = 0;
    
    	//Returns the actual state of BadPixelCorrection in the lEn parameter
    	STDMETHOD(GetBadPixelCorrection)(long *lEn) = 0;
    
    	//Loads previous stored camera settings
    	STDMETHOD(LoadSettings)(void) = 0;
    
    	//Stores the current set camera settings in the registry.
    	//Data will be stored individual for each uEye UI model (e.g. UI1410-C)
    	STDMETHOD(SaveSettings)(void) = 0;
    
    	//Resets the camera to the driver defaults.
    	STDMETHOD(ResetDefaults)(void) = 0;
    };
    

    jedoch wie ich das sehe sind das alles nur initialisierungs funktionen, aber keine mit denen ich auf die Bilder der Kamera zugreifen kann

    so und nun meine Fragen:
    kann ich auf die Kamera mittels Windows DirectShow funktionen zugreifen?
    wenn ja hat jemand dazu ein tutorial oder nen tip hab noch nie mit DirectShow gearbeitet..

    gruß Dominik



  • schon mal in erwaegung gezogen, eins der beispiele im sdk anzuschauen?



  • du glaubst gar nicht wie oft ich schon auf der seite geladet bin

    aber ich find das beispiel nicht .. das war nicht in meinem sdk directory..
    kann das sein das ich da noch einen zusatzt brauch ich hab nämlich überhaupt keine directshow examples !!

    Nachtrag
    ok jetzt hab ich die examples .. hatte irgendwie ne komische version



  • Hi,

    ich muss nochmal das Thema hier rauskramen!

    Brauche ich für die Exampels die Dateien von

    http://www.microsoft.com/downloads/details.aspx?FamilyID=C72D9F1E-53F3-4747-8490-6801D8E8B4EF&displaylang=en

    Will nämlich nicht die 500MB runterladen, wenn dann keine Beispiele drin sind! 😉



  • Naja, habs jetzt doch einfach mal runtergeladen.

    Leider läuft es nicht unter Windows 2000. 😞

    Gibt es das auch für Win 2000? Ich kann auf der MSDN Homepage leider nichts finden...


Anmelden zum Antworten