Industrial Calibration  1.0.0
Loading...
Searching...
No Matches
industrial_calibration::CameraCalibrationDataManagerWidget Class Reference

Widget for loading and managing a 2D image calibration data set. More...

Detailed Description

This widget loads a 2D image calibration data set from a YAML file. The calibration data set is stored internally in the widget in a QTreeWidget. Each observation in the data set is stored as a QTreeWidgetItem, where the image file name is stored as data under the IMAGE_FILE_NAME_ROLE role and the pose file name is stored as data under the POSE_FILE_NAME_ROLE role. The observation QTreeWidgetItem has two child items:

  • The number of features detected in the target (child item at index IDX_FEATURES)
  • The homography error of the detected target (child item at index IDX_HOMOGRAPHY)

The TargetFinder used for calibration and CameraIntrinsics must be also be configured in the widget in order to detect the calibration target in the images.

When an image is selected, this widget attempts to detect the Target in the image using the configured TargetDetector. If the target is found. the widget emits the imageSelected signal with an image where the target features are drawn on the image. Otherwise, the widget emits the imageSelected signal with the original observation image.

#include <camera_calibration_data_manager_widget.h>

Inheritance diagram for industrial_calibration::CameraCalibrationDataManagerWidget:

Signals

void imageSelected (const QPixmap &image)
 Signal emitted when an observation is selected in the tree widget.
 

Public Member Functions

 CameraCalibrationDataManagerWidget (QWidget *parent=nullptr)
 
void loadObservations (const std::string &observations_file)
 Loads the calibration observations from file.
 
QTreeWidget * getTreeWidget () const
 

Public Attributes

QAction * action_load_observations
 
QAction * action_edit_target_finder
 
QAction * action_edit_camera_intrinsics
 

Protected Member Functions

void closeEvent (QCloseEvent *event) override
 
void onLoadObservations ()
 
void loadTargetFinder ()
 
void drawImage (QTreeWidgetItem *item, int col)
 

Static Protected Member Functions

static QPixmap toQt (const cv::Mat &image)
 helper function for converting an OpenCV image to a Qt pixmap
 
static void info (QTreeWidgetItem *item, const QString &message)
 helper function for showing an info message with a tree item
 
static void error (QTreeWidgetItem *item, const QString &message)
 helper function for showing an error message with a tree item
 

Protected Attributes

Ui::CameraCalibrationDataManager * ui_
 
TargetFinderWidgettarget_finder_widget_
 
CameraIntrinsicsWidgetcamera_intrinsics_widget_
 
boost_plugin_loader::PluginLoader loader_
 
TargetFinderFactoryOpenCV::ConstPtr factory_
 
TargetFinderOpenCV::ConstPtr target_finder_
 

Static Protected Attributes

static const unsigned RANDOM_SEED = 1
 Random seed used for homography analysis.
 
static const int IMAGE_FILE_NAME_ROLE = Qt::UserRole + 1
 Role for image file in tree widget.
 
static const int POSE_FILE_NAME_ROLE = Qt::UserRole + 2
 Role for pose file in tree widget.
 
static const int IDX_FEATURES = 0
 Data index of the detected target feature count inside a tree widget item.
 
static const int IDX_HOMOGRAPHY = 1
 Data index of the homography error inside a tree widget item.
 

Member Function Documentation

◆ loadObservations()

void industrial_calibration::CameraCalibrationDataManagerWidget::loadObservations ( const std::string &  observations_file)

See the file formats for extrinsic hand eye calibration and camera intrinsic calibration

Exceptions
Exceptionon failure

◆ imageSelected

void industrial_calibration::CameraCalibrationDataManagerWidget::imageSelected ( const QPixmap &  image)
signal

If the target can be identified in the image associated with the observation, the signal provides that image with the detected target drawn on it. Otherwise, the signal provides the original observation image.