---
layout: default-layout
title: MultiFrameResultCrossFilter Class - Dynamsoft Capture Vision Flutter
description: MultiFrameResultCrossFilter class of DCV Flutter provides a filter for managing and filtering results.
keywords: filter, capture vision, barcode reader, flutter, multiframeresultcrossfilter, result
needGenerateH3Content: true
needAutoGenerateSidebar: true
noTitleIndex: true
---

# MultiFrameResultCrossFilter

The `MultiFrameResultCrossFilter` class is an officially implemented `CapturedResultFilter` that provides:

- **Overlapping**: Improves the read rate of multi-barcode scanning.
- **Cross Verification**: Improves the accuracy.
- **Deduplication**: Removes the duplicated results.

## Definition

*Assembly:* dynamsoft_capture_vision_flutter

```dart
class MultiFrameResultCrossFilter
```

## Methods

| Method | Description |
| ------ | ----------- |
| [`destroy`](#destroy) | Destroys the `MultiFrameResultCrossFilter` instance and releases the related resources on the native side. |
| [`enableLatestOverlapping`](#enablelatestoverlapping) | Enables or disables the latest overlap result filtering. |
| [`enableResultCrossVerification`](#enableresultcrossverification) | Enables or disables result cross verification for the specified result item types. |
| [`enableResultDeduplication`](#enableresultdeduplication) | Enables or disables result deduplication for the specified result item types. |
| [`getDuplicateForgetTime`](#getduplicateforgettime) | Returns the amount of time that the deduplication filter takes effect for the specified result item type(s). |
| [`getMaxOverlappingFrames`](#getmaxoverlappingframes) | Returns the maximum number of overlapping frames to check for the specified result item type(s). |
| [`isLatestOverlappingEnabled`](#islatestoverlappingenabled) | Checks if the latest overlapping filter is on for the specified result item type(s). |
| [`isResultCrossVerificationEnabled`](#isresultcrossverificationenabled) | Checks if the cross verification filter is on for the specified result item type(s). |
| [`isResultDeduplicationEnabled`](#isresultdeduplicationenabled) | Checks if the deduplication filter is on for the specified result item type(s). |
| [`setDuplicateForgetTime`](#setduplicateforgettime) | Defines the amount of time that the deduplication filter takes effect for the specified result item type(s). |
| [`setMaxOverlappingFrames`](#setmaxoverlappingframes) | Sets the maximum number of overlapping frames to check when the latest overlap filter is on. |
| [`setResultCrossVerificationCriteria`](#setresultcrossverificationcriteria) | Sets the cross-verification criteria for specified result item types. |
| [`getResultCrossVerificationCriteria`](#getresultcrossverificationcriteria) | Gets the cross-verification criteria for a specified result item type. |

### destroy

Destroys the `MultiFrameResultCrossFilter` instance and releases the related resources on the native side.

```dart
Future<void> destroy()
```

### enableLatestOverlapping

Enables or disables the latest overlap result filtering. Latest overlap filtering helps in managing results that overlap in the most recent frames.

```dart
Future<void> enableLatestOverlapping(int resultItemTypes, bool enable)
```

**Remarks**

`resultItemTypes` is a bitmask representing the result item types to apply the filter to - this value can be a combined value of [`EnumCapturedResultItemType`](../core/enum/captured-result-item-type.md). `enable` determines whether to enable or disable the filter process.

### enableResultCrossVerification

Enables or disables result cross verification for the specified result item types (represented as a combination of [`EnumCapturedResultItemType`](../core/enum/captured-result-item-type.md)). Cross verification helps in validating results across multiple frames, improving accuracy as a result.

```dart
Future<void> enableResultCrossVerification(int resultItemTypes, bool enable)
```

**Remarks**

`resultItemTypes` is a bitmask representing the result item types to apply the filter to - this value can be a combined value of [`EnumCapturedResultItemType`](../core/enum/captured-result-item-type.md). `enable` determines whether to enable or disable the filter process.

> [!Note]
> 
> The verification is enabled by default for `textLine` & `detectedQuad` type result items.

### enableResultDeduplication

Enables or disables result deduplication for the specified result item types (represented as a combination of [`EnumCapturedResultItemType`](../core/enum/captured-result-item-type.md)). If this filter is activated, the library will not scan a barcode for an amount of time again after it is scanned successfully for the first time. In order to set the amount of time that the barcode is remembered, please refer to `setDuplicateForgetTime`.

```dart
Future<void> enableResultDeduplication(int resultItemTypes, bool enable)
```

**Remarks**

`resultItemTypes` is a bitmask representing the result item types to apply the filter to - this value can be a combined value of [`EnumCapturedResultItemType`](../core/enum/captured-result-item-type.md). `enable` determines whether to enable or disable the filter process.

Result deduplication is disabled by default. You can enable it and adjust the `DuplicateForgetTime` based on your requirements.

### getDuplicateForgetTime

Returns the amount of time, in *milliseconds*, that the deduplication filter takes effect for the specified result item type(s).

```dart
Future<int> getDuplicateForgetTime(int type)
```

**Remarks**

`type` is a bitmask representing the result item types to apply the filter to - this value can be a combined value of [`EnumCapturedResultItemType`](../core/enum/captured-result-item-type.md).

### getMaxOverlappingFrames

Returns the maximum number of overlapping frames to check for the specified result item type(s) when the latest overlap filter is on.

```dart
Future<int> getMaxOverlappingFrames(int type)
```

**Remarks**

`type` is a bitmask representing the result item types to apply the filter to - this value can be a combined value of [`EnumCapturedResultItemType`](../core/enum/captured-result-item-type.md).

### isLatestOverlappingEnabled

Checks if the latest overlapping filter is on for the specified result item type(s).

```dart
Future<bool> isLatestOverlappingEnabled(int type)
```

**Remarks**

`type` is a bitmask representing the result item types to apply the filter to - this value can be a combined value of [`EnumCapturedResultItemType`](../core/enum/captured-result-item-type.md).

### isResultCrossVerificationEnabled

Checks if the cross verification filter is on for the specified result item type(s).

```dart
Future<bool> isResultCrossVerificationEnabled(int type)
```

**Remarks**

`type` is a bitmask representing the result item types to apply the filter to - this value can be a combined value of [`EnumCapturedResultItemType`](../core/enum/captured-result-item-type.md).

### isResultDeduplicationEnabled

Checks if the deduplication filter is on for the specified result item type(s).

```dart
Future<bool> isResultDeduplicationEnabled(int type)
```

**Remarks**

`type` is a bitmask representing the result item types to apply the filter to - this value can be a combined value of [`EnumCapturedResultItemType`](../core/enum/captured-result-item-type.md).

### setDuplicateForgetTime

Defines the amount of time, in *milliseconds*, that the deduplication filter takes effect for the specified result item type(s). During this time, the library will not scan a certain barcode for the specified time after it has been scanned successfully for the first time.

```dart
Future<void> setDuplicateForgetTime(int resultItemTypes, int time)
```

**Remarks**

`resultItemTypes` is a bitmask representing the result item types to apply the filter to - this value can be a combined value of [`EnumCapturedResultItemType`](../core/enum/captured-result-item-type.md). `time` specifies the target time in *milliseconds*.

The default value is 3,000 milliseconds. This means that when result deduplication is enabled, identical results appearing within 3 seconds of each other will be filtered out by default. The maximum allowed value is 180,000 milliseconds.

### setMaxOverlappingFrames

Sets the maximum number of overlapping frames to check when the latest overlap filter is on for the specified result item type(s).

```dart
Future<void> setMaxOverlappingFrames(int resultItemTypes, int maxFramesToCheck)
```

**Remarks**

`resultItemTypes` is a bitmask representing the result item types to apply the filter to - this value can be a combined value of [`EnumCapturedResultItemType`](../core/enum/captured-result-item-type.md). `maxFramesToCheck` specifies the target number of frames that the filter should not exceed.

## Code Snippet

```dart
final MultiFrameResultCrossFilter _multiFilter = MultiFrameResultCrossFilter();
_multiFilter.enableResultCrossVerification(EnumCapturedResultItemType.barcode.value, true);
_multiFilter.enableResultDeduplication(EnumCapturedResultItemType.barcode.value, true);
_multiFilter.enableLatestOverlapping(EnumCapturedResultItemType.barcode.value, true);
_multiFilter.setMaxOverlappingFrames(EnumCapturedResultItemType.barcode.value, 5);
_multiFilter.setDuplicateForgetTime(EnumCapturedResultItemType.barcode.value, 5000);
_cvr.addResultFilter(_multiFilter);
```

### setResultCrossVerificationCriteria

Sets the cross-verification criteria for specified result item types. This function allows customization of the multi-frame verification parameters, controlling how many frames are analyzed and how many consistent results are required.

```dart
Future<void> setResultCrossVerificationCriteria(int resultItemTypes, CrossVerificationCriteria criteria);
```

**Parameters**

`[in] resultItemTypes`: Specifies the result item types with [`CapturedResultItemType`]({{ site.dcv_flutter_api }}core/enum/captured-result-item-type.html).

`[in] criteria`: Specifies the cross-verification criteria with a [`CrossVerificationCriteria`]({{ site.dcv_flutter_api }}utility/cross-verification-criteria.html) object.

**Remarks**

The default criteria per result type are:

| Result Type | `frameWindow` | `minConsistentFrames` |
| --- | --- | --- |
| Barcode (DBR) | 5 | 2 |
| Text Line (DLR) | 5 | 2 |
| Detected Quad / Deskewed Image (DDN) | 6 | 4 |

### getResultCrossVerificationCriteria

Gets the cross-verification criteria for a specified result item type.

```dart
Future<CrossVerificationCriteria> getResultCrossVerificationCriteria(int type) async;
```

**Parameters**

`[in] type`: Specifies the result item type with [`CapturedResultItemType`]({{ site.dcv_flutter_api }}core/enum/captured-result-item-type.html).

**Return Value**

The cross-verification criteria for the specified result item type, of type [`CrossVerificationCriteria`]({{ site.dcv_flutter_api }}utility/cross-verification-criteria.html).
