def get_frame(video_camera):
    """
    Checks if the camera is open and takes a frame if so.
    :param video_camera: A cv2.VideoCapture object representing the camera.
    :return: Last frame taken by the camera.
    """
    if video_camera.isOpened():
        _, frame = video_camera.read()
    else:
        raise Exception("Camera is not opened")
    return frame