Interfaces and types for CV nodes

hey all

If you’re interested in the EmguCV development, then perhaps it’s worth getting in on a discussion about what it should be from a developers point of view.

Currently i’m envisaging 2 custom types to start with:

  • ImageRGB
  • ImageGreyscale
    both to inherit from IImage interface/abstract base

I’ve listed a set of suggested nodes on the github readme.

One big question is about threading the graph

Currently the IImage type contains a flag to let the next node whether there’s been any changes, and if the image is available. This could be replaced by an event.
e.g.
VideoIn has 3 threads - main, capture, processing
The main thread is run under VVVV and allows property changes/etc
The capture thread pulls frames into an internal buffer
The processing thread invokes the ‘FrameReady’ event and lets downward nodes to act on the data.

Node B is connected to VideoIn.
When VideoIn receives a new frame, it triggers a function inside Node B through events (i.e. the processing inside Node B happens inside VideoIn’s processing thread).

Then Node B has an internal buffer and it’s own processing thread which invokes the processing in Node C

Cleaner (in terms of caching):
Node C has a thread running at 60fps.
In the thread it asks Node B if a new frame is ready, at which point Node B asks VideoIn if there’s a fresh frame.
If the chain is stale (i.e. no new processing is needed), Node C sleeps for 1/60s (minus processing time)
But obviously the 1/60s thread is a bit inelegant.

If Node C only pulls on a render event, then everything happens in the main event again (no performance increase, but no extra buffering).