AURobotServers
4
|
#include <ufuncstereo.h>
Public Member Functions | |
virtual void | callGotNewDataWithObject () |
virtual void | createResources () |
virtual bool | handleCommand (UServerInMsg *msg, void *extra) |
UFuncStereo () | |
~UFuncStereo () | |
Public Member Functions inherited from UFuncPlugBasePush | |
virtual bool | setResource (UResBase *resource, bool remove) |
UFuncPlugBasePush () | |
virtual | ~UFuncPlugBasePush () |
Public Member Functions inherited from UFunctionBase | |
bool | addResource (UResBase *resource, UFunctionBase *owner) |
void | closeLogfile () |
virtual const char * | commandList () |
const char * | getAliasName () |
const char * | getLoadedFileName () |
void * | getLoadedModuleRef () |
virtual bool | gotAllResources (char *missingThese, int missingTheseCnt) |
bool | isMine (const char *cmdName) |
bool | isStatic () |
is the module loaded as static A module is static if the ldFilename has a length of zero. More... | |
virtual const char * | name () |
bool | newCmd (UServerInMsg *newMsg, UDataBase *extra) |
bool | newCommand (UServerInMsg *newMsg, void *extra) |
bool | openLogfile (const char *name) |
void | print (const char *preString) |
virtual void | resourceUpdated () |
bool | sendEndTag (UServerInMsg *msg) |
bool | sendEndTag () |
bool | sendFullTag (const char *attributes) |
bool | sendHelpDone (UServerInMsg *msg) |
bool | sendHelpDone () |
bool | sendHelpStart (UServerInMsg *msg, const char *subject) |
bool | sendHelpStart (const char *subject) |
bool | sendHelpStart () |
bool | sendMsg (UServerInMsg *msg, const char *message, int size) |
bool | sendMsg (const char *message) |
bool | sendMsg (UServerInMsg *msg, const char *message) |
bool | sendMsg (int clientIdx, const char *message, int size) |
bool | sendMsgInt (int clientIdx, const char *message) |
bool | sendStartTag (const char *attributes) |
bool | sendText (UServerInMsg *msg, const char *text) |
bool | sendText (const char *text) |
virtual void | setAliasName (const char *name) |
virtual void | setCommand (const char *cmdList, const char *name, const char *note) |
void | setLoadedModuleRef (void *module, const char *moduleFileName) |
virtual void | setLoadTime (UTime) |
void | setName (const char *name) |
void | setVerbose (bool value) |
UFunctionBase () | |
virtual | ~UFunctionBase () |
Public Member Functions inherited from UCallBack | |
bool | addOnEvent (UOnEvent *dataObject) |
virtual bool | onEvent (const char *interface, const char *dataType, void *data) |
UCallBack () | |
virtual | ~UCallBack () |
Public Member Functions inherited from UResVarPool | |
int | addMethod (const char *formalName, const char *paramTypes, const char *comment) |
int | addMethodV (const char *formalName, const char *paramTypes, const char *comment) |
UVarPool * | addStruct (const char *name, const char *comment, bool copy=false) |
UVariable * | addVar (const char *name, const double initialValue, const char *type, const char *comment) |
UVariable * | addVar (const char *name, const char *initialValue, const char *type, const char *comment) |
UVariable * | addVarA (const char *name, const char *initialValue, const char *type, const char *comment) |
bool | callGlobal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt) |
bool | callGlobalV (const char *name, const char *paramOrder, UVariable **params, UDataBase **returnStruct, int *returnStructCnt) |
Call a method from the root var pool scope It may be in the structure direct (no '.') or in any sub-structure that the 'name.subname' indicate. More... | |
bool | callLocal (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct, int *returnStructCnt) |
bool | callVS (const char *function, const char *stringParam) |
int | callVSCD (const char *function, const char *strPar, UDataBase *data, int cooSys) |
void | createBaseVar () |
virtual bool | createVarSpace (const int varCnt, const int structCnt, const int methCnt, const char *note, bool copy=false) |
bool | getGlobalString (const char *name, const char **value) |
bool | getGlobalValue (const char *name, double *value) |
bool | getGlobalValue (const char *name, const char **value) |
bool | getGlobalValue (const char *name, bool *value) |
bool | getGlobalValue (const char *name, UTime *value) |
bool | getLocalValue (const char *name, double *value) |
get a value in this variable tree More... | |
bool | getLocalValue (const char *name, bool *value) |
bool | getLocalValue (const char *name, UTime *value) |
double | getLocalValue (int idx) |
UPosition | getLocalValue3D (int idx) |
UPosRot | getLocalValue6D (int idx) |
bool | getLocalValueBool (int idx) |
int | getLocalValueInt (int idx) |
UTime | getLocalValueTime (int idx) |
const char * | getLogFileName () |
const char * | getVarDescription (int idx) |
UVarCalc * | getVarPool () |
bool | isLogFileOpen () |
bool | isLogFileOpen (const char *structName) |
bool | isVarPoolUpdated (int lastCnt, int *newCnt) |
void | logFileClose () |
bool | logFileOpen () |
void | logFileStart (const char *structName, bool open) |
virtual bool | methodCall (const char *name, const char *paramOrder, char **strings, const double *doubles, double *value, UDataBase **returnStruct=NULL, int *returnStructCnt=NULL) |
virtual const char * | print (const char *preString, char *buff, int buffCnt) |
bool | setGlobalVar (const char *name, const double value, bool mayAdd) |
Assigns a value to a variable. The variable may be a part of a structure. More... | |
bool | setLocalVar (int idx, double value, const int element) |
bool | setLocalVar (const char *name, const double value, bool mayAdd) |
Assigns a value to a variable. The variable may be a part of a structure. More... | |
bool | setLocalVar3D (int idx, UPosition *value) |
bool | setLocalVar6D (int idx, UPosRot *value) |
bool | setLocalVarAdd (int idx, double value, const int element) |
bool | setLocalVarPose (int idx, UPose *value) |
void | setVarPool (UVarCalc *sharedVarPool) |
int | updateQTvars (int structIdx) |
UResVarPool () | |
virtual | ~UResVarPool () |
Public Member Functions inherited from UResBase | |
void | createReplayVar (UVarPool *pool) |
UCmdExe * | getCorePointer () |
char * | getLogFileName (char *fn, const int fnCnt) |
int | getResFuncIdx () |
const char * | getResID () |
int | getResVersion () |
bool | isA (const char *idStr) |
bool | isAlsoA (const char *id) |
virtual void | saveSettings () |
void | setCorePointer (UCmdExe *serverCore) |
void | setResFuncIdx (int idx) |
virtual void | setResID (const char *id, const int version) |
virtual void | stop (bool) |
virtual void | updateReplayStatus () |
UResBase () | |
virtual | ~UResBase () |
Public Member Functions inherited from UReplay | |
void | addChild (UReplay *child) |
virtual bool | decodeReplayLine (char *) |
char * | getLogFileName (char *fn, const int fnCnt) |
char * | getReplayFileName (char *fn, const int fnCnt) |
int | getReplayLogLine () |
bool | isReplay () |
bool | isReplayFileOpen () |
void | removeChild (UReplay *child) |
virtual void | replayAdvanceTime (UTime untilTime) |
void | replaySetBaseFileName (const char *name, const char *preName="") |
void | replaySetFileName (const char *name) |
virtual bool | replayStep () |
int | replayStep (int steps) |
virtual bool | replayToTime (UTime untilTime) |
void | setParent (UReplay *parent) |
bool | setReplay (bool value) |
UReplay () | |
virtual | ~UReplay () |
Public Member Functions inherited from ULock | |
bool | lock () |
void | lockInit () |
void | post () |
bool | tryLock () |
bool | tryWait () |
ULock () | |
void | unlock () |
bool | wait () |
~ULock () | |
Public Member Functions inherited from UVarMethodImplement | |
virtual bool | methodCallV (const char *name, const char *paramOrder, UVariable *params[], UDataBase **returnStruct, int *returnStructCnt) |
virtual | ~UVarMethodImplement () |
Public Member Functions inherited from UServerPush | |
int | addPushCommand (UServerInMsg *msg) |
bool | doPushCall (UServerPushElement *pe, const char *value) |
void | flushClientCmds (int clientIdx) |
UServerPushImplement * | getImplementor () |
int | getPushCmdCnt (int *cmdCnt, int *callCnt) |
UServerPushQueue * | getPushQueue () |
bool | gotCmdExe () |
void | gotNewData (void *pData) |
bool | isUpdated (int lastCnt, int *newCnt) |
bool | needNewData () |
void | print (const char *preString) |
void | print (const char *preString, char *buff, int buffCnt) |
void | servicePendingPushCmds () |
void | setCmdExe (UServerPushImplement *executor) |
void | setImplementor (UServerPushImplement *executor) |
bool | setResource (UResBase *resource, bool remove) |
bool | setUpdated (const char *value) |
Add watch object if needed. An image or other object is updated. set object as updated, with an extra qualifier, that may be used as a parameter in a push call. this push list is then added to the to the push list examined by the server thread. when server thread reach this push list it will call to get a possible associated data structure by a call to needNewData() whish is expected to call gotNewData(void * data_structure) - but now in the server thread. More... | |
UServerPush () | |
virtual | ~UServerPush () |
Private Member Functions | |
bool | handleStereo (UServerInMsg *msg) |
void | initializeStereo (bool paramChanged) |
bool | processImages () |
Private Attributes | |
CvStereoBMState * | BMState |
UImg3Dpoints | cloud3d |
CvSize | imageSize |
UImage * | img1 |
CvMat * | img1rd |
UImage * | img2 |
CvMat * | img2rd |
ULogFile | logf |
CvMat * | mx1 |
CvMat * | mx2 |
CvMat * | my1 |
CvMat * | my2 |
UMatrix | umatQ |
UVariable * | varDebug |
UVariable * | varDistortionLeft |
UVariable * | varDistortionRight |
UVariable * | varEssential |
UVariable * | varFundamental |
UVariable * | varImageDisp |
UVariable * | varImageSize |
UVariable * | varImagesLR |
UVariable * | varIntrinsicLeft |
UVariable * | varIntrinsicRight |
UVariable * | varLRrotation |
UVariable * | varLRtranslate |
UVariable * | varMinDisparity |
UVariable * | varNumberOfDisparities |
UVariable * | varPoseOnRobot |
UVariable * | varPreFilterCap |
UVariable * | varPreFilterSize |
UVariable * | varQ |
UVariable * | varSADWindowSize |
UVariable * | varTextureThreshold |
UVariable * | varTime |
UVariable * | varTrySmallerWindow |
UVariable * | varUniquenessRatio |
UVariable * | varUpdateCnt |
char | whyString [MWL] |
Static Private Attributes | |
static const int | MWL = 100 |
Additional Inherited Members | |
Static Public Member Functions inherited from UResVarPool | |
static const char * | getResClassID () |
Public Attributes inherited from UFunctionBase | |
bool | silent |
is reply to client and console to be limited More... | |
Public Attributes inherited from UReplay | |
bool | replayTimeAdvancePending |
UTime | replayTimeNow |
Static Public Attributes inherited from UFunctionBase | |
static const int | MAX_ID_LENGTH = 30 |
static const int | MAX_RESOURCE_LIST_SIZE = 250 |
Protected Member Functions inherited from UFuncPlugBasePush | |
bool | handlePush (UServerInMsg *msg) |
Protected Member Functions inherited from UFunctionBase | |
int | getCmdIndex () |
UResBase * | getStaticResource (const char *resName, bool mayCreate, bool staticOnly=true) |
get a pointer to a static resource. More... | |
bool | isClientAlive (int clientIdx, double holdOffTime) |
bool | sendDebug (UServerInMsg *msg, const char *debugText) |
bool | sendDebug (const char *debugText) |
bool | sendError (UServerInMsg *msg, const char *errorText) |
bool | sendError (const char *errorText) |
bool | sendHelp (UServerInMsg *msg, const char *infoText) |
bool | sendHelp (const char *infoText) |
bool | sendInfo (UServerInMsg *msg, const char *infoText) |
bool | sendInfo (const char *infoText) |
bool | sendWarning (UServerInMsg *msg, const char *warningText) |
bool | sendWarning (const char *warningText) |
UResBase * | setThisResource (const char *ID, UResBase *resource, bool remove, bool *changed, UResBase *currentResPtr, bool *isLocal) |
Protected Member Functions inherited from UResVarPool | |
void | setDescription (const char *note, bool copy=false) |
Protected Member Functions inherited from UResBase | |
UResBase * | getStaticResource (const char *resName, bool mayCreate, bool staticOnly=true) |
get a pointer to a static resource. More... | |
Protected Attributes inherited from UFunctionBase | |
char | aliasName [MAX_ID_LENGTH] |
UCmdExe * | cmdHandler |
char * | cmdToks [20] |
int | cmdToksCnt |
char | commandsHandled [MAX_RESOURCE_LIST_SIZE] |
UServerInMsg * | msg |
char | pluginName [MAX_RESOURCE_LIST_SIZE] |
bool | verboseMessages |
Protected Attributes inherited from UResBase | |
int | resFuncIdx |
char | resID [MAX_RESOURCE_ID_LENGTH] |
char | resIsAlso [MAX_RESOURCE_ISALSO_LENGTH] |
int | resVersion |
Protected Attributes inherited from UReplay | |
bool | replay |
FILE * | replayFile |
char | replayFileName [REPLAY_FILE_NAME_LENGTH] |
replay filename More... | |
char | replayLine [MAX_LOG_LINE_LENGTH] |
int | replayLogLine |
UReplay * | replayParent |
UTime | replayTimeNext |
Static Protected Attributes inherited from UReplay | |
static const int | MAX_LOG_LINE_LENGTH = 10000 |
static const int | REPLAY_FILE_NAME_LENGTH = 264 |
max length of replay filename More... | |
This stereo plugin takes two unprocessed (raw) images and produce a diaparity image and a 3D cloud, based on a calibration values and correlation parameters in the global variables.
|
inline |
Constructor
References BMState, callGotNewDataWithObject(), createResources(), handleCommand(), handleStereo(), imageSize, img1, img2, initializeStereo(), logf, UFunctionBase::msg, MWL, mx1, processImages(), UFunctionBase::setCommand(), ULogFile::setLogName(), varImagesLR, whyString, and ~UFuncStereo().
UFuncStereo::~UFuncStereo | ( | ) |
|
virtual |
Called from push implementor to get the push object. should call to 'gotNewData(object)' with the available event object. if no object is available (anymore), then call with a NULL pointer.
Reimplemented from UServerPush.
References cloud3d, data, and UServerPush::gotNewData().
Referenced by UFuncStereo().
|
virtual |
Called by server after this module is integrated into the server core structure, i.e. all core services are in place, but no commands are serviced for this module yet. Create any resources that this modules needs.
Reimplemented from UFunctionBase.
References UResVarPool::addVar(), UResVarPool::addVarA(), varDebug, varDistortionLeft, varDistortionRight, varEssential, varFundamental, varImageDisp, varImageSize, varImagesLR, varIntrinsicLeft, varIntrinsicRight, varLRrotation, varLRtranslate, varMinDisparity, varNumberOfDisparities, varPoseOnRobot, varPreFilterCap, varPreFilterSize, varQ, varSADWindowSize, varTextureThreshold, varTime, varTrySmallerWindow, varUniquenessRatio, and varUpdateCnt.
Referenced by UFuncStereo().
|
virtual |
Handle incomming commands flagged for this module
msg | pointer to the message and the client issuing the command |
Reimplemented from UFunctionBase.
References UFuncPlugBasePush::handlePush(), handleStereo(), USmlTagIn::isTagA(), UFunctionBase::sendDebug(), and UServerInMsg::tag.
Referenced by UFuncStereo().
|
private |
Handle stereo-push commands
References UVariable::add(), bool2str(), cloud3d, USmlTagIn::getAttBool(), USmlTagIn::getAttValue(), UVariable::getBool(), UVariable::getDouble(), UVariable::getInt(), ULogFile::getLogFileName(), initializeStereo(), ULogFile::isOpen(), ULock::lock(), logf, UImg3Dpoints::makePCLFile(), ULogFile::openLog(), UImg3Dpoints::p3dCnt, processImages(), UFunctionBase::sendHelpDone(), UFunctionBase::sendHelpStart(), UFunctionBase::sendInfo(), UFunctionBase::sendMsg(), UFunctionBase::sendText(), UFunctionBase::sendWarning(), UVariable::setValued(), UFunctionBase::silent, UServerInMsg::tag, ULock::unlock(), varDebug, varImageDisp, varImagesLR, varTime, varUpdateCnt, and whyString.
Referenced by handleCommand(), and UFuncStereo().
|
private |
Initialize the needed stereo structures and parameters
paramChanged | marks that som parameter intrinsic, distortion or fundamental matrix has changed, and thus rectification values must be recalculated - otherwise the existing values are used. |
References BMState, UMatrix::cvMat(), UVariable::getBool(), UVariable::getElementCnt(), UVariable::getInt(), UVariable::getValuesd(), imageSize, img1, img1rd, img2, img2rd, UMatrix::init(), mx1, mx2, my1, my2, UVariable::setValued(), umatQ, varDistortionLeft, varDistortionRight, varImageSize, varIntrinsicLeft, varIntrinsicRight, varLRrotation, varLRtranslate, varMinDisparity, varNumberOfDisparities, varPreFilterCap, varPreFilterSize, varQ, varSADWindowSize, varTextureThreshold, varTrySmallerWindow, and varUniquenessRatio.
Referenced by handleStereo(), processImages(), and UFuncStereo().
|
private |
Reset global variables produce disparity image.
References UImg3Dpoints::add(), BMState, UImage::camDevice, UImg3Dpoints::clear(), UImage::clear(), UPixel::clear(), cloud3d, UImage::copyMeta(), UImage::cvArr(), UMatrix::cvMat(), UVariable::getBool(), UCamPool::getCam(), UImage::getChannels(), UImage::getCharRef(), UImage::getHeight(), UImagePool::getImage(), UImage::getImageTime(), UVariable::getInt(), UPixel::getInt(), UImage::getIplImage(), UImage::getPix(), UCamMounted::getPosRot(), UFunctionBase::getStaticResource(), UImage::getWidth(), UImage::height(), UImage::imageNumber, imageSize, img1, img2, UImage::imgTime, initializeStereo(), UImg3Dpoints::inSensorCoordinates, UImage::isBGR(), UImage::isBW(), ULock::lock(), MWL, mx1, mx2, my1, my2, UPixel::p1, UPixel::p2, UPixel::p3, UImg3Dpoints::pose, roundi(), UImg3Dpoints::serial, UImage::setColorType(), UVariable::setInt(), UImage::setName(), UImage::setPix(), UImage::setSize(), UVariable::setTime(), UServerPush::setUpdated(), UPixel::swapRB(), UImg3Dpoints::time, UImage::toBW(), UImage::toRaibow(), ULock::tryLock(), umatQ, ULock::unlock(), UImage::updated(), varDebug, varImageDisp, varImageSize, varImagesLR, varTime, whyString, and UImage::width().
Referenced by handleStereo(), and UFuncStereo().
|
private |
Stereo calculation structures
Referenced by initializeStereo(), processImages(), UFuncStereo(), and ~UFuncStereo().
|
private |
Array with 3d points
Referenced by callGotNewDataWithObject(), handleStereo(), and processImages().
|
private |
Image buffer for disparity image - in 16bit gray format expected size of images
Referenced by initializeStereo(), processImages(), and UFuncStereo().
|
private |
Image buffers for source image in BW
Referenced by initializeStereo(), processImages(), UFuncStereo(), and ~UFuncStereo().
|
private |
Image buffer for left and right image in BW - if not debug image
Referenced by initializeStereo(), and ~UFuncStereo().
|
private |
Referenced by initializeStereo(), processImages(), UFuncStereo(), and ~UFuncStereo().
|
private |
Referenced by initializeStereo(), and ~UFuncStereo().
|
private |
Logfile
Referenced by handleStereo(), and UFuncStereo().
|
staticprivate |
Referenced by processImages(), and UFuncStereo().
|
private |
debug structure for colour disparity image values for image rectification and reallignment for image 1
Referenced by initializeStereo(), processImages(), UFuncStereo(), and ~UFuncStereo().
|
private |
Referenced by initializeStereo(), processImages(), and ~UFuncStereo().
|
private |
Referenced by initializeStereo(), processImages(), and ~UFuncStereo().
|
private |
Referenced by initializeStereo(), processImages(), and ~UFuncStereo().
|
private |
Referenced by initializeStereo(), and processImages().
|
private |
Referenced by createResources(), handleStereo(), and processImages().
|
private |
Referenced by createResources(), and initializeStereo().
|
private |
Referenced by createResources(), and initializeStereo().
|
private |
Referenced by createResources().
|
private |
Referenced by createResources().
|
private |
Referenced by createResources(), handleStereo(), and processImages().
|
private |
Stereo calibrate values
Referenced by createResources(), initializeStereo(), and processImages().
|
private |
Stereo processing parameters
Referenced by createResources(), handleStereo(), processImages(), and UFuncStereo().
|
private |
Referenced by createResources(), and initializeStereo().
|
private |
Referenced by createResources(), and initializeStereo().
|
private |
Referenced by createResources(), and initializeStereo().
|
private |
Referenced by createResources(), and initializeStereo().
|
private |
Referenced by createResources(), and initializeStereo().
|
private |
Referenced by createResources(), and initializeStereo().
|
private |
Referenced by createResources().
|
private |
Referenced by createResources(), and initializeStereo().
|
private |
Referenced by createResources(), and initializeStereo().
|
private |
Referenced by createResources(), and initializeStereo().
|
private |
Referenced by createResources(), and initializeStereo().
|
private |
Referenced by createResources(), and initializeStereo().
|
private |
Referenced by createResources(), handleStereo(), and processImages().
|
private |
Referenced by createResources(), and initializeStereo().
|
private |
Referenced by createResources(), and initializeStereo().
|
private |
Pointers to "own" global variables.
Referenced by createResources(), and handleStereo().
|
private |
Short explanation to why processing failed
Referenced by handleStereo(), processImages(), and UFuncStereo().