def bbox_mask_and_crop(raw_img, bbox):
    """
    This function crops the original image using the bounding box.
    
    Parameters:
        raw_img (array): the original uncropped image.
        bbox (array): the bounding box array which contains the coordinates 
        of the four corners of the box. The bounding box can be shapes other than
        square.
        
    Returns:
        cropped_img (array): the image cropped out from the original image using 
        the bounding box.
        bbox (array): the square bounding box array which contains the coordinates 
        of the four corners of the box. 

    """
    if bbox is None:
        return raw_img, bbox

    left, top, right, bottom = bbox

    cropped_img = raw_img[
        top : bottom,
        left : right
    ]

    return cropped_img, bbox