Skip to content

bioinspired_TransientAreasSegmentationModule

bioinspiredclassOpenCV 5.0.0
import { bioinspired_TransientAreasSegmentationModule } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSConstructor or factory
CLASSbioinspired_TransientAreasSegmentationModule
RETURN TYPEOwned native handle
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Native object: release it with using or delete(). Factories can return null; check before calling methods. Inherits Algorithm.

class which provides a transient/moving areas segmentation module

perform a locally adapted segmentation by using the retina magno input data Based on Alexandre BENOIT thesis: "Le système visuel humain au secours de la vision par ordinateur"

3 spatio temporal filters are used:

  • a first one which filters the noise and local variations of the input motion energy
  • a second (more powerfull low pass spatial filter) which gives the neighborhood motion energy the segmentation consists in the comparison of these both outputs, if the local motion energy is higher to the neighborhood otion energy, then the area is considered as moving and is segmented
  • a stronger third low pass filter helps decision by providing a smooth information about the "motion context" in a wider area

Constructors and members

static create

bioinspired_TransientAreasSegmentationModule.create: allocator

create(inputSize: Size): bioinspired_TransientAreasSegmentationModule | null;
inputSize

: size of the images input to segment (output will be the same size)

Returns

The bioinspired_TransientAreasSegmentationModule | null result.

clone

Create another handle to the same native object. This retains the object without copying its pixels or algorithm state; dispose both handles separately.

clone(): this;
Returns

The this result.

getSize

return the sze of the manage input and output images

getSize(): Size;
Returns

The Size result.

setup

try to open an XML segmentation parameters file to adjust current segmentation instance setup

- if the xml file does not exist, then default setup is applied
- warning, Exceptions are thrown if read XML file is not valid
setup(segmentationParameterFile: EmbindString, applyDefaultSetupOnFailure: boolean): void;
3 available overloads
setup(): void;
setup(segmentationParameterFile: EmbindString): void;
setup(segmentationParameterFile: EmbindString, applyDefaultSetupOnFailure: boolean): void;
segmentationParameterFile

: the parameters filename

applyDefaultSetupOnFailure

: set to true if an error must be thrown on error

printSetup

parameters setup display method

printSetup(): string;
Returns

a string which contains formatted parameters information

write

write xml/yml formated parameters information

write(fs: EmbindString): void;
fs

: the filename of the xml file that will be open and writen with formatted parameters information

run

main processing method, get result using methods getSegmentationPicture()

run(inputToSegment: Mat, channelIndex: number): void;
2 available overloads
run(inputToSegment: Mat): void;
run(inputToSegment: Mat, channelIndex: number): void;
inputToSegment

: the image to process, it must match the instance buffer size !

channelIndex

: the channel to process in case of multichannel images

getSegmentationPicture

access function return the last segmentation result: a boolean picture which is resampled between 0 and 255 for a display purpose

getSegmentationPicture(transientAreas: Mat): void;
transientAreas

Output destination, filled by the native operation. transient areas argument (Mat).

clearAllBuffers

cleans all the buffers of the instance

clearAllBuffers(): void;

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.