GpuIntegralImageProcessor.hppGo to the documentation of this file.00001 /* 00002 Copyright (c) 2010, Paul Furgale and Chi Hay Tong 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without 00006 modification, are permitted provided that the following conditions are 00007 met: 00008 00009 * Redistributions of source code must retain the above copyright notice, 00010 this list of conditions and the following disclaimer. 00011 * Redistributions in binary form must reproduce the above copyright 00012 notice, this list of conditions and the following disclaimer in the 00013 documentation and/or other materials provided with the distribution. 00014 * The names of its contributors may not be used to endorse or promote 00015 products derived from this software without specific prior written 00016 permission. 00017 00018 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00019 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 00020 TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 00021 PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 00022 OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00023 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00024 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00025 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00026 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00027 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00028 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00029 */ 00030 00031 #ifndef ASRL_GPU_INTEGRAL_IMAGE_PROCESSOR_HPP 00032 #define ASRL_GPU_INTEGRAL_IMAGE_PROCESSOR_HPP 00033 00034 #include <opencv/cxtypes.h> 00035 #include <opencv/cv.h> 00036 #include <opencv/cv.hpp> 00037 #include <boost/shared_ptr.hpp> 00038 00039 // Forward declarations. 00040 struct cudaArray; 00041 typedef size_t CUDPPHandle; 00042 typedef int cudaStream_t; 00043 00044 namespace asrl { 00045 00046 // Forward declaration 00047 class GpuIntegralImage; 00048 00055 class GpuIntegralImageProcessor { 00056 public: 00064 GpuIntegralImageProcessor(int width, int height); 00065 00070 ~GpuIntegralImageProcessor(); 00071 00077 void upload(cv::Mat & img); 00078 00090 void process(cv::Mat & img, GpuIntegralImage & outImage, cudaStream_t stream = 0); 00091 00101 void process(GpuIntegralImage & outImage, cudaStream_t stream = 0); 00102 00107 int width(){ return m_width; } 00112 int height(){ return m_height; } 00113 private: 00115 boost::shared_ptr<unsigned char> char_data; 00116 00118 boost::shared_ptr<float> norm_data; 00120 boost::shared_ptr<float> trans_data; 00121 00123 size_t char_pitch; 00125 size_t norm_pitch; 00127 size_t trans_pitch; 00128 00130 CUDPPHandle rowPlan; 00132 CUDPPHandle colPlan; 00133 00135 int m_width; 00137 int m_height; 00138 }; 00139 00140 } // namespace asrl 00141 00142 #endif // ASRL_GPU_INTEGRAL_IMAGE_PROCESSOR_HPP 00143 Generated on Fri Apr 30 20:06:19 2010 for gpusurf by 1.6.2 |