/* * mp_Gabor * * Author: Andrew Salamon * Date: Thu Apr 20 2006 * * This class is an adaptor between the mp_alignEyesMex and the interpolator that does the image * rotation. Primarily it does some setup, calls the interpolator, then does some teardown. * Arguments: * pixels: input image (full size) * patchSize: size (width and height) for the rotated face image * xl, xr, yl, yr: eye coordinates * Return value: * The rotated and cropped face. It was allocated with new, so needs to be deleted when the caller is done with it. * * Copyright (c) 2006 Machine Perception Laboratory * University of California San Diego. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * */ #ifndef __MP_THREADEDGABOR_H__ #define __MP_THREADEDGABOR_H__ #include "mp_gabor.h" /** mp_threadedGabor runs multiple gabors in separate threads. * Each of three gabors runs in a separate thread on a different group of the kernels. Thread support is supplied by the Boost library. * * In some cases (quad processor G5) this seems to add as much as a %30 speed increase. */ class mp_threadedGabor : public MP_Gabor { public: mp_threadedGabor( const RImage &_pixels, int width, int height, bool sub_proc = false ); virtual ~mp_threadedGabor(); virtual std::vector CERT_Gabor(); // Duplicates the CERT Gabor_jetF function, plus the outer loop from CERT.m virtual void setPixels( const RImage &newImage ); void loadAllKernels(); private: std::vector gabors; private: mp_threadedGabor( const mp_threadedGabor& ); mp_threadedGabor &operator=( const mp_threadedGabor& ); }; #endif