AURobotServers
4
|
Public Member Functions | |
virtual bool | handleCommand (UServerInMsg *msg, void *extra) |
UFuncImSeg () | |
virtual | ~UFuncImSeg () |
Public Member Functions inherited from UFunctionCamBase | |
virtual void | createResources () |
UImage * | getImage (UServerInMsg *msg, void *extra) |
virtual bool | setResource (UResBase *ressource, bool remove) |
UFunctionCamBase () | |
virtual | ~UFunctionCamBase () |
Public Member Functions inherited from UFunctionImgBase | |
virtual void | setCmdHandler (UCmdExe *cmdExe) |
void | showImagesAsDefault (bool show) |
UFunctionImgBase () | |
virtual | ~UFunctionImgBase () |
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 () |
Protected Member Functions | |
int | cooccurrence (UImage *src, int x, int y, int dx, int dy, int side, float *m, int mCnt) |
void | createBaseVar () |
int | doGrayLevelCooccurenceMatrix (UImage *srcImg, int x, int y, int side) |
int | doHistMatch (int *h1, int *h2, int h1Cnt) |
float | doHistMatchBhatta (int *h1, int *h2, int h1Cnt) |
float | doHistMatchCorrel (int *h1, int *h2, int h1Cnt) |
void | doLBPhistogramMatch (UImage *srcImg, int side, int step, bool debug) |
int | doPatchHistogram (UImage *src, int x, int y, int side, int *h1, int h1Cnt) |
int | doPatchHistogramLBP8 (UImage *src, int x, int y, int side, int *h1, int h1Cnt) |
float | findBestCoooccurrence (UImage *src, int x, int y, int *dxMin, int *dyMin, int side) |
bool | findSegments (UImage *img, bool debug) |
void | makeDisplayPolygon (UPosition *centerPos, bool isBlue, double size, UTime imgTime) |
bool | makeLBPimage (UImage *img, bool debug) |
bool | meanShiftSegment (UImage *img, bool debug) |
Protected Member Functions inherited from UFunctionCamBase | |
UCamPush * | getCam (int imgDevice, const char *posName) |
UCamPush * | getCam (int camDevNum) |
bool | getCamAndRawImage (UCamPush **cam, UImage **imgRaw, int *imgDevice, void *imgBase, const char *posName, int rectfiedImg) |
int | getDefaultCamDevice () |
Protected Member Functions inherited from UFunctionImgBase | |
bool | sendImage (UServerInMsg *msg, const char *tagName, UImage *imgRgb, int imgLeft=0, int imgTop=0, int imgWidth=640, int imgHeight=480, int imgSource=-1, bool isCodecBin=true, bool imgIsBW=false, bool imgGetNum=true, bool imgGetTod=true, bool imgGetTime=false, const char *posName=NULL, bool imgGetName=true, bool silent=false) |
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... | |
Private Attributes | |
UPosition | ballPos |
most likely ball position in robot coordinates More... | |
CvBox2D32f | ell [MAX_ELL_CNT] |
resulting ellipses found in image More... | |
int | ellCnt |
number of ellipses found More... | |
int | imgSizeH |
size of source image in pixels More... | |
int | imgSizeW |
size of source image in pixels More... | |
UVariable * | varDistance |
UVariable * | varOutPoolImg |
pointer to limiting red values redMin, redMax, greenMin, greenMax More... | |
UVariable * | varRadius |
UVariable * | varSeed |
UVariable * | varSeedSize |
Static Private Attributes | |
static const int | MAX_ELL_CNT = 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 Attributes inherited from UFunctionCamBase | |
UCamPool * | camPool |
Protected Attributes inherited from UFunctionImgBase | |
UImagePool * | imgPool |
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... | |
Example plugin to find balls in camera image
|
inline |
Constructor
References createBaseVar(), ellCnt, and UFunctionBase::setCommand().
|
inlinevirtual |
Destructor - to delete the resource (etc) when finished
|
inlineprotected |
References UImage::getCharRef(), UImage::height(), and UImage::width().
Referenced by findBestCoooccurrence().
|
inlineprotected |
Make the variables that will be available to other plug-ins
References UResVarPool::addVar(), UResVarPool::addVarA(), varDistance, varOutPoolImg, varRadius, varSeed, and varSeedSize.
Referenced by UFuncImSeg().
|
inlineprotected |
compare and count co-occurance matrix around point x,y in an area around x,y of dx, dy
src | a 8-bit gray level image |
dest | is the coocurrance result image |
x,y | is the center position in the area |
dx,dy | is the width and height of the ROI |
returns | the number of pixels in the area, this is less than dx*dy if too close to a border. |
References UImage::copy(), UImage::cvArr(), findBestCoooccurrence(), UImagePool::getImage(), UVariable::getInt(), UFunctionImgBase::imgPool, UImage::toBW(), UImage::updated(), and varOutPoolImg.
Referenced by handleCommand().
|
inlineprotected |
Referenced by doLBPhistogramMatch().
|
inlineprotected |
Referenced by doLBPhistogramMatch().
|
inlineprotected |
Referenced by doLBPhistogramMatch().
|
inlineprotected |
Converts source image to BW, then to 8-bit LBP image, and makes a patch histogram for each of the 8 bits, and compare these in a result image, that should show edges of segments
srcImg | is source image (any format) |
side | is the side length of patch |
References absf(), UImage::clear(), UImage::copyMeta(), doHistMatch(), doHistMatchBhatta(), doHistMatchCorrel(), doPatchHistogramLBP8(), UImage::getCharRef(), UImagePool::getImage(), UVariable::getInt(), UImage::height(), UImage::imageNumber, UFunctionImgBase::imgPool, makeLBPimage(), UImage::name, UImage::setSizeOnly(), UImage::updated(), varOutPoolImg, and UImage::width().
Referenced by handleCommand().
|
inlineprotected |
Histogram with 256 values, one for each gray scale value
src | is the source image that is supposed to be LPB converted |
x,y | is the center of the patch |
side | is the side length of the patch |
h1 | is the destination histogram - size 256 x integer |
h1Cnt | should be (at least) 256 |
References UImage::getCharRef(), UImage::height(), and UImage::width().
|
inlineprotected |
Histogram vith 8 values, one for each of the gradients around the the center pixel
src | is the source image that is supposed to be LPB converted |
x,y | is the center of the patch |
side | is the side length of the patch |
h1 | is the destination histogram - size 8 x integer |
h1Cnt | should be (at least) 8 |
References UImage::getCharRef(), UImage::height(), and UImage::width().
Referenced by doLBPhistogramMatch().
|
inlineprotected |
References cooccurrence(), UImagePool::getImage(), UVariable::getInt(), UFunctionImgBase::imgPool, UImage::setPixChar(), UImage::setSize(), UImage::updated(), and varOutPoolImg.
Referenced by doGrayLevelCooccurenceMatrix().
|
inlineprotected |
Find segments in this image
img | is a pointer to the image to be analysed |
debug | if true, then more images are produced in the image pool |
References UImAna::findRoadPoly(), UVariable::getDouble(), UVariable::getInt(), UFunctionBase::getStaticResource(), UImage::height(), UFunctionImgBase::imgPool, imgSizeH, imgSizeW, UImAna::setImagePool(), varDistance, varRadius, varSeed, varSeedSize, and UImage::width().
Referenced by handleCommand().
|
inlinevirtual |
Handle incomming command Must return true if the function is handled - otherwise the client will get a 'failed' reply
Reimplemented from UFunctionBase.
References doGrayLevelCooccurenceMatrix(), doLBPhistogramMatch(), findSegments(), USmlTagIn::getAttBool(), USmlTagIn::getAttInteger(), USmlTagIn::getAttValue(), USmlTagIn::getAttValueBool(), UFunctionCamBase::getImage(), USmlTagIn::getTagName(), img, makeLBPimage(), meanShiftSegment(), UFunctionBase::sendHelpDone(), UFunctionBase::sendHelpStart(), UFunctionBase::sendInfo(), UFunctionBase::sendMsg(), UFunctionBase::sendText(), UFunctionBase::sendWarning(), and UServerInMsg::tag.
|
inlineprotected |
copy ball position to polygon plugin, so that it can be shown by client in top-view image
centerPos | is center position of ball on ground |
isBlue | is color of ball |
size | is size in meters of ball |
References UPolygon::add(), UResPoly::add(), ballPos, UPolygon::clear(), UPolyItem::cooSys, UResPoly::getItem(), UResPoseHist::getPoseAtTime(), UPose::getPoseToMap(), UFunctionBase::getStaticResource(), UResPoly::gotNewData(), ULock::lock(), UPolygon::setAsPolygon(), UPolygon::setColor(), ULock::unlock(), UPolyItem::updateTime, UPosition::x, UPosition::y, and UPosition::z.
|
inlineprotected |
Find segments in this image based on LBP (local binary pattern)
img | is a pointer to the image to be analysed |
debug | if true, then more images are produced in the image pool |
References UImage::copyMeta(), UImage::fromMat(), UImagePool::getImage(), UVariable::getInt(), UImage::getLine(), UFunctionBase::getStaticResource(), UImage::height(), UFunctionImgBase::imgPool, imgSizeH, imgSizeW, UImage::mat, UImage::toBW(), UImage::toMat(), UImage::updated(), varOutPoolImg, and UImage::width().
Referenced by doLBPhistogramMatch(), and handleCommand().
|
inlineprotected |
Try a mean shift segmentation
References UImage::copyMeta(), UImage::cvArr(), UImagePool::getImage(), UVariable::getInt(), UImage::getIplImage(), UImage::getLine(), UImage::getUCharRef(), UImage::height(), UFunctionImgBase::imgPool, UPixel::p1, UPixel::p2, UPixel::p3, UImage::toRGBA(), UImage::updated(), varDistance, varOutPoolImg, varRadius, and UImage::width().
Referenced by handleCommand().
|
private |
most likely ball position in robot coordinates
Referenced by makeDisplayPolygon().
|
private |
resulting ellipses found in image
|
private |
number of ellipses found
Referenced by UFuncImSeg().
|
private |
size of source image in pixels
Referenced by findSegments(), and makeLBPimage().
|
private |
size of source image in pixels
Referenced by findSegments(), and makeLBPimage().
|
staticprivate |
|
private |
Referenced by createBaseVar(), findSegments(), and meanShiftSegment().
|
private |
pointer to limiting red values redMin, redMax, greenMin, greenMax
Referenced by createBaseVar(), doGrayLevelCooccurenceMatrix(), doLBPhistogramMatch(), findBestCoooccurrence(), makeLBPimage(), and meanShiftSegment().
|
private |
Referenced by createBaseVar(), findSegments(), and meanShiftSegment().
|
private |
Referenced by createBaseVar(), and findSegments().
|
private |
Referenced by createBaseVar(), and findSegments().