]> rtime.felk.cvut.cz Git - hercules2020/kcf.git/log
hercules2020/kcf.git
5 years agoRemove debug printf master
Michal Sojka [Tue, 22 Jan 2019 08:46:11 +0000 (09:46 +0100)]
Remove debug printf

5 years agoAdd simple CUDA memory manager
Michal Sojka [Mon, 21 Jan 2019 23:59:32 +0000 (00:59 +0100)]
Add simple CUDA memory manager

Thanks to this, we avoid allocating CUDA host-mapped memory at runtime,
which acts as implicit sync point and slows down the execution.

5 years agotest: Make tests pass on Travis
Michal Sojka [Mon, 21 Jan 2019 13:01:30 +0000 (14:01 +0100)]
test: Make tests pass on Travis

Work around problem with OpenCV version on Travis, which causes test
failures.

5 years agoRefactor print-test-results
Michal Sojka [Mon, 21 Jan 2019 12:56:11 +0000 (13:56 +0100)]
Refactor print-test-results

Some tests fail on Travis so we will introduce a special case for them.
It will be easier after this commit.

5 years agoREADME: Describe the main differences from the original implementation
Michal Sojka [Thu, 13 Dec 2018 08:48:34 +0000 (09:48 +0100)]
README: Describe the main differences from the original implementation

5 years agoFix Markdown formating in README
Michal Sojka [Thu, 13 Dec 2018 08:38:49 +0000 (09:38 +0100)]
Fix Markdown formating in README

5 years agoDo not use virtual methods in FFT class
Michal Sojka [Sat, 1 Dec 2018 23:02:58 +0000 (00:02 +0100)]
Do not use virtual methods in FFT class

This will become useful in next commit, where we will try to make
ComplexMat sizes constexpr. ComplexMat will become a template class
and therefore Fft classes will need to have template methods. Since it
is not possible to have virtual template methods, we are removing
virtual methods here.

5 years agoMakefile: Use absolute path when invoking ninja
Michal Sojka [Mon, 26 Nov 2018 21:48:49 +0000 (22:48 +0100)]
Makefile: Use absolute path when invoking ninja

This is for emacs to be able to correctly navigate the error messages.

5 years agoMake KCF member variables constexpr where possible
Michal Sojka [Mon, 26 Nov 2018 21:31:28 +0000 (22:31 +0100)]
Make KCF member variables constexpr where possible

This is to prepare the code for constexprification need for PREMization :-)

5 years agoREADME: Fix typos
Michal Sojka [Tue, 30 Oct 2018 13:07:40 +0000 (14:07 +0100)]
README: Fix typos

5 years agoMove patch capture for visual debug after scale step
Michal Sojka [Fri, 26 Oct 2018 09:35:12 +0000 (11:35 +0200)]
Move patch capture for visual debug after scale step

This way, visual debug better shows what the tracker actually sees.

5 years agoImplement sub-gird angle estimation
Michal Sojka [Fri, 19 Oct 2018 10:16:33 +0000 (12:16 +0200)]
Implement sub-gird angle estimation

This seems to improve tracking accuracy in many cases.

Fixes #41.

5 years agoReduce the number of evaluated scales
Michal Sojka [Fri, 19 Oct 2018 07:52:18 +0000 (09:52 +0200)]
Reduce the number of evaluated scales

This improves the performance a bit, while keeping almost the same
accuracy.

5 years agoMerge rotation branch
Michal Sojka [Fri, 19 Oct 2018 07:16:17 +0000 (09:16 +0200)]
Merge rotation branch

This code from that branch is not used directly. Instead, its
functionality was reimplemented in a clean way in the previous commits
of the master branch.

This merge is just to close the pull request and to not loos the
original implementation if it is needed sometimes later.

5 years agomain: Add video stream output
Michal Sojka [Fri, 19 Oct 2018 06:51:09 +0000 (08:51 +0200)]
main: Add video stream output

5 years agotest: Decrease accuracy limit
Michal Sojka [Thu, 18 Oct 2018 22:53:55 +0000 (00:53 +0200)]
test: Decrease accuracy limit

After addition of rotation support, some tests have lower accuracy (but
others (with rotating objects) higher).

5 years agoFix scale weight calculation in big batch mode
Michal Sojka [Thu, 18 Oct 2018 22:30:09 +0000 (00:30 +0200)]
Fix scale weight calculation in big batch mode

5 years agoFix numerical problems in sub_pixel_peak()
Michal Sojka [Thu, 18 Oct 2018 22:15:45 +0000 (00:15 +0200)]
Fix numerical problems in sub_pixel_peak()

Sometimes, finding sub-pixel maximum fails (solution is very far from
the maximal value pixel) and the tracked object is lost. These changes
fix some the these cases. This problem was present also in the
original implementation.

5 years agoDraw maximum (cross) in the middle of pixels, not at the edge
Michal Sojka [Thu, 18 Oct 2018 22:02:27 +0000 (00:02 +0200)]
Draw maximum (cross) in the middle of pixels, not at the edge

5 years agoFix sub_grid_scale calculation
Michal Sojka [Thu, 18 Oct 2018 14:37:05 +0000 (16:37 +0200)]
Fix sub_grid_scale calculation

5 years agoAllow specifying visual debug mode from command line
Michal Sojka [Thu, 18 Oct 2018 14:27:11 +0000 (16:27 +0200)]
Allow specifying visual debug mode from command line

5 years agoTake current angle into account when updating tracked object position
Michal Sojka [Thu, 18 Oct 2018 13:52:04 +0000 (15:52 +0200)]
Take current angle into account when updating tracked object position

5 years agoShow locations of detected maxima in visual debug mode
Michal Sojka [Thu, 18 Oct 2018 12:26:45 +0000 (14:26 +0200)]
Show locations of detected maxima in visual debug mode

5 years agoRefactor point wrapping in frequency domain to a function
Michal Sojka [Thu, 18 Oct 2018 12:08:11 +0000 (14:08 +0200)]
Refactor point wrapping in frequency domain to a function

We will needed in next commits.

5 years agoMove visual debug after all calculations
Michal Sojka [Thu, 18 Oct 2018 12:03:15 +0000 (14:03 +0200)]
Move visual debug after all calculations

5 years agoAdd support for tracking of multiple angles
Michal Sojka [Sat, 13 Oct 2018 14:19:13 +0000 (16:19 +0200)]
Add support for tracking of multiple angles

5 years agoExtend to support not only multiple scales but also multiple angles
Michal Sojka [Sat, 13 Oct 2018 07:47:48 +0000 (09:47 +0200)]
Extend to support not only multiple scales but also multiple angles

So far, we neither rotate the patches nor use multiple angles.

5 years agoDo not set fixed delay for visual debug mode
Michal Sojka [Thu, 18 Oct 2018 12:36:21 +0000 (14:36 +0200)]
Do not set fixed delay for visual debug mode

5 years agoLeave 1px borders in visual debug window
Michal Sojka [Thu, 18 Oct 2018 10:48:56 +0000 (12:48 +0200)]
Leave 1px borders in visual debug window

5 years agomain: Quit by 'q' or ESC if run with -v0
Michal Sojka [Thu, 18 Oct 2018 10:19:55 +0000 (12:19 +0200)]
main: Quit by 'q' or ESC if run with -v0

5 years agotravis: Print backtraces on crashes or assertion failures
Michal Sojka [Thu, 18 Oct 2018 04:33:58 +0000 (06:33 +0200)]
travis: Print backtraces on crashes or assertion failures

5 years agoGive windows more descriptive names
Michal Sojka [Thu, 18 Oct 2018 10:19:24 +0000 (12:19 +0200)]
Give windows more descriptive names

I use this the configure my window manager to handle those windows
specifically.

5 years agoAllow odd number of scales and angles
Michal Sojka [Sat, 13 Oct 2018 11:56:21 +0000 (13:56 +0200)]
Allow odd number of scales and angles

Odd numbers are probably only useful for debugging.

5 years agoInitialize angles vector dynamically
Michal Sojka [Mon, 15 Oct 2018 23:11:38 +0000 (01:11 +0200)]
Initialize angles vector dynamically

5 years agoMake visual debug mode to show RGB patches
Michal Sojka [Fri, 12 Oct 2018 21:37:22 +0000 (23:37 +0200)]
Make visual debug mode to show RGB patches

Previously used displaying of filter responses is kept in the code and
one can easily switch between RGB and response modes by changing the value
of "bool rgb".

5 years agoAdd more assertions about FFT arguments
Michal Sojka [Sat, 13 Oct 2018 11:41:12 +0000 (13:41 +0200)]
Add more assertions about FFT arguments

This is to be sure that after adding rotation, all matrix dimensions are
still correct.

5 years agoRemove unnecessary calls to cudaStreamSynchronize()
Michal Sojka [Fri, 12 Oct 2018 13:13:58 +0000 (15:13 +0200)]
Remove unnecessary calls to cudaStreamSynchronize()

5 years agoFix ToC
Michal Sojka [Fri, 12 Oct 2018 12:49:52 +0000 (14:49 +0200)]
Fix ToC

5 years agoUpdate README
Michal Sojka [Fri, 12 Oct 2018 12:47:06 +0000 (14:47 +0200)]
Update README

5 years agoRemove unused functions
Michal Sojka [Fri, 12 Oct 2018 11:36:34 +0000 (13:36 +0200)]
Remove unused functions

5 years agoDo not allocate and free temporary matrices for every frame
Michal Sojka [Thu, 11 Oct 2018 23:04:25 +0000 (01:04 +0200)]
Do not allocate and free temporary matrices for every frame

This speeds up the CUDA version, because pinned memory allocation is
implicit synchronization point. By allocating the variables only once,
we reduce the number of synchronization points.

5 years agoAdd NVTX markers to the code
Michal Sojka [Thu, 11 Oct 2018 22:23:18 +0000 (00:23 +0200)]
Add NVTX markers to the code

This makes it easier to understand nvprof timelines.

5 years agocufft: Use per-thread CUDA stream for cuBLAS calls
Michal Sojka [Thu, 11 Oct 2018 14:39:54 +0000 (16:39 +0200)]
cufft: Use per-thread CUDA stream for cuBLAS calls

5 years agoFix CUDA bugs that manifest themselves in BIG_BATCH mode
Michal Sojka [Mon, 8 Oct 2018 12:04:47 +0000 (14:04 +0200)]
Fix CUDA bugs that manifest themselves in BIG_BATCH mode

5 years agoAdd more debug prints
Michal Sojka [Mon, 8 Oct 2018 11:59:53 +0000 (13:59 +0200)]
Add more debug prints

5 years agoFix CUDA assertion failures in BIG_BATCH mode
Michal Sojka [Mon, 8 Oct 2018 11:59:30 +0000 (13:59 +0200)]
Fix CUDA assertion failures in BIG_BATCH mode

5 years agoEnsure that bbox angle is set to zero
Michal Sojka [Mon, 8 Oct 2018 08:54:02 +0000 (10:54 +0200)]
Ensure that bbox angle is set to zero

5 years agoExtracted rotated output rectangle from rotation
Shanigen [Fri, 5 Oct 2018 10:00:22 +0000 (12:00 +0200)]
Extracted rotated output rectangle from rotation

5 years agoComplexMat: Add CUDA stream synchronization before accessing host memory
Michal Sojka [Thu, 4 Oct 2018 22:44:47 +0000 (00:44 +0200)]
ComplexMat: Add CUDA stream synchronization before accessing host memory

5 years agoAdd cudaStreamSynchronize after FFT
Michal Sojka [Thu, 4 Oct 2018 22:29:50 +0000 (00:29 +0200)]
Add cudaStreamSynchronize after FFT

This is just a temporary solution, it should be possible to get rid of
CPU/GPU synchronization at most places.

5 years agoRevert "debug: Round low values to zero when printing them"
Michal Sojka [Thu, 4 Oct 2018 22:19:46 +0000 (00:19 +0200)]
Revert "debug: Round low values to zero when printing them"

This reverts commit 3201116062300ef82b40d5d6d17eef4df27911f6.

5 years agoFix CUDA kernel bounds
Michal Sojka [Thu, 4 Oct 2018 22:18:00 +0000 (00:18 +0200)]
Fix CUDA kernel bounds

5 years agodebug: Add commented out expression to print the whole matrix
Michal Sojka [Thu, 4 Oct 2018 22:17:21 +0000 (00:17 +0200)]
debug: Add commented out expression to print the whole matrix

5 years agodebug: Don't print matrices as multiple lines
Michal Sojka [Thu, 4 Oct 2018 22:16:21 +0000 (00:16 +0200)]
debug: Don't print matrices as multiple lines

5 years agocomplexmat: Move CPU-only methods from .hpp to .cpp
Michal Sojka [Thu, 4 Oct 2018 21:33:44 +0000 (23:33 +0200)]
complexmat: Move CPU-only methods from .hpp to .cpp

5 years agodebug: Round low values to zero when printing them
Michal Sojka [Thu, 4 Oct 2018 11:01:36 +0000 (13:01 +0200)]
debug: Round low values to zero when printing them

This is to make comparison of outputs of different implementations easier.

5 years agoSimplify other ComplexMat CUDA methods
Michal Sojka [Thu, 4 Oct 2018 10:48:08 +0000 (12:48 +0200)]
Simplify other ComplexMat CUDA methods

Use just 1D indexing and remove restriction of at most one block.

5 years agoFix and simplify CUDA version of ComplexMat::sqr_norm
Michal Sojka [Thu, 4 Oct 2018 10:46:43 +0000 (12:46 +0200)]
Fix and simplify CUDA version of ComplexMat::sqr_norm

5 years agodebug: Allow setting trace float precision globally
Michal Sojka [Thu, 4 Oct 2018 10:44:54 +0000 (12:44 +0200)]
debug: Allow setting trace float precision globally

5 years agoDo not execute CUDA version of gausian correlation
Michal Sojka [Tue, 2 Oct 2018 23:12:44 +0000 (01:12 +0200)]
Do not execute CUDA version of gausian correlation

Use CPU version for now, because the CUDA version seems to have problems.

5 years agoCall cudaStreamSynchronize before debug prints
Michal Sojka [Tue, 2 Oct 2018 22:58:17 +0000 (00:58 +0200)]
Call cudaStreamSynchronize before debug prints

5 years agoAdd CUDA implementation for sum_channels
Michal Sojka [Tue, 2 Oct 2018 15:13:44 +0000 (17:13 +0200)]
Add CUDA implementation for sum_channels

5 years agoUnify CPU and GPU implementations of ComplexMat
Michal Sojka [Tue, 2 Oct 2018 13:50:49 +0000 (15:50 +0200)]
Unify CPU and GPU implementations of ComplexMat

CPU implementation is now in complexmat.cpp, GPU in complexmat.cu. Both
implementation share the same interface in complexmat.hpp.

5 years agoMake test protocol more brief and allow different sorting
Michal Sojka [Tue, 2 Oct 2018 13:40:48 +0000 (15:40 +0200)]
Make test protocol more brief and allow different sorting

5 years agoMake ComplexMat_ a non-template class
Michal Sojka [Tue, 2 Oct 2018 08:35:32 +0000 (10:35 +0200)]
Make ComplexMat_ a non-template class

This will simplify for unification of CPU and CUDA. When the unification
is done, we may want to restore the template if needed.

5 years agoConvert leftovers from vector to DynMem conversion few commit ago
Michal Sojka [Tue, 2 Oct 2018 08:24:48 +0000 (10:24 +0200)]
Convert leftovers from vector to DynMem conversion few commit ago

Since these are not used, the compiler does not complain.

5 years agoDo not destroy fftw plans if they were not created
Michal Sojka [Mon, 1 Oct 2018 23:01:55 +0000 (01:01 +0200)]
Do not destroy fftw plans if they were not created

Otherwise we get a segfault.

5 years agoGet rid of DynMem memory leaks
Michal Sojka [Mon, 1 Oct 2018 23:01:17 +0000 (01:01 +0200)]
Get rid of DynMem memory leaks

5 years agoConvert ComplexMat to use DynMem class
Michal Sojka [Sun, 30 Sep 2018 22:48:56 +0000 (00:48 +0200)]
Convert ComplexMat to use DynMem class

This is the first step to unification of CPU and GPU implementations.

It also fixes a incorrect dimensions of ComplexMats in
Gaussian_Correlation, which was unnoticed, because the matrices were
reallocated on the fly. Now, we use assertions in DynMem, which
prevents this. Ideally, we don't want any allocation during ComplexMat
computations, but we're not there yet.

5 years agoRemove unnecessary DEBUG_PRINT
Michal Sojka [Sun, 30 Sep 2018 22:21:10 +0000 (00:21 +0200)]
Remove unnecessary DEBUG_PRINT

5 years agoDynMem: Make num_elem const and public and add assertions to move operations
Michal Sojka [Sun, 30 Sep 2018 21:41:42 +0000 (23:41 +0200)]
DynMem: Make num_elem const and public and add assertions to move operations

This will become handy in future commits.

5 years agotest: Show accuracy comparison only for non-failed tests
Michal Sojka [Sun, 30 Sep 2018 21:38:33 +0000 (23:38 +0200)]
test: Show accuracy comparison only for non-failed tests

5 years agoDo not allow creation of ComplexMat with unknown size
Michal Sojka [Sun, 30 Sep 2018 20:06:10 +0000 (22:06 +0200)]
Do not allow creation of ComplexMat with unknown size

To avoid memory (re)allocation after we switch ComplexMat to DynMem,
we need to know the size before hand.

5 years agoDo not use local ComplexMat variables
Michal Sojka [Sun, 30 Sep 2018 19:32:17 +0000 (21:32 +0200)]
Do not use local ComplexMat variables

After we convert ComplexMat to DynMem storage, we won't want to
allocate memory in every step.

5 years agoFix bug in assertion
Michal Sojka [Sat, 29 Sep 2018 22:32:25 +0000 (00:32 +0200)]
Fix bug in assertion

5 years agoCompleMat: Having just one create() method is sufficient
Michal Sojka [Sat, 29 Sep 2018 20:26:27 +0000 (22:26 +0200)]
CompleMat: Having just one create() method is sufficient

The methods differ only in the _n_scales argument, which now takes default
value.

5 years agoSimplify creation of complexmat variables
Michal Sojka [Sat, 29 Sep 2018 20:55:05 +0000 (22:55 +0200)]
Simplify creation of complexmat variables

5 years agocmake: Compile CUDA version without intermediate kcfcuda library
Michal Sojka [Sat, 29 Sep 2018 20:23:18 +0000 (22:23 +0200)]
cmake: Compile CUDA version without intermediate kcfcuda library

5 years agocomplexmat.cu: Remove unused member foreign_data
Michal Sojka [Sat, 29 Sep 2018 19:47:58 +0000 (21:47 +0200)]
complexmat.cu: Remove unused member foreign_data

5 years agoAdd assertion about found maximum response
Michal Sojka [Fri, 28 Sep 2018 19:30:58 +0000 (21:30 +0200)]
Add assertion about found maximum response

5 years agoMake visual debug mode to work properly
Michal Sojka [Fri, 28 Sep 2018 05:47:04 +0000 (07:47 +0200)]
Make visual debug mode to work properly

5 years agoRename DynMem type to value_type
Michal Sojka [Fri, 28 Sep 2018 05:46:42 +0000 (07:46 +0200)]
Rename DynMem type to value_type

This is to prevent name collisions between Mat::type and DynMem::type and
also makes the name the same as in STL.

5 years agoMerge branch 'visual-debug'
Michal Sojka [Thu, 27 Sep 2018 21:22:16 +0000 (23:22 +0200)]
Merge branch 'visual-debug'

5 years agoMake OpenCV version checks to work correctly for both 2.x.x and 3.x.x
Michal Sojka [Thu, 27 Sep 2018 14:26:02 +0000 (16:26 +0200)]
Make OpenCV version checks to work correctly for both 2.x.x and 3.x.x

CV_VERSION_EPOCH seems to be defined only in 2.x.x.

Also fix the condition for operatoer<<(MatSize). We don't need it for
OpenCV 2.

5 years agoIntegration of the visual debug, with zero changes to the tracker's API.
Shanigen [Thu, 27 Sep 2018 10:47:18 +0000 (12:47 +0200)]
Integration of the visual debug, with zero changes to the tracker's API.

5 years agoAdd backward compatibility code for OpenCV 2.4
Michal Sojka [Wed, 26 Sep 2018 21:58:27 +0000 (23:58 +0200)]
Add backward compatibility code for OpenCV 2.4

5 years agoRemove unnedded code
Michal Sojka [Wed, 26 Sep 2018 21:58:15 +0000 (23:58 +0200)]
Remove unnedded code

5 years agoAdd PRINT macro to temporarily print a value of an expression
Michal Sojka [Wed, 26 Sep 2018 21:39:10 +0000 (23:39 +0200)]
Add PRINT macro to temporarily print a value of an expression

5 years agoRun --fit tests without arguments
Michal Sojka [Thu, 27 Sep 2018 05:33:13 +0000 (07:33 +0200)]
Run --fit tests without arguments

This always scales down the patch size and ensures that tests are run
faster. Fixed value may sometimes increase the patch size, which results
in longer test times.

5 years agoRework patch fitting to specific dimensions
Michal Sojka [Wed, 26 Sep 2018 21:38:44 +0000 (23:38 +0200)]
Rework patch fitting to specific dimensions

- It is not necessary to scale the whole image
- Define new variable fit_size and leave p_windows_size with original meaning

5 years agoDo not exit when pressing just shift, control, etc.
Michal Sojka [Wed, 26 Sep 2018 19:38:52 +0000 (21:38 +0200)]
Do not exit when pressing just shift, control, etc.

5 years agoRename p_roi to feature_size
Michal Sojka [Wed, 26 Sep 2018 18:33:18 +0000 (20:33 +0200)]
Rename p_roi to feature_size

5 years agoRefactor p_pose and related variables
Michal Sojka [Wed, 26 Sep 2018 14:29:34 +0000 (16:29 +0200)]
Refactor p_pose and related variables

p_pose was used to store position of the tracked object. Its use was
confusing, because only the center point was updates and width/height
not. Width/height was updated only in getBBox() according to
p_current_scale.

This commit renames p_pose to p_init_pose and does not touch it after
init(). We store the position of the tracked object in
p_current_scale. getBBox is updated to calculate the bounding box from
p_current_center, p_current_scale and p_init_pose.

5 years agotest: Increase report width to not wrap result to multiple lines
Michal Sojka [Wed, 26 Sep 2018 14:23:55 +0000 (16:23 +0200)]
test: Increase report width to not wrap result to multiple lines

5 years agoRename scale_factor to fit_factor
Michal Sojka [Wed, 26 Sep 2018 13:18:52 +0000 (15:18 +0200)]
Rename scale_factor to fit_factor

The variable is related to --fit and not to scale estimation.

5 years agoReformat, remove stale comments
Michal Sojka [Wed, 26 Sep 2018 13:08:08 +0000 (15:08 +0200)]
Reformat, remove stale comments

5 years agoGive fit parameters default values
Michal Sojka [Wed, 26 Sep 2018 11:37:09 +0000 (13:37 +0200)]
Give fit parameters default values

This is to make the KCF_Tracker interface compatible with the original
code.

5 years agoFix -f argument parsing
Michal Sojka [Wed, 26 Sep 2018 11:29:34 +0000 (13:29 +0200)]
Fix -f argument parsing

We've also make p_cell_size public so that we can read it outside of the
class.

5 years agoPrepare for rotation branch merge
Michal Sojka [Wed, 26 Sep 2018 07:28:22 +0000 (09:28 +0200)]
Prepare for rotation branch merge

5 years agoSimplify scale initialization
Michal Sojka [Wed, 26 Sep 2018 07:26:47 +0000 (09:26 +0200)]
Simplify scale initialization