The grab-cut programs is consisted of two parts including single_seg.py and video_seg.py saved in the file cut/
single_seg.py is used to cut one single image, you can input your own file name with suffix to use this function, or the program will work on default image if you input nothing. You’ll get an instant feedback of the foreground departed, and you can find it later as data/result_img.jpg.
video_seg.py is used to cut one video by segmented frames. You can also choose your own video or use the default raw_video.gif. In this file, you may have a data/result_video.avi file instead of instant feedbacks. If you insist on feedbacks, you might have to make some modifications yourself. I want to note that you only need to draw a rectangle on the first image divided from the video and it will adjust itself for the following images.
The default image&video are stored in the file data/. Here, I have also given some examples of image&video cut.
The experimental report is saved in the file doc/.
Readme
single_seg.py
andvideo_seg.py
saved in the filecut/
single_seg.py
is used to cut one single image, you can input your own file name with suffix to use this function, or the program will work on default image if you input nothing. You’ll get an instant feedback of the foreground departed, and you can find it later asdata/result_img.jpg
.video_seg.py
is used to cut one video by segmented frames. You can also choose your own video or use the defaultraw_video.gif
. In this file, you may have adata/result_video.avi
file instead of instant feedbacks. If you insist on feedbacks, you might have to make some modifications yourself. I want to note that you only need to draw a rectangle on the first image divided from the video and it will adjust itself for the following images.data/
. Here, I have also given some examples of image&video cut.doc/
.