Home > Forum > MediaBlocks Motion Detection

MediaBlocks Motion Detection

Apr 03, 2024
Ken wrote
The MediaBlocks features page says that MotionBlocks supports motion detection. However, the online help for MediaBlocks does not have a topic regarding this. I do see it for the Video Capture SDK, but not MediaBlocks.

Is motion supported? If so, how do I get started?

I don't know if I'm missing something, if the online help is missing something, or if the features page is incorrect.
Reply
3 Answers
Apr 04, 2024
Roman Miniailov agent wrote
Hi

Yes, our document is not full sometimes. I'm sorry.

You can use the CVMotionCellsBlock, like:

private CVMotionCellsBlock _motionCells;

and

_motionCells = new CVMotionCellsBlock(new CVMotionCellsSettings());
_motionCells.MotionDetected += _motionCells_MotionDetected;

_pipeline.Connect(_videoSource.Output, _motionCells.Input);
_pipeline.Connect(_motionCells.Output, _videoRenderer.Input);

VisioForge.CrossPlatform.OpenCV.Windows.x64 NuGet package is required. SDK can use OpenCV.
Jul 09 (9 months ago)
Ken wrote
Ater a long delay I am now trying this. I did add the nuget package referenced above (and after failure everything else with VisioForge and OpenCV in the name). If I call CVMotionCellsBlock.IsAvailable() it returns false and I get " [CVMotionCellsBlock][Build] Unable to build CVMotionCellsBlock" failures.

Is there another package I'm missing? Do I need a non-VisioForge package? If I need a non-VisioForge package it is unclear which one.
Jul 09 (9 months ago)
Ken wrote
I guess I sort of figured it out. I had forgotten to add a NullRenderBlock and output the CV block to the null renderer. The strange thing was that for about 30 straight tries IsAvailable() returned false. After I added the null renderer and ran that way once IsAvailable decided to return true every time. I don't think that this is just my imagination.