def black_pixels_ratio(crop_image):
    """
    Count the black pixel ratio on current masked bbox area

    Parameters
    ----------
    crop_image : the current masked bbox area

    Returns
    -------
    count/(height*width) : The black pixels ratio
    """
    # get frame height and width to access pixels
    height, width, _ = crop_image.shape
    if height == 0 or width == 0:
        return 1.0

    # access BGR pixel values on each channel
    count = 0
    for x in range(0, width) :
         for y in range(0, height) :
             if crop_image[y,x,0] == 0 and crop_image[y,x,1] == 0 and crop_image[y,x,2] == 0:
                count += 1

    return count/(height*width)