티스토리 뷰

코딩

Dense flow

Agile- 2018. 3. 20. 12:02

OpenCV 3.4를 우분투에 처음부터 make 해서 깔았음.
위의 블로그 글대로 똑같이 진행하면 됨.
그리고 나서, https://github.com/yjxiong/dense_flow 에서 opencv 3.1 branch로 가서 파일을 다운받고 make하면 됨
사용할 때 command는 약간 불친절하게 적혀있지만, 

###Usage

./extract_gpu -f=test.avi -x=tmp/flow_x -y=tmp/flow_y -i=tmp/image 
-b=20 -t=1 -d=0 -s=1 -o=dir
  • test.avi: input video
  • tmp: folder containing RGB images and optical flow images
  • dir: output generated images to folder. if set to zip, will write images to zip files instead.
상세정보를 쓰면 아래와 같음. 
const char* keys =
{
"{ f vidFile | ex2.avi | filename of video }"
"{ x xFlowFile | flow_x | filename of flow x component }"
"{ y yFlowFile | flow_y | filename of flow x component }"
"{ i imgFile | flow_i | filename of flow image}"
"{ b bound | 15 | specify the maximum of optical flow}"
"{ t type | 0 | specify the optical flow algorithm }"
"{ d device_id | 0 | set gpu id}"
"{ s step | 1 | specify the step for frame sampling}"
"{ o out | zip | output style}"
"{ w newWidth | 0 | output style}"
"{ h newHeight | 0 | output style}"
};
t는 Type인데, 0일 때는 farn / 1일 때는 tv_l1 / 2일때 brox 
o는 dir로 쓰면 폴더가 만들어지고 그 안에 이미지 파일들이 생김 / zip로 쓰면 압축파일 형태로 결과물을 생성
d는 gpu device id
데이터셋 전부에 대해서 OF 뽑을 때는 dense flow의 git에 있는 python 파일을 참고해서 돌리기가 가능
$ python3 build_of.py <video_folder> <result_folder> --num_worker 1


'코딩' 카테고리의 다른 글

OpenCV imshow 관련  (0) 2018.02.27
C++에서 윈도우 파일 리스트 입력받기.  (0) 2018.02.27
sublime으로 latex 환경 셋팅  (0) 2017.12.29
OpenCV 3.3.1 Visual Studio 2013으로 make 하기  (0) 2017.11.09
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함