background - How to generate foreground-only image given the foreground silhouette in OpenCV? -


i did background substraction part foreground extraction task. have silhouette representing foreground in white , background in black, dont know how make foreground image containing pixels values (from original frame). using opencv 2.3 , using mat storing images. ideas? in advance..

you can follow:

mat image; // original image  mat foreground_bw; // foreground in black , white background_subtractor ( image, foreground_bw, -1.0 );  // getting corresponding pixel values foreground. mat foreground = mat::zeros ( image.rows, image.cols, image.type() ); image.copyto ( foreground, foreground_bw ); 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -