Another essential set of ICLQuick-functions are the arithmetical and logical
functions and operators. Instead for creating UnaryOp instances from the ICLFilter
package, in non-realtime applications, images can simply be added or multiplied
pixel-wise using the common operators '+','*',etc\n
Internally, most arithmetical and logical operations use a static
memory managing system to avoid most memory allocation calls at run-time.
\code
#include
GUI gui;
void init(){
gui << "image[@handle=image@minsize=16x12]"
<< "slider(0,255,127)"
"[@out=t@maxsize=100x2@label=threshold]";
gui.show();
}
void run(){
static ImgQ last;
ImgQ curr = cvt(grab(FROM_PROGARG("-input")));
gui["image"] = thresh(abs(last-curr),gui["t"].as());
gui["image"].update();
last = curr;
}
int main(int n, char **ppc){
return ICLApplication(n,ppc,"-input(2)",init,run).exec();
}
\endcode
|
\image html quick-example-2.png "Arithmetical operations for creation of difference images"
|