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
Post a Comment