Operator Types#

class IOperator#

IOperator Interface for Operator.

An Operator is a data processing unit which can be initialized with list of predefined parameters and can generate list of output properties with specific types for each list of input properties of specific types.

Subclassed by visionflow::opers::AssemblyVerificationFilter, visionflow::opers::AssemblyVerificationInfer, visionflow::opers::AssemblyVerificationLabeler, visionflow::opers::AssemblyVerificationObjectMatcher, visionflow::opers::ClassificationInfer, visionflow::opers::ClassificationLabeler, visionflow::opers::ClassificationVisualizer, visionflow::opers::DetectionInfer, visionflow::opers::DetectionLabeler, visionflow::opers::ImageGrabber, visionflow::opers::IntegrationClassifier, visionflow::opers::LocationFilter, visionflow::opers::LocationInfer, visionflow::opers::LocationLabeler, visionflow::opers::LocationObjectMatcher, visionflow::opers::OCRFilter, visionflow::opers::OCRInfer, visionflow::opers::OCRLabeler, visionflow::opers::OCRStringMatcher, visionflow::opers::PolygonsFilter, visionflow::opers::RegionsMatcher, visionflow::opers::SegmentationFeatureMapFilter, visionflow::opers::SegmentationInfer, visionflow::opers::SegmentationLabeler, visionflow::opers::SegmentationTRTInfer, visionflow::opers::UnsuperClassificationInfer, visionflow::opers::UnsuperClassificationLabeler, visionflow::opers::UnsuperClassificationTRTInfer, visionflow::opers::UnsuperSegmentationInfer, visionflow::opers::UnsuperSegmentationLabeler, visionflow::opers::UnsuperSegmentationTRTInfer, visionflow::opers::ViewFilter, visionflow::opers::ViewTagger, visionflow::opers::ViewTransformer

Public Types

using PropList = std::vector<std::shared_ptr<props::IProperty>>#

Vector of props::IProperty’s shared pointer.

using ParamList = std::vector<std::shared_ptr<param::IParameter>>#

Vector of param::IParameter’s shared pointer.

Public Functions

IOperator &set_io_ids(std::vector<ToolNodeId> input_ids, std::vector<ToolNodeId> output_ids)#

Set the input and output properties ids.

Parameters:
  • input_ids – The input properties ids.

  • output_ids – The output properties ids.

const std::vector<ToolNodeId> &input_prop_ids() const#

Get the input properties ids.

Returns:

NO_DISCARD input properties ids.

const std::vector<ToolNodeId> &output_prop_ids() const#

Get the output properties ids.

Returns:

NO_DISCARD output properties ids.

virtual void initialize(const ParamList &param)#

Interface to initialize the operator with the given parameters. The derived class should implement this method to initialize the operator.

Parameters:

param – List of parameters, all should be derived from param::IParameter.

virtual void execute(ISample &sample) const#

Execute the operator with given sample. By default it dispatches properties to overloaded functions that use a list of properties as arguments.

Parameters:

sample[inout] The sample contains the input and output properties.

virtual void execute(const PropList &inputs, PropList outputs) const#

Initialize the operator with the given properties and generate the output properties. This function is called after the operator is initialized.

Parameters:
  • inputs[in] List of input properties. All properties in the input list is readonly.

  • outputs[out] List of output properties. All output properties are allocated by the caller in advance. The implementer of the Operator can no longer modify the address of the property object in the execute phase, nor can it delete or add a property object, but can only modify the value of each property object.

template<typename OperatorType>
inline const OperatorType &as() const#

Convert the operator into its derived type. Caller should make sure the type is correct. or std::bad_cast will be thrown.

Template Parameters:

OperatorType – The derived class of IOperator.

Returns:

const OperatorType& The derived type of the operator.

InputTool Operators#

class ImageGrabber : public visionflow::opers::IOperator#

Base class of image grabber operator.

Image grabber operator is used to grab image from camera or read image from file.

Subclassed by visionflow::opers::CameraImageGrabber, visionflow::opers::FileImageGrabber

class CameraImageGrabber : public visionflow::opers::ImageGrabber#

Image grabber operator for camera.

class FileImageGrabber : public visionflow::opers::ImageGrabber#

Image grabber operator for file.

Segmentation Operators#

class PolygonsFilter : public visionflow::opers::IOperator#

PolygonsFilter is an operator to filter list of polygon regions with some common thresholds or customized python filter script.

Public Functions

virtual void initialize(const IOperator::ParamList &param) override#

Interface to initialize the operator with the given parameters. The derived class should implement this method to initialize the operator.

Parameters:

param – List of parameters, all should be derived from param::IParameter.

virtual void execute(const IOperator::PropList &inputs, IOperator::PropList outputs) const override#

Initialize the operator with the given properties and generate the output properties. This function is called after the operator is initialized.

Parameters:
  • inputs[in] List of input properties. All properties in the input list is readonly.

  • outputs[out] List of output properties. All output properties are allocated by the caller in advance. The implementer of the Operator can no longer modify the address of the property object in the execute phase, nor can it delete or add a property object, but can only modify the value of each property object.

class SegmentationFeatureMapFilter : public visionflow::opers::IOperator#

Segmentation feature map filter.

Public Functions

virtual void initialize(const IOperator::ParamList &param) override#

Initialize the SegmentationFeatureMapFilter with param FeatureMapFilterParameters which contains thresholds of each class and dilate pixel factor.

Parameters:

param – FeatureMapFilterParameters.

virtual void execute(const IOperator::PropList &inputs, IOperator::PropList outputs) const override#

Filter the input feature maps of Segmentation with FeatureMapFilterParameters and convert the results into PolygonRegionList.

Parameters:
  • inputs – The feature maps of Segmentation.

  • outputs – The PolygonRegionList of the results after filtering.

Throws:

excepts::InvalidArgument – Throws if the parameter outputs is not empty.

class SegmentationLabeler : public visionflow::opers::IOperator#
class RegionsMatcher : public visionflow::opers::IOperator#

Operator to compare the predicted regions with the ground truth to get the category (in [TP, FP, TN, FN]) of each region.

Public Functions

virtual void initialize(const IOperator::ParamList &param) override#

Interface to initialize the operator with the given parameters. The derived class should implement this method to initialize the operator.

Parameters:

param – List of parameters, all should be derived from param::IParameter.

virtual void execute(const IOperator::PropList &inputs, IOperator::PropList outputs) const override#

Initialize the operator with the given properties and generate the output properties. This function is called after the operator is initialized.

Parameters:
  • inputs[in] List of input properties. All properties in the input list is readonly.

  • outputs[out] List of output properties. All output properties are allocated by the caller in advance. The implementer of the Operator can no longer modify the address of the property object in the execute phase, nor can it delete or add a property object, but can only modify the value of each property object.

class SegmentationInfer : public visionflow::opers::IOperator#

Segmentation inference operator.

class SegmentationTRTInfer : public visionflow::opers::IOperator#

Unsuper Segmentation Operators#

class UnsuperSegmentationLabeler : public visionflow::opers::IOperator#
class UnsuperSegmentationInfer : public visionflow::opers::IOperator#
class UnsuperSegmentationTRTInfer : public visionflow::opers::IOperator#

Unsuper Classification Operators#

class UnsuperClassificationLabeler : public visionflow::opers::IOperator#
class UnsuperClassificationInfer : public visionflow::opers::IOperator#
class UnsuperClassificationTRTInfer : public visionflow::opers::IOperator#

OCR Operators#

class OCRFilter : public visionflow::opers::IOperator#

NMS and filter operator for OCR tool.

class OCRInfer : public visionflow::opers::IOperator#

OCR common inference operator.

class OCRLabeler : public visionflow::opers::IOperator#
class OCRStringMatcher : public visionflow::opers::IOperator#

Location Operators#

class LocationFilter : public visionflow::opers::IOperator#

NMS and filter operator for Location tool.

class LocationInfer : public visionflow::opers::IOperator#

Location common inference operator.

class LocationLabeler : public visionflow::opers::IOperator#
class LocationObjectMatcher : public visionflow::opers::IOperator#

AssemblyVerification Operators#

class AssemblyVerificationFilter : public visionflow::opers::IOperator#

NMS and filter operator for AssemblyVerification tool.

class AssemblyVerificationInfer : public visionflow::opers::IOperator#

AssemblyVerification common inference operator.

class AssemblyVerificationLabeler : public visionflow::opers::IOperator#
class AssemblyVerificationObjectMatcher : public visionflow::opers::IOperator#

Classification Operators#

class ClassificationInfer : public visionflow::opers::IOperator#
class ClassificationVisualizer : public visionflow::opers::IOperator#
class ClassificationLabeler : public visionflow::opers::IOperator#

Detection Operators#

class DetectionInfer : public visionflow::opers::IOperator#
class DetectionLabeler : public visionflow::opers::IOperator#

View Transformer Tool#

class ViewFilter : public visionflow::opers::IOperator#

ViewFilter is an operator to filter the defect regions by comparing the evaluation factors such as the score, area, side length, x-y axial length with the parameter set by user. ViewFilter can also figure out the views which contains no defect region.

Public Functions

virtual void initialize(const IOperator::ParamList &param) override#

Interface to initialize the operator with the given parameters. The derived class should implement this method to initialize the operator.

Parameters:

param – List of parameters, all should be derived from param::IParameter.

virtual void execute(const IOperator::PropList &inputs, IOperator::PropList outputs) const override#

Initialize the operator with the given properties and generate the output properties. This function is called after the operator is initialized.

Parameters:
  • inputs[in] List of input properties. All properties in the input list is readonly.

  • outputs[out] List of output properties. All output properties are allocated by the caller in advance. The implementer of the Operator can no longer modify the address of the property object in the execute phase, nor can it delete or add a property object, but can only modify the value of each property object.

class ViewTransformer : public visionflow::opers::IOperator#

ViewTransformer is an operator that transforms the result of the previous tool’s detection output with translation, scaling, rotation, masking and other transformation parameters to obtain new view windows that can be used as input to the next tool.

Public Functions

virtual void initialize(const IOperator::ParamList &param) override#

Interface to initialize the operator with the given parameters. The derived class should implement this method to initialize the operator.

Parameters:

param – List of parameters, all should be derived from param::IParameter.

virtual void execute(const IOperator::PropList &inputs, IOperator::PropList outputs) const override#

Initialize the operator with the given properties and generate the output properties. This function is called after the operator is initialized.

Parameters:
  • inputs[in] List of input properties. All properties in the input list is readonly.

  • outputs[out] List of output properties. All output properties are allocated by the caller in advance. The implementer of the Operator can no longer modify the address of the property object in the execute phase, nor can it delete or add a property object, but can only modify the value of each property object.

Integration Tool#

class IntegrationClassifier : public visionflow::opers::IOperator#

Rule-based classifier for integration tool.

Public Functions

virtual void initialize(const IOperator::ParamList &params) override#

Interface to initialize the operator with the given parameters. The derived class should implement this method to initialize the operator.

Parameters:

param – List of parameters, all should be derived from param::IParameter.

virtual void execute(ISample &sample) const override#

Execute the operator with given sample. By default it dispatches properties to overloaded functions that use a list of properties as arguments.

Parameters:

sample[inout] The sample contains the input and output properties.

opers::Factory#

class Factory : public visionflow::detail::Factory<Meta, IOperator>, public visionflow::detail::CreatorMutableMixin<Meta, Creator>#
struct Meta#

Operator Meta info.

using visionflow::opers::Creator = std::function<std::shared_ptr<IOperator>()>#

Operator creator.

General Operator#

class ViewTagger : public visionflow::opers::IOperator#

ViewTagger adds tags and split_tag to views by compute CIou of TaggedPolygon and View.

Public Functions

virtual void initialize(const IOperator::ParamList &param) override#

Interface to initialize the operator with the given parameters. The derived class should implement this method to initialize the operator.

Parameters:

param – List of parameters, all should be derived from param::IParameter.

virtual void execute(const IOperator::PropList &inputs, IOperator::PropList outputs) const override#

Initialize the operator with the given properties and generate the output properties. This function is called after the operator is initialized.

Parameters:
  • inputs[in] List of input properties. All properties in the input list is readonly.

  • outputs[out] List of output properties. All output properties are allocated by the caller in advance. The implementer of the Operator can no longer modify the address of the property object in the execute phase, nor can it delete or add a property object, but can only modify the value of each property object.