Patch to search in spilltrees in parallel (Feature #960)


Added by Kevin Keraudren almost 14 years ago. Updated almost 14 years ago.


Status:Done Start date:
Priority:Normal Due date:
Assignee:Vadim Pisarevsky % Done:

0%

Category:imgproc, video
Target version:-
Difficulty: Pull request:

Description

In our project, we used the OpenCV spilltrees to search ANN in a 1M image database in parallel using the TBB library.

In the original code, the spilltree cache belongs to the whole tree, and temporary results are stored in the leaves. This is not compatible with multi-threads at all, so we patched it.

We created a new cache for each search, and stored the results keeping the leaves untouched.
kdTrees have the same bug and cannot be used in parallel.

Attached is the patch for
OpenCV-2.2.0/modules/imgproc/src/spilltree.cpp

We also modified the spilltrees so as to save the whole tree in a text file, with the image file names in the leaves. If that part of the code interests you, I could send you both the patches for the concerned OpenCV files, and the code related on how we saved the tree and how we used the saved tree for a search.

If you wish to know more about our project, you can have a look at http://www.doc.ic.ac.uk/~kpk09/facecrumbs.html


spilltree.diff - patch for spilltree.cpp to make it thread-safe (3.6 kB) Kevin Keraudren, 2011-03-24 01:41 pm


Associated revisions

Revision 68e4256f
Added by Roman Donchenko almost 12 years ago

Merge pull request #960 from SpecLad:extra-modules

Revision 3bfc6974
Added by Roman Donchenko almost 12 years ago

Merge remote-tracking branch 'origin/2.4' into merge-2.4

Merged pull requests:
#890 from caorong:patch-1
#893 from jet47:gpu-arm-fixes
#933 from pengx17:2.4_macfix_cont
#935 from pengx17:2.4_filter2d_fix
#936 from bitwangyaoyao:2.4_perf
#937 from bitwangyaoyao:2.4_fixPyrLK
#938 from pengx17:2.4_surf_sample
#939 from pengx17:2.4_getDevice
#940 from SpecLad:autolock
#941 from apavlenko:signed_char
#946 from bitwangyaoyao:2.4_samples2
#947 from jet47:fix-gpu-arm-build
#948 from jet47:cuda-5.5-support
#952 from SpecLad:jepg
#953 from jet47:fix-bug-3069
#955 from SpecLad:symlink
#957 from pengx17:2.4_fix_corner_detector
#959 from SpecLad:qt4-build
#960 from SpecLad:extra-modules

Conflicts:
modules/core/include/opencv2/core/core.hpp
modules/gpu/CMakeLists.txt
modules/gpu/include/opencv2/gpu/device/vec_math.hpp
modules/gpu/perf/perf_video.cpp
modules/gpuimgproc/src/cuda/hough.cu
modules/ocl/include/opencv2/ocl/ocl.hpp
modules/ocl/src/pyrlk.cpp
samples/gpu/driver_api_multi.cpp
samples/gpu/driver_api_stereo_multi.cpp
samples/ocl/surf_matcher.cpp

History

Updated by Kevin Keraudren almost 14 years ago

Patch applied in
r4853

  • Status changed from Open to Done
  • (deleted custom field) set to fixed

Also available in: Atom PDF