Main Content

propertiesPanel

Define properties panel for custom pattern detector

Since R2021b

Description

propertiesPanel(detectorObj,panel) displays properties contained in the detector object detecterObj in the parent user interface (UI) panel panel.

The Camera Calibrator or the Stereo Camera Calibrator app invokes the propertiesPanel object function when you select a custom pattern from one of the available patterns. Use this object function to define UI elements in the Properties section of the Image and Pattern Properties dialog box of the Camera Calibrator or the Load Stereo Images dialog box of the Stereo Camera Calibrator app.

example

Examples

collapse all

The propertiesPanel function enables you to customize the properties panel of a calibrator app by creating UI elements and defining their behavior. This propertiesPanel code snippet creates a properties panel related to a checkerboard detection:

function propertiesPanel(this,panel)
  %--------------------------------------------------------------
  % UI components for square size selector 
  %--------------------------------------------------------------
  this.Panel = panel;

  % Label 
      position = [90, 40, 185, 20];
      labelText = 'Square Size (in millimeters): ';
      uicontrol('Parent',this.Panel,'Style','text','FontUnits', ...
                'pixels',FontSize', 12,'Position',position, ...
                'HorizontalAlignment','left','String',labelText);
            
  % Editbox
      position = [275, 37, 50, 25];
      initSquareSize = 25;
      squareSizeEditBox = uicontrol('Parent',this.Panel, ...
                 'Style','edit','FontUnits','pixels','FontSize',15, ...
                 'String',initSquareSize,'Position', position, ...
                 'Callback',@(~, ~) doSquareSizeChanged(this));
            
  % Initialize property values
      this.SquareSize = str2double(get(squareSizeEditBox,'String'));
end

%--------------------------------------------------------------------
function doSquareSizeChanged(this)
   this.SquareSize = str2double(get(this.SquareSizeEditBox,'String'));
         
   if this.SquareSize <= 0 || isnan(this.SquareSize)
      errordlg('Square size must be a numeric value greater than zero.');
   end
end

This function produces this UI pane:

Images and Pattern Properties UI panel.

Input Arguments

collapse all

Detector object, specified as a single or stereo vision.calibration.PatternDetector object.

User-defined UI components for displaying and specifying detector properties, specified as a uipanel object. When you invoke the propertiesPanel function with a uipanel object.

Version History

Introduced in R2021b