Apply a pixelwise random noise to the image pixels type (string): Distribution of the noise ('uniform', 'gaussian', 'gamma') random_range (double): The generated noise level: For 'uniform': noise is drawn in [-intensity, intensity] For 'gaussian': noise is drawn from a Gaussian with zero mean and standard deviation equal to intensity For 'gamma': noise is drawn from a Gamma distribution with k = theta = intensity (note that this noise has a mean of 1.0 so it is biased) For 'shot': noise is drawn from a Gaussian with zero mean and standard deviation equal to intensity * sqrt(pixelValue) probability (double): Value in [0.0; 1.0] indicating the probability of this operation to be performed.
More...
Apply a pixelwise random noise to the image pixels type (string): Distribution of the noise ('uniform', 'gaussian', 'gamma') random_range (double): The generated noise level: For 'uniform': noise is drawn in [-intensity, intensity] For 'gaussian': noise is drawn from a Gaussian with zero mean and standard deviation equal to intensity For 'gamma': noise is drawn from a Gamma distribution with k = theta = intensity (note that this noise has a mean of 1.0 so it is biased) For 'shot': noise is drawn from a Gaussian with zero mean and standard deviation equal to intensity * sqrt(pixelValue) probability (double): Value in [0.0; 1.0] indicating the probability of this operation to be performed.
|
| AddRandomNoiseOperation (const std::string &type="uniform", double intensity=0.0, double probability=1.0) |
|
std::shared_ptr< SharedImageSet > | processImages (std::shared_ptr< SharedImageSet > input) const override |
| Virtual function that every subclass should override.
|
|
std::shared_ptr< SharedImageSet > | processVectors (std::shared_ptr< SharedImageSet > input) const override |
| Virtual function that every subclass should override.
|
|
bool | configure (const Properties &properties) override |
| Configure an Operation with the given properties and return whether the configuration was successful.
|
|
Properties | configuration () const override |
| Return the Operation configuration.
|
|
bool | doesNotModifyInput () const override |
| Returns whether the operation is guaranteed to not modify its input element, either because it computes its output out-of-place or because it is a no-op.
|
|
| Operation (std::string name, ProcessingPolicy processingPolicy) |
| Derived classes must specify a name and whether, by default, the operation should also be applied to label maps.
|
|
virtual void | process (DataItem &item) |
| Main function that processes a DataItem in-place, may throw OperationException The data to be processed is determined by the active fields (if set) and the processing policy otherwise (if set), otherwise all fields are processed.
|
|
virtual std::shared_ptr< SharedImageSet > | process (std::shared_ptr< SharedImageSet > input) |
| Utility function to directly apply an operation on a SharedImageSet irrespective of active fields and processing policy.
|
|
virtual std::shared_ptr< KeypointSet > | process (std::shared_ptr< KeypointSet > input) |
| Utility function to directly apply an operation on a set of KeypointSet irrespective of active fields and processing policy.
|
|
virtual std::shared_ptr< BoundingBoxSet > | process (std::shared_ptr< BoundingBoxSet > input) |
| Utility function to directly apply an operation on a set of BoundingBoxSet irrespective of active fields and processing policy.
|
|
virtual std::unique_ptr< SharedImageSet > | process (std::unique_ptr< SharedImageSet > input) final |
| Utility function with unique_ptr as input and output to avoid breaking changes (must not be overridden)
|
|
void | addTemporaryPreProcessHook (PreProcessHook hook) |
| Add a temporary hook that will only be active for the next process call and then automatically removed after the DataItem is processed.
|
|
void | addTemporaryPostProcessHook (PostProcessHook hook) |
| Add a temporary hook that will only be active for the next process call and then automatically removed after the DataItem is processed.
|
|
virtual bool | checkRequiredItemsTypes (const DataItem &item) const |
| Checks if the data item holds fields with types required by the operation.
|
|
const std::string & | name () const |
| Returns the name of the operation.
|
|
void | setActiveFields (std::optional< std::unordered_set< std::string > > activeFields) |
|
std::optional< std::unordered_set< std::string > > | activeFields () const |
|
virtual void | setProcessingPolicy (ProcessingPolicy policy) |
|
ProcessingPolicy | processingPolicy () const |
|
std::optional< uint32_t > | seed () const |
| Return the current seed (if there is one)
|
|
virtual void | seedRandomEngine (uint32_t seed) |
| Set a seed for the random generator.
|
|
ML::ComputingDevice | computingDevice () const |
| Get the computing device.
|
|
virtual void | setComputingDevice (ML::ComputingDevice device) |
| Set the computing device selection strategy.
|
|
void | configFailed (const std::string &missingParam) const |
| Helper function to show an error message due to a bad configuration.
|
|
void | logDeprecatedParam (const std::string &oldName, const std::string &newName) const |
| Helper function to print a warning because of a deprecated parameter has been specified.
|
|
bool | errorOnUnexpectedBehaviour () const |
| Get the policy whether to treat unexpected behavior warnings as errors.
|
|
virtual void | setErrorOnUnexpectedBehaviour (bool error) |
| Treat unexpected behavior warnings as errors.
|
|
void | registerParameter (ParameterBase *param) |
| Register a parameter so that the operation knows about it, and can automatically configure it (unless it has been marked as manually configured parameter via the Operation::setManuallyConfiguredParameters method).
|
|
std::vector< ParameterBase * > | parameters () const |
| Return the list of registered parameters.
|
|
virtual bool | supportsInversion () const |
| Whether the operation supports inversion. Returns False unless the operation derives from InvertibleOperation .
|
|
const std::string & | recordIdentifier () const |
| Get the operation's record identifier.
|
|
virtual void | setRecordIdentifier (const std::string &recordIdentifier) |
| Set the operation's record identifier.
|
|
const std::string & | logDomain () const |
| Log domain for AdvancedParameter.
|
|
std::optional< std::unordered_set< std::string > > | selectedFields (const DataItem &item) |
| Get the fields on which the operation will be applied.
|
|