From: Vladislav Vinogradov Date: Mon, 28 Mar 2011 10:34:44 +0000 (+0000) Subject: fixed SURF_GPU bug (features count > max dimension of grid) X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~7613 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57195e96272b005b304027f4db4bb87533cb9e31;p=platform%2Fupstream%2Fopencv.git fixed SURF_GPU bug (features count > max dimension of grid) minor gpu docs fixes --- diff --git a/modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst b/modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst index 994e6d5..2cf7d14 100644 --- a/modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst +++ b/modules/gpu/doc/camera_calibration_and_3d_reconstruction.rst @@ -150,7 +150,7 @@ The class for computing stereo correspondence using belief propagation algorithm ... }; -The class implements Pedro F. Felzenszwalb algorithm [Pedro F. Felzenszwalb and Daniel P. Huttenlocher. Efficient belief propagation for early vision. International Journal of Computer Vision, 70(1), October 2006.]. It can compute own data cost (using truncated linear model) or use user-provided data cost. +The class implements Pedro F. Felzenszwalb algorithm [Pedro F. Felzenszwalb and Daniel P. Huttenlocher. Efficient belief propagation for early vision. International Journal of Computer Vision, 70(1), October 2006]. It can compute own data cost (using truncated linear model) or use user-provided data cost. **Please note:** ``StereoBeliefPropagation`` requires a lot of memory: @@ -162,7 +162,7 @@ for message storage and .. math:: - width\_step \cdot height \cdot ndisp \cdot (1 + 0.25 + 0.0625 + \dotsm + \frac{1}{4^{levels}} + width\_step \cdot height \cdot ndisp \cdot (1 + 0.25 + 0.0625 + \dotsm + \frac{1}{4^{levels}}) for data cost storage. ``width_step`` is the number of bytes in a line including the padding. @@ -204,7 +204,7 @@ gpu::StereoBeliefPropagation::StereoBeliefPropagation DiscTerm = \min(disc\_single\_jump \cdot \lvert f_1-f_2 \rvert, max\_disc\_term) -For more details please see [Pedro F. Felzenszwalb and Daniel P. Huttenlocher. Efficient belief propagation for early vision. International Journal of Computer Vision, 70(1), October 2006.]. +For more details please see [Pedro F. Felzenszwalb and Daniel P. Huttenlocher. Efficient belief propagation for early vision. International Journal of Computer Vision, 70(1), October 2006]. By default :cpp:class:`StereoBeliefPropagation` uses floating-point arithmetics and ``CV_32FC1`` type for messages. But also it can use fixed-point arithmetics and ``CV_16SC1`` type for messages for better perfomance. To avoid overflow in this case, the parameters must satisfy diff --git a/modules/gpu/doc/data_structures.rst b/modules/gpu/doc/data_structures.rst index 8bdbb9d..ef960ea 100644 --- a/modules/gpu/doc/data_structures.rst +++ b/modules/gpu/doc/data_structures.rst @@ -294,7 +294,7 @@ gpu::Stream::waitForCompletion gpu::StreamAccessor ------------------- -.. c:type:: gpu::StreamAccessor +.. cpp:class:: gpu::StreamAccessor This class provides possibility to get ``cudaStream_t`` from :cpp:class:`gpu::Stream`. This class is declared in ``stream_accessor.hpp`` because that is only public header that depend on Cuda Runtime API. Including it will bring the dependency to your code. :: diff --git a/modules/gpu/doc/image_processing.rst b/modules/gpu/doc/image_processing.rst index fdbdcf1..f3af5d9 100644 --- a/modules/gpu/doc/image_processing.rst +++ b/modules/gpu/doc/image_processing.rst @@ -163,7 +163,7 @@ gpu::cornerMinEigenVal :param borderType: Pixel extrapolation method. Only ``BORDER_REFLECT101`` and ``BORDER_REPLICATE`` are supported for now. -See also: :c:func:`cornerMinEigenValue`. +See also: :c:func:`cornerMinEigenVal`. @@ -279,7 +279,7 @@ gpu::convolve gpu::ConvolveBuf ---------------- -.. c:type:: gpu::ConvolveBuf +.. cpp:class:: gpu::ConvolveBuf Memory buffer for the :cpp:func:`gpu::convolve` function. :: diff --git a/modules/gpu/doc/initalization_and_information.rst b/modules/gpu/doc/initalization_and_information.rst index f0acbd3..45cb51b 100644 --- a/modules/gpu/doc/initalization_and_information.rst +++ b/modules/gpu/doc/initalization_and_information.rst @@ -185,7 +185,7 @@ gpu::DeviceInfo::isCompatible gpu::TargetArchs ---------------- -.. c:type:: gpu::TargetArchs +.. cpp:class:: gpu::TargetArchs This class provides functionality (as set of static methods) for checking which NVIDIA card architectures the GPU module was built for. @@ -223,7 +223,7 @@ According to the CUDA C Programming Guide Version 3.2: "PTX code produced for so gpu::MultiGpuManager -------------------- -.. c:type:: gpu::MultiGpuManager +.. cpp:class:: gpu::MultiGpuManager Provides functionality for working with many GPUs. :: diff --git a/modules/gpu/include/opencv2/gpu/gpu.hpp b/modules/gpu/include/opencv2/gpu/gpu.hpp index a184358..2bca086 100644 --- a/modules/gpu/include/opencv2/gpu/gpu.hpp +++ b/modules/gpu/include/opencv2/gpu/gpu.hpp @@ -1576,7 +1576,7 @@ namespace cv void operator()(const GpuMat& img, const GpuMat& mask, std::vector& keypoints, std::vector& descriptors, bool useProvidedKeypoints = false); - //! max keypoints = keypointsRatio * img.size().area() + //! max keypoints = min(keypointsRatio * img.size().area(), 65535) float keypointsRatio; bool upright; diff --git a/modules/gpu/src/surf.cpp b/modules/gpu/src/surf.cpp index d1f18a7..49fde58 100644 --- a/modules/gpu/src/surf.cpp +++ b/modules/gpu/src/surf.cpp @@ -101,9 +101,9 @@ namespace CV_Assert(nOctaves > 0 && nOctaveLayers > 0); CV_Assert(TargetArchs::builtWith(GLOBAL_ATOMICS) && DeviceInfo().supports(GLOBAL_ATOMICS)); - maxKeypoints = static_cast(img.size().area() * surf.keypointsRatio); - maxFeatures = static_cast(1.5 * maxKeypoints); - maxCandidates = static_cast(1.5 * maxFeatures); + maxKeypoints = min(static_cast(img.size().area() * surf.keypointsRatio), 65535); + maxFeatures = min(static_cast(1.5 * maxKeypoints), 65535); + maxCandidates = min(static_cast(1.5 * maxFeatures), 65535); CV_Assert(maxKeypoints > 0);