コード例 #1
0
    methods.CompileInformation("name_video", video_name),
    methods.CompileInformation("local_creation", local_creation),
    methods.CompileInformation("creation", creation),
    methods.CompileInformation("length_vid", length_vid),
    methods.CompileInformation("fps", fps),
    methods.CompileInformation("vid_duration", vid_duration),
    methods.CompileInformation("target_frame", target_frame),
    methods.CompileInformation("side", side),
    methods.CompileInformation("conversion", conversion)
]

info_video = {}
for i in info:
    info_video[i.name] = i.value

start, end, step, _, _ = methods.frame_to_time(info_video)
print(
    "Recording was started at: ", start, "\nRecording was ended at: ", end,
    "\nThis information might not be precise as it depends on your computer file system, and file meta information"
)

os.makedirs("results/processed_videos/", exist_ok=True)
file_blob = "results/processed_videos/" + video_name + "_blob.avi"
file_mask = "results/processed_videos/" + video_name + "_mask.avi"
out_blob = cv2.VideoWriter(file_blob,
                           cv2.VideoWriter_fourcc('M', 'J', 'P',
                                                  'G'), fps, (side, side))
out_mask = cv2.VideoWriter(file_mask,
                           cv2.VideoWriter_fourcc('M', 'J', 'P',
                                                  'G'), fps, (side, side))
コード例 #2
0
    except (TypeError, RuntimeError):
        pass

else:
    print(video_name, "No, file does not exists")
    head_true = True
    species = str(input("* Please enter species name for this individual: "))
    sex = str(input("* Please enter sex for this individual: "))
    handedness = str(input(" *Please enter handedness for this individual: "))
    crab_id = methods.CrabNames(name, str("Manual_tracking"), species, sex, handedness)
    print(crab_id)
    methods.data_writer(args["video"], info_video, head_true)

methods.CrabNames.save_crab_names(methods.CrabNames.instances, info_video)

start, end, step, _, _ = methods.frame_to_time(info_video)
print("Recording was started at: ", start, "\nRecording was ended at: ", end,
      "\nThis information might not be precise as it depends on your computer file system, and file meta information.",
      "\nPress the 'p' key to pause and play the video.")

pause = True

while vid.isOpened():
    _, img = vid.read()
    key = cv2.waitKey(1) & 0xFF

    if img is None:
        break
    else:
        img = cv2.resize(img, (0, 0), fx=resz_val, fy=resz_val)
        if pause: