UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
831 Views
Registered: ‎06-16-2017

How to run optical flow completely on software?

Jump to solution

Hi,

I'm wondering how can I run optical flow demo without any hardware acceleration. That is, I want to run optical flow on software and still integrate it with capture and display pipelines. Would that be possible?

Thanks,

Venky

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
744 Views
Registered: ‎08-20-2018

Re: How to run optical flow completely on software?

Jump to solution

Hi @kodukulav 

I am assuming that you are using reVISION platform.

If you follow below steps you can import gstdemo and gstopticalflow applications in your workspace. Then you can create a optical flow library with the help of below document.  

https://github.com/Xilinx/reVISION-Getting-Started-Guide/blob/master/Docs/tool-flow-tutorials.md

When you create a lib project using a template Dense Optical Flow, your SDx window will show accelerated functions as shown below

optical_flow_hw_func.PNG

you can navigate to the location and right click on that function. You can see below window

toggle_hw_sw.PNG

 

Click on "Toggle HW/SW"

Then that function will be a software function.

Repeat the same for other functions too. When you give build you can get the optical flow shared library.

And you can follow remaining procedure as mentioned in reVISION flow.

 

 

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
8 Replies
Xilinx Employee
Xilinx Employee
777 Views
Registered: ‎08-20-2018

Re: How to run optical flow completely on software?

Jump to solution

Hi @kodukulav 

It should be possible without hardware acceleration.

Please give it a try.

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Adventurer
Adventurer
772 Views
Registered: ‎06-16-2017

Re: How to run optical flow completely on software?

Jump to solution

Like should I write the opencv code and compile in SDSoC?

0 Kudos
Adventurer
Adventurer
752 Views
Registered: ‎06-16-2017

Re: How to run optical flow completely on software?

Jump to solution

@nutang Can you provide some detailed set of directions on how to do it? I'm not able to get it.

0 Kudos
Xilinx Employee
Xilinx Employee
745 Views
Registered: ‎08-20-2018

Re: How to run optical flow completely on software?

Jump to solution

Hi @kodukulav 

I am assuming that you are using reVISION platform.

If you follow below steps you can import gstdemo and gstopticalflow applications in your workspace. Then you can create a optical flow library with the help of below document.  

https://github.com/Xilinx/reVISION-Getting-Started-Guide/blob/master/Docs/tool-flow-tutorials.md

When you create a lib project using a template Dense Optical Flow, your SDx window will show accelerated functions as shown below

optical_flow_hw_func.PNG

you can navigate to the location and right click on that function. You can see below window

toggle_hw_sw.PNG

 

Click on "Toggle HW/SW"

Then that function will be a software function.

Repeat the same for other functions too. When you give build you can get the optical flow shared library.

And you can follow remaining procedure as mentioned in reVISION flow.

 

 

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
Contributor
Contributor
585 Views
Registered: ‎02-06-2019

Re: How to run optical flow completely on software?

Jump to solution

Hi @nutang

I am also trying to run filter2d completely software, but I got a few issues. I’m using 2018.3 reVision platform and SDx 2018.3. When I flow the instruction on the “https://github.com/Xilinx/reVISION-Getting-Started-Guide/blob/master/Docs/tool-flow-tutorials.md” purely (with hardware accelerated) the output can run without problem on zcu104 using USB camera (See3Cam) as a source and HDMI as a sink.

However, when I try to run on SW with removing the hardware functions, application built done without error. [Also I realize that the “filter2D” function which is located in the reVision, can’t go declaration if I right click and Declaration.] But program won’t work and give this error:

Setting console loglevel to 0 ...

root@xilinx:~# cd /media/card

root@xilinx:/media/card# cp libfilter2d.so /usr/lib

root@xilinx:/media/card# cp libgstsdxfilter2d.so /usr/lib/gstreamer-1.0

root@xilinx:/media/card# gst-launch-1.0 \

>     xlnxvideosrc src-type="usbcam" ! \

>     "video/x-raw, width=1920, height=1080, format=UYVY" ! \

>     sdxfilter2d filter-preset=4 filter-mode=0 ! queue ! \

>     kmssink bus-id=b00c0000.v_mix plane-id=31

Setting pipeline to PAUSED ...

Pipeline is live and does not need PREROLL ...

Setting pipeline to PLAYING ...

New clock: GstSystemClock

Redistribute latency...

Caught SIGSEGV

#0  0x0000007fb3c47af4 in poll () from /lib/libc.so.6

#1  0x0000007fb3d4da80 in ?? () from /usr/lib/libglib-2.0.so.0

#2  0x00000000217e33c0 in ?? ()

Spinning.  Please run 'gdb gst-launch-1.0 2503' to continue debugging, Ctrl-C to quit, or Ctrl-\ to dump core.

How can I solve that problem?

Thank you in advance.

0 Kudos
Xilinx Employee
Xilinx Employee
576 Views
Registered: ‎08-20-2018

Re: How to run optical flow completely on software?

Jump to solution

Hi @yasin.kagan 

Please let me know if you have tried to debug further

gdb gst-launch-1.0 2503

Best Regards,
Nutan
-------------------------------------------------------------------------------
Please don't forget to reply, kudo and accept as a solution
0 Kudos
Visitor hcyhanson
Visitor
546 Views
Registered: ‎11-08-2018

Re: How to run optical flow completely on software?

Jump to solution

Hi,@nutang ,

I also got the same problem when I try to apply the 'filte2d' example merely by software,  I change the input command filter-mode=1', got the same error as  @yasin.kagan ,the prompt show:first-error.png

when I run 'gdb gst-launch-1.0 2710' ,I got the message as follow:second-error.png

if there are some mistakes in  the commands that I input?  Or some other mistakes?   I don't know how to solve it , hope you can help me ,thanks,

Best Regards,

hcyhanson

0 Kudos
Highlighted
Contributor
Contributor
421 Views
Registered: ‎02-06-2019

Re: How to run optical flow completely on software?

Jump to solution

I think the problem is caused by 2018.3 reVision platform. When I trace the code, the split function in the  gstsdxfilter2d/filter2d_cv.cpp/ can't be done somehow. 

After that, I try the prebuilt (in sd_card/filter2d) project in the reVision 2018.2, it works fine. Then I switch the 2018.2 SDSoC, and I currently work with that version.

0 Kudos