# DL_DetectFeatures

Executes a Detect Features model on a single input image.

### Syntax

void avl::DL_DetectFeatures
(
const avl::Image& inImage,
atl::Optional<const avl::Region&> inRoi,
const avl::DetectFeaturesModelId& inModelId,
const bool inOverlap,
atl::Array<avl::Heatmap>& outHeatmaps,
atl::Optional<avl::Heatmap&> outFeature1 = atl::NIL,
atl::Optional<avl::Heatmap&> outFeature2 = atl::NIL,
atl::Optional<avl::Heatmap&> outFeature3 = atl::NIL,
atl::Optional<avl::Heatmap&> outFeature4 = atl::NIL
)


### Parameters

Name Type Default Description
inImage const Image& Input image
inRoi Optional<const Region&> NIL Limits an area where features may be detected
inModelId const DetectFeaturesModelId& Identifier of a Detect Features model
inOverlap const bool True Cuts the image into more overlapping tiles, which improves results quality at the expense of extended execution time
outHeatmaps Array<Heatmap>& Returns heatmaps for all classes defined in the model
outFeature1 Optional<Heatmap&> NIL Returns the heatmap for the first feature class
outFeature2 Optional<Heatmap&> NIL Returns the heatmap for the second feature class or an empty image if the model does not define more than one class
outFeature3 Optional<Heatmap&> NIL Returns the heatmap for the third feature class or an empty image if the model does not define more than two classes
outFeature4 Optional<Heatmap&> NIL Returns the heatmap for the fourth feature class or an empty image if the model does not define more than three classes

### Requirements

For input inImage only pixel formats are supported: 1⨯uint8, 3⨯uint8.

### Optional Outputs

The computation of following outputs can be switched off by passing value atl::NIL to these parameters: outFeature1, outFeature2, outFeature3, outFeature4.

### Hints

• It is recommended that the deep learning model is deployed with DL_DetectFeatures_Deploy first and connected through the inModelId input.
• If one decides not to use DL_DetectFeatures_Deploy, then the model will be loaded in the first iteration. It will take up to several seconds.
• Use inOverlap=False to increase execution speed at a cost of lower precision of results.

### Remarks

This filter should not be executed along with running Deep Learning Service as it may result in degraded performance or even out-of-memory errors. However, if stopping Deep Learning Service is not an option (e.g. program uses other Deep Learning filters related to Instances Segmentation) it is advised that this filter should be executed at least once before performing operations utilizing Deep Learning Service (e.g. executing filters related to Instances Segmentation). Such "warm up" execution does not have to use real image or roi as long as provided image and roi have similar size.

### Errors

List of possible exceptions:

Error type Description
DomainError Not supported inImage pixel format in DL_DetectFeatures.