Ubuntu uses Dense_flow to extract optical flow images from video images

Source: Internet
Author: User

Using Dense_flow to extract the image of the optical flow image, the original project address: Https://github.com/wanglimin/dense_flow

This method uses the Opecnv most basic method of optical flow image calculation, the output is flow_x and flow_y two images.

Because the input is different from the program requirements (video---continuous frame image), the program is partially modified, roughly the same.

The method for compiling the program is:

Suppose the directory of the program is: $ROOT _dense

You should first modify the source file to be compiled in Cmakelist before compiling the program.

Modify the 5th, 6 lines to:

Add_executable (Denseflow denseFlow.cpp) target_link_libraries (Denseflow ${opencv_libs})

The program is then compiled:

CD $ROOT _densemkdir BUILDCD buildcmake. Make

Note: When using this method, you need to use the opecnv2.4.x version, it is recommended to use the 2.4.10 version, if you have installed OpenCV later version, such as 3.0, you need to modify it.

(due to the bug in 3.0, so in the process of processing image data may be problematic), the bug analysis see: http://stackoverflow.com/questions/31996367/ Opencv-resize-fails-on-large-image-with-error-215-ssize-area-0-in-funct

When the image length that needs to be resize is greater than 2^31, the Ssize.area () return value is negative. Therefore, you need to comment out the following statement:

  

The statement needs to be commented on for an image with a height higher than the width of the image:

If you need to use different versions of OPENCV in your project development, see the different versions of OPENCV management methods:Ubuntu under multiple versions OPENCV management (multiple OPENCV version)

Ubuntu uses Dense_flow to extract optical flow images from video images

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.