AURobotServers
4
|
#include <uclientfuncimggui.h>
Public Types | |
enum | ColorDisplayType { CDT_NONE, CDT_YUV, CDT_CROMA } |
Public Member Functions | |
void | clear () |
virtual void | doTimeTick () |
UImage * | getImage (const char *capt) |
UHighGuiWindowHandle * | getImageSource (const char *capt) |
bool | saveImage (const char *capt, const char *noshow) |
void | setFocalLine (int line) |
void | setFuzzyClasses (int value) |
void | setFuzzyIter (int value) |
void | setFuzzyLine (int row, int col) |
void | setFuzzyWidth (int value) |
void | setToMaxRes (bool value) |
void | setUVSource (const char *captName, ColorDisplayType type) |
void | showImage (UImage *img) |
UClientFuncImgGui () | |
~UClientFuncImgGui () | |
Public Member Functions inherited from UClientFuncImage | |
virtual void | changedNamespace (const char *newNamespace) |
virtual const char * | commandList () |
virtual void | handleNewData (USmlTag *tag, const char *ifname) |
virtual const char * | name () |
UClientFuncImage () | |
virtual | ~UClientFuncImage () |
Public Member Functions inherited from UResIfBase | |
UResIfBase () | |
~UResIfBase () | |
Public Member Functions inherited from UClientFuncBase | |
int | getMsgCnt () |
bool | getVerbose () |
bool | sendMsg (UClientPortSml *cnn, const char *buff, int buffCnt) |
bool | sendMsg (UClientPortSml *cnn, const char *buff) |
void | setVerbose (bool value) |
UClientFuncBase () | |
virtual | ~UClientFuncBase () |
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 () |
virtual bool | gotAllResources (char *missingThese, int missingTheseCnt) |
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) |
virtual bool | setResource (UResBase *resource, bool remove) |
void | setVarPool (UVarCalc *sharedVarPool) |
int | updateQTvars (int structIdx) |
UResVarPool () | |
virtual | ~UResVarPool () |
Public Member Functions inherited from UResBase | |
void | createReplayVar (UVarPool *pool) |
virtual void | createResources () |
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 | print (const char *preString) |
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 | |
bool | doFuzzyClassify (UImage *imgsrc) |
UPixel | getCroma (UPixel *rgb, int sourceFormat) |
int | getPixelClass (UPixel yuv, int clustCnt) |
virtual void | gotNewImage (UImage *img, int poolNum, USmlTag *tag) |
void | paintClustEllipse (bool isUV, UMatrix *mV, UMatrix *mQ, UImage *img, int clust) |
void | paintClustPixels (bool isUV, UImage *imgsrc, UImage *imgUV) |
void | showFocusNumber (UImage *imgs, UImage *imgd) |
void | showLine (UImage *imgs, UImage *imgd, int line) |
void | showUVImage () |
Protected Member Functions inherited from UClientFuncImage | |
virtual UImage * | getImageBuffer (int poolNumber, int height, int width, int channels, int depth) |
virtual void | gotNewCamInfo (int device, UPosRot pose, double focalLength, double k1, double k2, const char *name) |
Protected Member Functions inherited from UClientFuncBase | |
void | handleHelp (USmlTag *tag) |
void | printReply (USmlTagIn *tag, const char *preString) |
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 Member Functions | |
UHighGuiWindowHandle * | getWndName (char *name, bool mayCreate) |
Private Attributes | |
int | focalLine |
UFuzzySplit * | fuzzy |
int | fuzzyClasses |
int | fuzzyCol |
int | fuzzyIter |
int | fuzzyLine |
int | fuzzyWidth |
UImage * | imgRefr |
unsigned int | imgSourceUV |
bool | imgToMax |
UImage * | imgUV |
bool | saveOnMatch |
bool | saveOnMatchAndShow |
char | saveOnMatchStr [MAX_MATCH_STR_LNG] |
UHighGuiWindowHandle * | window [MAX_WINDOWS] |
int | windowCnt |
Static Private Attributes | |
static const int | MAX_MATCH_STR_LNG = 100 |
Additional Inherited Members | |
Static Public Member Functions inherited from UResVarPool | |
static const char * | getResClassID () |
Public Attributes inherited from UClientFuncBase | |
ULock | decodeLock |
Public Attributes inherited from UReplay | |
bool | replayTimeAdvancePending |
UTime | replayTimeNow |
Protected Attributes inherited from UClientFuncImage | |
char | posName [MAX_MOUNT_NAME_SIZE] |
Protected Attributes inherited from UClientFuncBase | |
int | msgHandled |
char | serverNamespace [MAX_SML_NAME_LENGTH] |
int | serverNamespaceValue |
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... | |
Show images from image server
UClientFuncImgGui::UClientFuncImgGui | ( | ) |
Constructor
References focalLine, fuzzy, fuzzyClasses, fuzzyCol, fuzzyIter, fuzzyLine, fuzzyWidth, imgRefr, imgToMax, imgUV, saveOnMatch, saveOnMatchAndShow, and windowCnt.
UClientFuncImgGui::~UClientFuncImgGui | ( | ) |
Destructor
References UHighGuiWindowHandle::cvWndName, fuzzy, window, and windowCnt.
void UClientFuncImgGui::clear | ( | void | ) |
Close all images and release resources
References imgSourceUV, imgUV, window, and windowCnt.
Referenced by clientCmdLine().
|
protected |
Classify mouse sample and the-rest into two clusters
References UFuzzySplit::addElement(), UFuzzySplit::classify(), UFuzzySplit::clear(), UFuzzySplit::countMembers(), fuzzy, fuzzyClasses, fuzzyCol, fuzzyIter, fuzzyLine, fuzzyWidth, UImage::getLine(), UFuzzySplit::getMembCount(), UImage::getPixRef(), globalPixPoint2, globalPixPointS, UImage::height(), UFuzzySplit::initFromValues(), maxi(), mini(), UFuzzyPixel::print(), UFuzzyPixel::setPixel(), sqr(), UImage::width(), and UPixel::y.
Referenced by showUVImage().
|
virtual |
time to update GUI
Reimplemented from UClientFuncBase.
References CDT_NONE, globalColorDisplayType, globalUvRedisplay, gotNewImage(), imgRefr, and showUVImage().
Convert this BGR pixel to a cromatisity only pixel
References UPixel::asBGR(), UPixel::p1, UPixel::p2, UPixel::p3, and PIX_PLANES_BGR.
Referenced by getPixelClass().
UImage * UClientFuncImgGui::getImage | ( | const char * | capt | ) |
Get pointer to one of the windows with this caption
References UHighGuiWindowHandle::getImage(), img, UImage::name, window, and windowCnt.
UHighGuiWindowHandle * UClientFuncImgGui::getImageSource | ( | const char * | capt | ) |
Get handle to highgui image with this caption part. Default image is first, if noone else. Result may be NULL if no image defined.
References CDT_NONE, imgSourceUV, setUVSource(), and window.
Referenced by clientCmdLine().
|
protected |
Get cluster number for this pixel. Must know the number of classes the pixels are divided into.
References CDT_CROMA, CDT_YUV, fuzzy, getCroma(), globalColorDisplayType, PIX_PLANES_BGR, UFuzzyPixel::setPixel(), and UFuzzySplit::updateElement().
Referenced by paintClustPixels(), and showUVImage().
|
private |
Get the handle for this image name
References UHighGuiWindowHandle::cvWndName, MAX_CV_WINDOW_NAME_SIZE, MAX_WINDOWS, window, and windowCnt.
Referenced by gotNewImage().
Called when a new image in RGB format (openCv format) is available.
Reimplemented from UClientFuncImage.
References UImage::copyToMaxRes(), UImage::cvArr(), focalLine, UImage::getColorType(), getWndName(), globalPixPoint1, globalUvRedisplay, imagePath, img, imgToMax, MAX_FILENAME_LENGTH, UImage::name, PIX_PLANES_BGR, PIX_PLANES_BW, PIX_PLANES_RGB, PIX_PLANES_YUV, PIX_PLANES_YUV420, saveOnMatch, saveOnMatchAndShow, saveOnMatchStr, showFocusNumber(), UHighGuiWindowHandle::showImage(), showImage(), showLine(), and UImage::toBGR().
Referenced by doTimeTick().
|
protected |
Paint cluster covariance ellipse in UV image, if not UV, then cromatisity
References a, UMatrix::cols(), UImage::cvArr(), UMatrix4::eig2x2(), UMatrix::get(), maxi(), mini(), roundi(), UMatrix::rows(), and UMatrix::setRC().
Referenced by showUVImage().
Paint pixels within 'clust' into image in blue
References CDT_CROMA, CDT_YUV, fuzzyClasses, UImage::getLine(), getPixelClass(), globalColorDisplayType, UImage::height(), maxi(), mini(), UPixel::p2, UPixel::p3, roundi(), UImage::setPix(), UPixel::u, UPixel::v, and UImage::width().
Referenced by showUVImage().
bool UClientFuncImgGui::saveImage | ( | const char * | capt, |
const char * | noshow | ||
) |
Save image with this string part in caption
References UImage::cvArr(), UHighGuiWindowHandle::cvWndName, UTime::getForFilename(), UHighGuiWindowHandle::getImage(), imagePath, img, imgSourceUV, UImage::imgTime, imgUV, MAX_MATCH_STR_LNG, UImage::name, saveOnMatch, saveOnMatchAndShow, saveOnMatchStr, window, and windowCnt.
Referenced by clientCmdLine().
|
inline |
Set line for amplitude analysis
Referenced by clientCmdLine().
|
inline |
Set number of classes to cklassify into. 2 = 2x mouse, 3=2xmouse + background (all other values are illegal)
Referenced by clientCmdLine().
|
inline |
Set number of iterations for fuzzy classifier 0=seed area only
Referenced by clientCmdLine().
void UClientFuncImgGui::setFuzzyLine | ( | int | row, |
int | col | ||
) |
Set number of classes to cklassify into. 2 = 2x mouse, 3=2xmouse + background (all other values are illegal)
References fuzzyCol, fuzzyLine, and globalUvRedisplay.
Referenced by clientCmdLine().
void UClientFuncImgGui::setFuzzyWidth | ( | int | value | ) |
Set width of mask, where sample for fuzzy-classifier is taken. The other class is taken over the full image
References fuzzyWidth.
Referenced by clientCmdLine().
|
inline |
Set flag, that determines if images are to be converted to max res
Referenced by clientCmdLine().
void UClientFuncImgGui::setUVSource | ( | const char * | captName, |
ColorDisplayType | type | ||
) |
Set the image to be displayed for color analysis
References UHighGuiWindowHandle::getImage(), globalColorDisplayType, img, imgSourceUV, UImage::name, window, and windowCnt.
Referenced by clientCmdLine(), and getImageSource().
Show largest intensi-jump from one pixel to the next over the full image (every 3rd line)
References absi(), UImage::cvArr(), UImage::getLine(), UImage::height(), UPixel::p1, UPixel::p2, UPixel::p3, and UImage::width().
Referenced by gotNewImage().
|
inline |
Set pointer to laser scanner path results
References UHighGuiWindowHandle::img.
Referenced by gotNewImage().
Paint color intensity line on top of image for 'line' (2/3 width)
References UImage::cvArr(), focalLine, UClientFuncImage::getImageBuffer(), UImage::getPixRef(), UImage::height(), img, UPixel::p1, UPixel::p2, UPixel::p3, UImage::width(), and UPixel::y.
Referenced by gotNewImage().
|
protected |
Show UV image from default source and default (global) threshold
References UPixel::asYUV(), CDT_CROMA, CDT_YUV, UImage::clear(), UImage::copy(), UImage::cvArr(), doFuzzyClassify(), fuzzy, fuzzyClasses, fuzzyWidth, UImage::getColorType(), UFuzzySplit::getF(), UPixel::getGreen(), UHighGuiWindowHandle::getImage(), UImage::getLine(), UImage::getPix(), getPixelClass(), UImage::getPixRef(), UPixel::getRed(), UFuzzySplit::getV(), globalColorDisplayType, globalPixPoint2, globalThresholdMax, globalThresholdMin, UImage::height(), imgSourceUV, imgUV, maxi(), mini(), UImage::name, on_trackbar(), UPixel::p1, UPixel::p2, UPixel::p3, paintClustEllipse(), paintClustPixels(), PIX_PLANES_BGR, roundi(), UImage::setPix(), UPixel::setRGBto(), UImage::setSize(), UPixel::setYUVto(), UImage::toCromaBGR(), UPixel::tone(), UImage::toYUV(), UPixel::u, UPixel::v, UImage::width(), window, windowCnt, and UPixel::y.
Referenced by doTimeTick().
|
private |
Show focus line curve
Referenced by gotNewImage(), showLine(), and UClientFuncImgGui().
|
private |
Fuzzy classifier
Referenced by doFuzzyClassify(), getPixelClass(), showUVImage(), UClientFuncImgGui(), and ~UClientFuncImgGui().
|
private |
Number of fuzzy classifier classes
Referenced by doFuzzyClassify(), paintClustPixels(), showUVImage(), and UClientFuncImgGui().
|
private |
Fuzzy seed from 'fuzzyLine' in image split at 'fuzzyCol' position.
Referenced by doFuzzyClassify(), setFuzzyLine(), and UClientFuncImgGui().
|
private |
Number of fuzzy classifier iterations
Referenced by doFuzzyClassify(), and UClientFuncImgGui().
|
private |
Fuzzy seed from fuzzyLine in image split at fuzzyCol position.
Referenced by doFuzzyClassify(), setFuzzyLine(), and UClientFuncImgGui().
|
private |
Show fuzzy classifier
Referenced by doFuzzyClassify(), setFuzzyWidth(), showUVImage(), and UClientFuncImgGui().
|
private |
Image to redisplay
Referenced by doTimeTick(), and UClientFuncImgGui().
|
private |
Image to use for UV display
Referenced by clear(), getImageSource(), saveImage(), setUVSource(), and showUVImage().
|
private |
Copy all images to max resolution
Referenced by gotNewImage(), and UClientFuncImgGui().
|
private |
Image that displays the UV colour values
Referenced by clear(), saveImage(), showUVImage(), and UClientFuncImgGui().
|
staticprivate |
Match string length
Referenced by saveImage().
|
private |
Save images if match caption
Referenced by gotNewImage(), saveImage(), and UClientFuncImgGui().
|
private |
Display image also if it was saved
Referenced by gotNewImage(), saveImage(), and UClientFuncImgGui().
|
private |
Caption match string
Referenced by gotNewImage(), and saveImage().
|
private |
openCV variables to show window
Referenced by clear(), getImage(), getImageSource(), getWndName(), saveImage(), setUVSource(), showUVImage(), and ~UClientFuncImgGui().
|
private |
Number of windows created
Referenced by clear(), getImage(), getWndName(), saveImage(), setUVSource(), showUVImage(), UClientFuncImgGui(), and ~UClientFuncImgGui().