2,599
edits
Efernandez (talk | contribs) |
Efernandez (talk | contribs) |
||
Line 120: | Line 120: | ||
== Process Frames == | == Process Frames == | ||
Once | Once everything is setup, we can start processing frames as follows: | ||
<syntaxhighlight lanng=c++> | |||
#define CHECK_RET_VALUE(ret) \ | |||
if (ret.IsError()) { \ | |||
std::cout << ret << std::endl; \ | |||
break; \ | |||
} | |||
while(true) { | |||
/*Get input data using one of the provided ways*/ | |||
/*Apply algorithms*/ | |||
CHECK_RET_VALUE(motion_detection->apply(input, mask, motion_params)) | |||
CHECK_RET_VALUE(denoise->apply(mask, filtered, denoise_params)) | |||
CHECK_RET_VALUE(blob->apply(filtered, motion_list, blob_params)) | |||
/*Check for motion*/ | |||
if (motion_list.size() != 0) { | |||
/*Do something with motion objects*/ | |||
} | |||
} | |||
</syntaxhighlight> | |||
In order to feed the algorithms with the input data the library provides wrapper classes around commonly used data types that are described in the following sections. | |||
=== Create a Frame and fill it with your data === | === Create a Frame and fill it with your data === |