Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Finished example (first version)

  • Loading branch information...
commit 9d3614dd9539d3a72e125c56576c4d51a129cb6b 1 parent 53daba5
@paulobarcelos authored
View
16 example/bin/data/uEye.xml
@@ -0,0 +1,16 @@
+<uEye>
+ <Is_Live>1</Is_Live>
+ <Pixel_Clock>68</Pixel_Clock>
+ <FPS>22.5511</FPS>
+ <Bad_pixels_correction>1</Bad_pixels_correction>
+ <Auto_Exposure>0</Auto_Exposure>
+ <Exposure>44.2903</Exposure>
+ <Auto_WB>0</Auto_WB>
+ <Auto_Gain>0</Auto_Gain>
+ <Master_Gain>100</Master_Gain>
+ <Red_Gain>11</Red_Gain>
+ <Green_Gain>13</Green_Gain>
+ <Blue_Gain>45</Blue_Gain>
+ <Color_Saturation>131</Color_Saturation>
+ <Color_Correction>0</Color_Correction>
+</uEye>
View
4 example/src/testApp.cpp
@@ -2,8 +2,6 @@
//--------------------------------------------------------------
void testApp::setup(){
- ofxXmlSettings test;
- test.saveFile("cu");
ofSetVerticalSync(true);
ofAddListener(ueye.events.dimensionChanged, this, &testApp::ueyeDimensionChanged);
@@ -14,7 +12,7 @@ void testApp::setup(){
{
//cout << (IS_BINNING_8X_VERTICAL | IS_BINNING_8X_HORIZONTAL) << endl;
// Get full area of the sensor, but skipping every second pixel
- ueye.setBinning(IS_BINNING_4X_VERTICAL | IS_BINNING_4X_HORIZONTAL); // difference from subsamplimg? (apparently same bandwith but smoother image)
+ ueye.setBinning(IS_BINNING_2X_VERTICAL | IS_BINNING_2X_HORIZONTAL); // difference from subsamplimg? (apparently same bandwith but smoother image)
// smooth the bad pixels (apparently they come from factory with bad pixels...)
//ueye.enableBadPixelsCorrection();
View
5 src/ofxUeye.h
@@ -94,8 +94,9 @@ class ofxUeye{
// White Balance -----------------------------------------
void setAutoWhiteBalance(bool value = true){if (value) enableAutoWhiteBalance(); else disableAutoWhiteBalance();};
- int enableAutoWhiteBalance(){double e = WB_MODE_AUTO; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_SENSOR_WHITEBALANCE, &e, 0);};
- int disableAutoWhiteBalance(){double e = WB_MODE_DISABLE; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_SENSOR_WHITEBALANCE, &e, 0);};
+ inline bool isWhiteBalanceAuto(){double e ; is_SetAutoParameter (m_hCam, IS_GET_ENABLE_AUTO_SENSOR_WHITEBALANCE, &e, 0); return (e == 1.0)?true:false;};
+ inline int enableAutoWhiteBalance(){double e = WB_MODE_AUTO; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_SENSOR_WHITEBALANCE, &e, 0);};
+ inline int disableAutoWhiteBalance(){double e = WB_MODE_DISABLE; return is_SetAutoParameter (m_hCam, IS_SET_ENABLE_AUTO_SENSOR_WHITEBALANCE, &e, 0);};
// Gain -------------------------------------------
void setAutoGain(bool value = true){if (value) enableAutoGain(); else disableAutoGain();};
View
99 src/ofxUeyeSettings.cpp
@@ -17,13 +17,6 @@ ofxUeyeSettings::ofxUeyeSettings()
ueye = NULL;
}
///////////////////////////////////////////////////////////////////////////////////
-// Destructor --------------------------------------------------------------------
-///////////////////////////////////////////////////////////////////////////////////
-ofxUeyeSettings::~ofxUeyeSettings()
-{
- if(ueye != NULL) delete ueye;
-}
-///////////////////////////////////////////////////////////////////////////////////
// setup --------------------------------------------------------------------------
///////////////////////////////////////////////////////////////////////////////////
void ofxUeyeSettings::setup(ofxUeye* ueye, int accessKey, string label)
@@ -31,11 +24,11 @@ void ofxUeyeSettings::setup(ofxUeye* ueye, int accessKey, string label)
this->ueye = ueye;
settings.setup(accessKey, label);
- /*settings.addMonitor(ueye, &ofxUeye::getBandwidth, "Bandwidth");
+ settings.addMonitor(ueye, &ofxUeye::getBandwidth, "Bandwidth");
settings.addMonitor(ueye, &ofxUeye::getSensorWidth, "Sensor_Width");
settings.addMonitor(ueye, &ofxUeye::getSensorHeight, "Sensor_Height");
settings.addMonitor(ueye, &ofxUeye::getWidth, "AOI_Width");
- settings.addMonitor(ueye, &ofxUeye::getHeight, "AOI_Height");*/
+ settings.addMonitor(ueye, &ofxUeye::getHeight, "AOI_Height");
settings.addProperty(ueye, &ofxUeye::isLive,
ueye, &ofxUeye::setLive,
@@ -62,22 +55,78 @@ void ofxUeyeSettings::setup(ofxUeye* ueye, int accessKey, string label)
ueye, &ofxUeye::setBadPixelsCorrection,
"Bad_pixels_correction",
true);
-
- /*settings.addProperty(cm, &ColorsOfMovement::getNumStoredFrames,
- cm, &ColorsOfMovement::setNumStoredFrames,
- "Number_of_stored_frames",
- cm, &ColorsOfMovement::getNumStoredFramesMin,
- cm, &ColorsOfMovement::getNumStoredFramesMax,
- cm, &ColorsOfMovement::getNumStoredFramesStep,
- CM_DEFAULT_NUM_STORED_FRAMES);
-
- settings.addProperty(cm, &ColorsOfMovement::getMode,
- cm, &ColorsOfMovement::setMode,
- "Mode",
- cm, &ColorsOfMovement::getModeMin,
- cm, &ColorsOfMovement::getModeMax,
- cm, &ColorsOfMovement::getModeStep,
- (int)CM_DEFAULT_MODE);*/
+
+ settings.addProperty(ueye, &ofxUeye::isExposureTimeAuto,
+ ueye, &ofxUeye::setAutoExposureTime,
+ "Auto_Exposure",
+ false);
+
+ settings.addProperty(ueye, &ofxUeye::getExposureTime,
+ ueye, &ofxUeye::setExposureTime,
+ "Exposure",
+ ueye, &ofxUeye::getExposureTimeMin,
+ ueye, &ofxUeye::getExposureTimeMax,
+ ueye, &ofxUeye::getExposureTimeStep,
+ ueye->getFPSMax());
+
+ /*settings.addProperty(ueye, &ofxUeye::isWhiteBalanceAuto,
+ ueye, &ofxUeye::setAutoWhiteBalance,
+ "Auto_WB",
+ false);*/
+
+ settings.addProperty(ueye, &ofxUeye::isGainAuto,
+ ueye, &ofxUeye::setAutoGain,
+ "Auto_Gain",
+ false);
+
+ settings.addProperty(ueye, &ofxUeye::getGainMaster,
+ ueye, &ofxUeye::setGainMaster,
+ "Master_Gain",
+ ueye, &ofxUeye::getGainMasterMin,
+ ueye, &ofxUeye::getGainMasterMax,
+ ueye, &ofxUeye::getGainMasterStep,
+ ueye->getGainMasterMax());
+
+ settings.addProperty(ueye, &ofxUeye::getGainRed,
+ ueye, &ofxUeye::setGainRed,
+ "Red_Gain",
+ ueye, &ofxUeye::getGainRedMin,
+ ueye, &ofxUeye::getGainRedMax,
+ ueye, &ofxUeye::getGainRedStep,
+ ueye->getGainRedMax());
+
+ settings.addProperty(ueye, &ofxUeye::getGainGreen,
+ ueye, &ofxUeye::setGainGreen,
+ "Green_Gain",
+ ueye, &ofxUeye::getGainGreenMin,
+ ueye, &ofxUeye::getGainGreenMax,
+ ueye, &ofxUeye::getGainGreenStep,
+ ueye->getGainGreenMax());
+
+ settings.addProperty(ueye, &ofxUeye::getGainBlue,
+ ueye, &ofxUeye::setGainBlue,
+ "Blue_Gain",
+ ueye, &ofxUeye::getGainBlueMin,
+ ueye, &ofxUeye::getGainBlueMax,
+ ueye, &ofxUeye::getGainBlueStep,
+ ueye->getGainBlueMax());
+
+ settings.addProperty(ueye, &ofxUeye::getColorSaturation,
+ ueye, &ofxUeye::setColorSaturation,
+ "Color_Saturation",
+ ueye, &ofxUeye::getColorSaturationMin,
+ ueye, &ofxUeye::getColorSaturationMax,
+ ueye, &ofxUeye::getColorSaturationStep,
+ ueye->getColorSaturationMax());
+
+ settings.addProperty(ueye, &ofxUeye::getColorCorrection,
+ ueye, &ofxUeye::setColorCorrection,
+ "Color_Correction",
+ ueye, &ofxUeye::getColorCorrectionMin,
+ ueye, &ofxUeye::getColorCorrectionMax,
+ ueye, &ofxUeye::getColorCorrectionStep,
+ ueye->getColorCorrectionMax());
+
}
///////////////////////////////////////////////////////////////////////////////////
// keyPressed ---------------------------------------------------------------------
View
8 src/ofxUeyeSettings.h
@@ -14,6 +14,7 @@
#include "ofxUeye.h"
#include "ofxKeyboardSettings.h"
+
////////////////////////////////////////////////////////////
// CLASS DEFINITION ----------------------------------------
////////////////////////////////////////////////////////////
@@ -21,10 +22,9 @@ class ofxUeyeSettings {
public:
ofxUeyeSettings();
- ~ofxUeyeSettings();
- void setup(ofxUeye* ueye, int accessKey = 'u', string label = "uEye");
- void keyPressed(int key);
- void draw(float x, float y);
+ void setup(ofxUeye* ueye, int accessKey = 'u', string label = "uEye");
+ void keyPressed(int key);
+ void draw(float x, float y);
private:
Please sign in to comment.
Something went wrong with that request. Please try again.