05Robot 3.0

- Main Page
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Signals | Public Member Functions | Properties | List of all members
Processor_ObjectExtraction Class Reference
Computer Vision Module

Object extraction image processor. More...

`#include <Processor_ObjectExtraction.h>`

Inheritance diagram for Processor_ObjectExtraction:

## Signals
void | pickObject (QVector3D pointInMeters, float object_height, float angle, int bin)
void | object_data (cv::Mat image, QVector< sObject > objects)
Signals inherited from Processor
void | writeInfo (QString info)
| Data logger. More...

## Public Member Functions
void | Setmedian_khalfsize (int _arg_median_khalfsize)
| Sets median_khalfsize property value. More...
int | median_khalfsize () const
| Gets median_khalfsize property value. More...
void | Setworkspace_x_offset (double _arg_workspace_x_offset)
| Sets workspace_x_offset property value. More...
double | workspace_x_offset () const
| Gets workspace_x_offset property value. More...
void | Setworkspace_y_offset (double _arg_workspace_y_offset)
| Sets workspace_y_offset property value. More...
double | workspace_y_offset () const
| Gets workspace_y_offset property value. More...
void | Setworkspace_z_offset (double _arg_workspace_z_offset)
| Sets workspace_z_offset property value. More...
double | workspace_z_offset () const
| Gets workspace_z_offset property value. More...
void | Setworkspace_x_size (double _arg_workspace_x_size)
| Sets workspace_x_size property value. More...
double | workspace_x_size () const
| Gets workspace_x_size property value. More...
void | Setworkspace_y_size (double _arg_workspace_y_size)
| Sets workspace_y_size property value. More...
double | workspace_y_size () const
| Gets workspace_y_size property value. More...
void | Setobject_height (double _arg_object_height)
| Sets object_height property value. More...
double | object_height () const
| Gets object_height property value. More...
void | Setminimum_object_area (int _arg_minimum_object_area)
| Sets minimum_object_area property value. More...
int | minimum_object_area () const
| Gets minimum_object_area property value. More...
void | Setmaximum_object_area (int _arg_maximum_object_area)
| Sets maximum_object_area property value. More...
int | maximum_object_area () const
| Gets maximum_object_area property value. More...
void | Setbackground_filename (QString _arg_background_filename)
| Sets background_filename property value. More...
QString | background_filename () const
| Gets background_filename property value. More...
| Processor_ObjectExtraction ()
| Initializes default parameters. More...
void | screenshot (const QString &filename)
| Takes a screenshot of current scene, and logs objects info. More...
int | start ()
| Starts image processing. More...
int | process (int t1, int t2)
| Processes frames in input buffer. More...
int | processSpecial (string s)
| Processes special command. More...
int | stop ()
| Stops image processing. More...
virtual void | writeXml (QXmlStreamWriter &stream)
| Writes properties to XML stream and current background model to a file specified by background_filename. More...
virtual void | readXml (QXmlStreamReader &stream)
| Reads properties from XML stream and current background model to a file specified by background_filename. More...
Public Member Functions inherited from Processor
| Processor ()
| Starts internal clock. More...
Public Member Functions inherited from cXmlIO
| cXmlIO (int _xmlID=0, QObject *parent=nullptr)
virtual QString | sXmlKey ()
| Generates key of XML entry (as name of the serialised class is) More...
virtual void | findInXML (QString &fileName, bool compareXmlID=true)
| serches th file for XML key corr to class name and fill class properties according to entries found More...
virtual void | writeCsvData (QXmlStreamWriter &stream, QString key, const QVector< QVector< double > > &s)
virtual void | writeCsvVector (QXmlStreamWriter &stream, QString key, const QVector< double > &s)
virtual void | readCsvData (QXmlStreamReader &stream, QVector< QVector< double > > &s)
virtual void | readCsvVector (QXmlStreamReader &stream, QVector< double > &s)
virtual void | write64BaseData (QXmlStreamWriter &stream, QString key, const QVector< QVector< double > > &s)
virtual void | read64BaseData (QXmlStreamReader &stream, QVector< QVector< double > > &s)
template<typename T >
void | writeData (QXmlStreamWriter &stream, QString key, const T &data)
template<typename T >
void | readData (QXmlStreamReader &stream, T &data)
int | getXmlID () const
void | setXmlID (int value)

## Properties
int | median_khalfsize
| Half of window size applied to foreground extraction mask. More...
double | workspace_x_offset
| Offset between lower-left chessboard corner crossing and workspace origin in x axis, in meters. More...
double | workspace_y_offset
| Offset between lower-left chessboard corner crossing and workspace origin in y axis, in meters. More...
double | workspace_z_offset
| Offset between lower-left chessboard corner crossing and workspace origin in z axis, in meters. More...
double | workspace_x_size
| Workspace size along x axis, in meters. More...
double | workspace_y_size
| Workspace size along y axis, in meters. More...
double | object_height
| Picked object height, in meters. More...
int | minimum_object_area
| Minimum detected object area, in pixels. More...
int | maximum_object_area
| Maximum detected object area, in pixels. More...
QString | background_filename
| Background model filename. More...
Properties inherited from cXmlIO
int | xmlID
| Defines uniqe identifier for object in XML file. More...

## Additional Inherited Members
Public Types inherited from Processor
Static Public Member Functions inherited from cXmlIO
static void | metaCopy (QObject *dest, QObject *src)
Public Attributes inherited from Processor
InputType | inputType
| Processor input data type. More...
vector< cv::Mat * > | inputMat
| Vector of input images. More...
vector< vector< cv::Point2f > * > | inputPoint2
| Vector of input series of 2D points. More...
vector< vector< cv::Point3d > * > | inputPoint3
| Vector of input series of 3D points. More...
vector< QString * > | cameraName
| Vector of pointers to connected cameras names. More...
vector< cv::Mat * > | outputMat
| Vector of output images. More...
vector< vector< cv::Point2f > * > | outputPoint2
| Vector of output series of 2D points. More...
vector< vector< cv::Point3d > * > | outputPoint3
| Vector of input series of 3D points. More...
QTime | m_time
| Internal clock. More...
Protected Member Functions inherited from cXmlIO
void | metaDataXmlReader (QXmlStreamReader &stream, QObject &obj, bool isUser=true)
void | metaDataXmlWriter (QXmlStreamWriter &stream, const QObject &obj, bool isUser=true)

## Detailed Description

Object extraction image processor.

Performs object extraction based on an internal background model.

Detects center of gravity of selected objects and performs rectangle fitting resulting in width, height and angle of extracted object.

After receiving object coordinates in pixels through processSpecial, if an object is found at given coordinates, calculates physical properties, position and angle of object to pick and emits pickObject signal.

## Constructor & Destructor Documentation

Processor_ObjectExtraction | ( |  | ) |

Initializes default parameters.

## Member Function Documentation

QString background_filename | ( |  | ) | const

Gets background_filename property value.

int maximum_object_area | ( |  | ) | const

Gets maximum_object_area property value.

int median_khalfsize | ( |  | ) | const

Gets median_khalfsize property value.

int minimum_object_area | ( |  | ) | const

Gets minimum_object_area property value.

void object_data | ( | cv::Mat | image,
|  | QVector< sObject > | objects
| ) |  |
| signal

double object_height | ( |  | ) | const

Gets object_height property value.

void pickObject | ( | QVector3D | pointInMeters,
|  | float | object_height,
|  | float | angle,
|  | int | bin
| ) |  |
| signal

Emitted after successful selection of an object to pick and place into a bin

Parameters

  pointInMeters | Position of object to pick in workspace coordinates (in meters)
  angle | Angle of short side of fitted rectangle
  bin | ID of bin to put the object into

int process | ( | int | t1,
|  | int | t2
| ) |  |
| virtual

Processes frames in input buffer.

Parameters

  t1 | Cameras trigger time
  t2 | Cameras acquisition finish time

Returns
  0 on success

Reimplemented from Processor.

int processSpecial | ( | string | s | ) |
| virtual

Processes special command.

Valid commands are:
get_background: calculates background based on next frame
save_background: saves current background model to a file specified by background_filename
load_background: reads background model from a file specified by background_filename
object_picked x y: if an object is detected at x, y pixel coordinates, emits pickObject on success

Parameters

  s | Command string

Returns
  0 on success

Reimplemented from Processor.

virtual void readXml | ( | QXmlStreamReader & | stream | ) |
| virtual

Reads properties from XML stream and current background model to a file specified by background_filename.

Parameters

  stream | XML stream to read from

Reimplemented from cXmlIO.

void screenshot | ( | const QString & | filename | ) |

Takes a screenshot of current scene, and logs objects info.

void Setbackground_filename | ( | QString | _arg_background_filename | ) |

Sets background_filename property value.

void Setmaximum_object_area | ( | int | _arg_maximum_object_area | ) |

Sets maximum_object_area property value.

void Setmedian_khalfsize | ( | int | _arg_median_khalfsize | ) |

Sets median_khalfsize property value.

void Setminimum_object_area | ( | int | _arg_minimum_object_area | ) |

Sets minimum_object_area property value.

void Setobject_height | ( | double | _arg_object_height | ) |

Sets object_height property value.

void Setworkspace_x_offset | ( | double | _arg_workspace_x_offset | ) |

Sets workspace_x_offset property value.

void Setworkspace_x_size | ( | double | _arg_workspace_x_size | ) |

Sets workspace_x_size property value.

void Setworkspace_y_offset | ( | double | _arg_workspace_y_offset | ) |

Sets workspace_y_offset property value.

void Setworkspace_y_size | ( | double | _arg_workspace_y_size | ) |

Sets workspace_y_size property value.

void Setworkspace_z_offset | ( | double | _arg_workspace_z_offset | ) |

Sets workspace_z_offset property value.

int start | ( |  | ) |
| virtual

Starts image processing.

Returns
  0 on success

Reimplemented from Processor.

int stop | ( |  | ) |
| virtual

Stops image processing.

Returns
  0 on success

Reimplemented from Processor.

double workspace_x_offset | ( |  | ) | const

Gets workspace_x_offset property value.

double workspace_x_size | ( |  | ) | const

Gets workspace_x_size property value.

double workspace_y_offset | ( |  | ) | const

Gets workspace_y_offset property value.

double workspace_y_size | ( |  | ) | const

Gets workspace_y_size property value.

double workspace_z_offset | ( |  | ) | const

Gets workspace_z_offset property value.

virtual void writeXml | ( | QXmlStreamWriter & | stream | ) |
| virtual

Writes properties to XML stream and current background model to a file specified by background_filename.

Parameters

  stream | XML stream to write to

Reimplemented from cXmlIO.

## Property Documentation

QString background_filename
| read write

Background model filename.

int maximum_object_area
| read write

Maximum detected object area, in pixels.

int median_khalfsize
| read write

Half of window size applied to foreground extraction mask.

int minimum_object_area
| read write

Minimum detected object area, in pixels.

double object_height
| read write

Picked object height, in meters.

double workspace_x_offset
| read write

Offset between lower-left chessboard corner crossing and workspace origin in x axis, in meters.

double workspace_x_size
| read write

Workspace size along x axis, in meters.

double workspace_y_offset
| read write

Offset between lower-left chessboard corner crossing and workspace origin in y axis, in meters.

double workspace_y_size
| read write

Workspace size along y axis, in meters.

double workspace_z_offset
| read write

Offset between lower-left chessboard corner crossing and workspace origin in z axis, in meters.

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

- processors/Processor_ObjectExtraction.h