cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
kodukulav
Adventurer
Adventurer
1,262 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
nutang
Moderator
Moderator
1,175 Views
Registered: ‎08-20-2018

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

View solution in original post

8 Replies
nutang
Moderator
Moderator
1,208 Views
Registered: ‎08-20-2018

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
kodukulav
Adventurer
Adventurer
1,203 Views
Registered: ‎06-16-2017

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

0 Kudos
kodukulav
Adventurer
Adventurer
1,183 Views
Registered: ‎06-16-2017

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

0 Kudos
nutang
Moderator
Moderator
1,176 Views
Registered: ‎08-20-2018

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

View solution in original post

yasin.kagan
Contributor
Contributor
1,016 Views
Registered: ‎02-06-2019

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
nutang
Moderator
Moderator
1,007 Views
Registered: ‎08-20-2018

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
hcyhanson
Visitor
Visitor
977 Views
Registered: ‎11-08-2018

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
yasin.kagan
Contributor
Contributor
852 Views
Registered: ‎02-06-2019

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