def getForegroundPixels(self, bgcolor=None):
        if self._fgMask == None: return None
        
        #binary mask selecting foreground regions
        mask = self._fgMask.asOpenCVBW()
        
        #full color source image
        image = self._annotateImg.copy().asOpenCV()
        
        #dest image, full color, but initially all zeros (black/background)
        # we will copy the foreground areas from image to here.
        dest = cv.CloneImage(image)
        if bgcolor==None:
            cv.SetZero(dest)
        else:
            cv.Set(dest, cv.RGB(*bgcolor))

        cv.Copy(image,dest,mask) #copy only pixels from image where mask != 0               
        return pv.Image(dest)
Creates the `<style>` and `<script>` tags needed to initialize uni-form.
dataset/ETHPy150Open bolme/pyvision/src/pyvision/surveillance/MotionDetector.py/MotionDetector.getForegroundPixels--crossover with--dataset/ETHPy150Open pydanny/django-uni-form/uni_form/templatetags/uni_form_filters.py/uni_form_setup