AURobotServers  4
Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
UClientFuncImgGui Class Reference

#include <uclientfuncimggui.h>

Inheritance diagram for UClientFuncImgGui:
Inheritance graph

Public Types

enum  ColorDisplayType { CDT_NONE, CDT_YUV, CDT_CROMA }
 

Public Member Functions

void clear ()
 
virtual void doTimeTick ()
 
UImagegetImage (const char *capt)
 
UHighGuiWindowHandlegetImageSource (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)
 
UVarPooladdStruct (const char *name, const char *comment, bool copy=false)
 
UVariableaddVar (const char *name, const double initialValue, const char *type, const char *comment)
 
UVariableaddVar (const char *name, const char *initialValue, const char *type, const char *comment)
 
UVariableaddVarA (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)
 
UVarCalcgetVarPool ()
 
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 ()
 
UCmdExegetCorePointer ()
 
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 UImagegetImageBuffer (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
UResBasegetStaticResource (const char *resName, bool mayCreate, bool staticOnly=true)
 get a pointer to a static resource. More...
 

Private Member Functions

UHighGuiWindowHandlegetWndName (char *name, bool mayCreate)
 

Private Attributes

int focalLine
 
UFuzzySplitfuzzy
 
int fuzzyClasses
 
int fuzzyCol
 
int fuzzyIter
 
int fuzzyLine
 
int fuzzyWidth
 
UImageimgRefr
 
unsigned int imgSourceUV
 
bool imgToMax
 
UImageimgUV
 
bool saveOnMatch
 
bool saveOnMatchAndShow
 
char saveOnMatchStr [MAX_MATCH_STR_LNG]
 
UHighGuiWindowHandlewindow [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
 
UReplayreplayParent
 
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...
 

Detailed Description

Show images from image server

Author
Christian Andersen

Member Enumeration Documentation

Enumerator
CDT_NONE 
CDT_YUV 
CDT_CROMA 

Constructor & Destructor Documentation

UClientFuncImgGui::UClientFuncImgGui ( )
UClientFuncImgGui::~UClientFuncImgGui ( )

Destructor

References UHighGuiWindowHandle::cvWndName, fuzzy, window, and windowCnt.

Member Function Documentation

void UClientFuncImgGui::clear ( void  )

Close all images and release resources

References imgSourceUV, imgUV, window, and windowCnt.

Referenced by clientCmdLine().

bool UClientFuncImgGui::doFuzzyClassify ( UImage imgsrc)
protected
void UClientFuncImgGui::doTimeTick ( )
virtual

time to update GUI

Reimplemented from UClientFuncBase.

References CDT_NONE, globalColorDisplayType, globalUvRedisplay, gotNewImage(), imgRefr, and showUVImage().

UPixel UClientFuncImgGui::getCroma ( UPixel rgb,
int  sourceFormat 
)
protected

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().

int UClientFuncImgGui::getPixelClass ( UPixel  yuv,
int  clustCnt 
)
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().

UHighGuiWindowHandle * UClientFuncImgGui::getWndName ( char *  name,
bool  mayCreate 
)
private

Get the handle for this image name

References UHighGuiWindowHandle::cvWndName, MAX_CV_WINDOW_NAME_SIZE, MAX_WINDOWS, window, and windowCnt.

Referenced by gotNewImage().

void UClientFuncImgGui::gotNewImage ( UImage img,
int  poolNum,
USmlTag tag 
)
protectedvirtual
void UClientFuncImgGui::paintClustEllipse ( bool  isUV,
UMatrix mV,
UMatrix mQ,
UImage img,
int  clust 
)
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().

void UClientFuncImgGui::paintClustPixels ( bool  isUV,
UImage imgsrc,
UImage imgUV 
)
protected
bool UClientFuncImgGui::saveImage ( const char *  capt,
const char *  noshow 
)
void UClientFuncImgGui::setFocalLine ( int  line)
inline

Set line for amplitude analysis

Referenced by clientCmdLine().

void UClientFuncImgGui::setFuzzyClasses ( int  value)
inline

Set number of classes to cklassify into. 2 = 2x mouse, 3=2xmouse + background (all other values are illegal)

Referenced by clientCmdLine().

void UClientFuncImgGui::setFuzzyIter ( int  value)
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().

void UClientFuncImgGui::setToMaxRes ( bool  value)
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().

void UClientFuncImgGui::showFocusNumber ( UImage imgs,
UImage imgd 
)
protected

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().

void UClientFuncImgGui::showImage ( UImage img)
inline

Set pointer to laser scanner path results

  • may be used to paint in camera image

References UHighGuiWindowHandle::img.

Referenced by gotNewImage().

void UClientFuncImgGui::showLine ( UImage imgs,
UImage imgd,
int  line 
)
protected

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().

void UClientFuncImgGui::showUVImage ( )
protected

Member Data Documentation

int UClientFuncImgGui::focalLine
private

Show focus line curve

Referenced by gotNewImage(), showLine(), and UClientFuncImgGui().

UFuzzySplit* UClientFuncImgGui::fuzzy
private
int UClientFuncImgGui::fuzzyClasses
private

Number of fuzzy classifier classes

Referenced by doFuzzyClassify(), paintClustPixels(), showUVImage(), and UClientFuncImgGui().

int UClientFuncImgGui::fuzzyCol
private

Fuzzy seed from 'fuzzyLine' in image split at 'fuzzyCol' position.

Referenced by doFuzzyClassify(), setFuzzyLine(), and UClientFuncImgGui().

int UClientFuncImgGui::fuzzyIter
private

Number of fuzzy classifier iterations

Referenced by doFuzzyClassify(), and UClientFuncImgGui().

int UClientFuncImgGui::fuzzyLine
private

Fuzzy seed from fuzzyLine in image split at fuzzyCol position.

Referenced by doFuzzyClassify(), setFuzzyLine(), and UClientFuncImgGui().

int UClientFuncImgGui::fuzzyWidth
private

Show fuzzy classifier

Referenced by doFuzzyClassify(), setFuzzyWidth(), showUVImage(), and UClientFuncImgGui().

UImage* UClientFuncImgGui::imgRefr
private

Image to redisplay

Referenced by doTimeTick(), and UClientFuncImgGui().

unsigned int UClientFuncImgGui::imgSourceUV
private

Image to use for UV display

Referenced by clear(), getImageSource(), saveImage(), setUVSource(), and showUVImage().

bool UClientFuncImgGui::imgToMax
private

Copy all images to max resolution

Referenced by gotNewImage(), and UClientFuncImgGui().

UImage* UClientFuncImgGui::imgUV
private

Image that displays the UV colour values

Referenced by clear(), saveImage(), showUVImage(), and UClientFuncImgGui().

const int UClientFuncImgGui::MAX_MATCH_STR_LNG = 100
staticprivate

Match string length

Referenced by saveImage().

bool UClientFuncImgGui::saveOnMatch
private

Save images if match caption

Referenced by gotNewImage(), saveImage(), and UClientFuncImgGui().

bool UClientFuncImgGui::saveOnMatchAndShow
private

Display image also if it was saved

Referenced by gotNewImage(), saveImage(), and UClientFuncImgGui().

char UClientFuncImgGui::saveOnMatchStr[MAX_MATCH_STR_LNG]
private

Caption match string

Referenced by gotNewImage(), and saveImage().

UHighGuiWindowHandle* UClientFuncImgGui::window[MAX_WINDOWS]
private
int UClientFuncImgGui::windowCnt
private

The documentation for this class was generated from the following files: