plstcharles / litiv

C++ implementation pool for computer vision R&D projects.
http://www.polymtl.ca/litiv/en/
Other
101 stars 30 forks source link

The PAWCS take too long,about 0.8 second per frame #16

Closed Adwardyang closed 5 years ago

Adwardyang commented 5 years ago

the image origina size is 1920 x 1080,I make it risize to 320x240 (QVGA),the it about 0.8 second per frame at Intel i7 CPU,the paper said that the speed is 22 frames per second Intel i5 CPU,can you help me to enhance the processing speed?

plstcharles commented 5 years ago

Hello!

For PAWCS, 0.8 seconds per frame is very strange --- you might be running a debug build, or one missing some optimizations. I used to get roughly 1-2 FPS while debugging with MSVC2015, but I just ran a quick test on Ubuntu 16.04 using a Release build, and (with some debug/display activated), it averaged 17+ FPS.

image

To get ideal performance, make sure you are activating all available compiler optimizations, and that the file I/O delay is not the bottleneck. Processing one sequence per core will also improve overall (average) FPS, and so will caching frames in advance. Lastly, if you absolutely need performance over everything else, try SuBSENSE or LOBSTER, those two will be much faster than PAWCS.

Adwardyang commented 5 years ago

Thanks for your patient answer!I make it fast than before with your advice! It is 7+ FPS on Windows VS2017 with Release building,the result is slower than yours.Maybe it is related with my input image?

plstcharles commented 5 years ago

The video content actually has a pretty slim impact on the speed of the method. The "best" speed is achieved when the frame is fully covered by foreground, but I don't remember a difference larger than maybe 20-30%.

Compiler tricks might very well be at play here, I have not recompiled and tested the speed on Windows for a few years. With GCC, I used pretty much every trick there is to make runtime execution faster (everything is included in the base-level CMakeList.txt). There's also a bit of SIMD code written by hand in there, and some prefetching/caching that might not be optimal with different architectures/compilers.

Best of luck with your project!

Adwardyang commented 5 years ago

Thanks!