def create_camera(entries, name, cam, pic_to_cm=None):
    """Create a camera object based on the values filled in the form

    :param entries: form entries
    :param name: camera name (top or left)
    :param cam: camera object
    :param pic_to_cm: picture to cm ratio if the no-perspective mode is used
    :return: initialized camera object
    """

    cam.load_calibration_file(entries[0][1].get()+'/cam_'+name)
    cam.dir = entries[1][1].get()
    cam.firstPic = int(entries[2][1].get())
    cam.pic_to_cm = 1 / 141.1
    cam.framerate = float(entries[3][1].get())
    cam.camRes = (int(entries[4][1].get()), int(entries[5][1].get()))
    cam.res = (int(entries[6][1].get()), int(entries[7][1].get()))
    cam.cam_thres = float(entries[8][1].get())
    if not pic_to_cm is None:
        cam.pic_to_cm = pic_to_cm
    return cam