Commit 0936ddad authored by jaco's avatar jaco

windows reinterpret_cast error fixed

parent cd9b8da8
......@@ -66,11 +66,11 @@ class CV_EXPORTS_W StaticSaliencySpectralResidual : public StaticSaliency
StaticSaliencySpectralResidual();
~StaticSaliencySpectralResidual();
typedef Ptr<Size> (Algorithm::*SizeGetter)();
typedef void (Algorithm::*SizeSetter)( const Ptr<Size> & );
//typedef Ptr<Size> (Algorithm::*SizeGetter)();
//typedef void (Algorithm::*SizeSetter)( const Ptr<Size> & );
Ptr<Size> getWsize();
void setWsize( const Ptr<Size> &newSize );
//Ptr<Size> getWsize();
//void setWsize( const Ptr<Size> &newSize );
void read( const FileNode& fn );
void write( FileStorage& fs ) const;
......@@ -78,7 +78,9 @@ class CV_EXPORTS_W StaticSaliencySpectralResidual : public StaticSaliency
protected:
bool computeSaliencyImpl( const InputArray image, OutputArray saliencyMap );
AlgorithmInfo* info() const;CV_PROP_RW
Ptr<Size> resizedImageSize;
int resImWidth;
int resImHeight;
//Ptr<Size> resizedImageSize;
};
......
......@@ -48,9 +48,8 @@ namespace cv
CV_INIT_ALGORITHM(
StaticSaliencySpectralResidual,
"SALIENCY.SPECTRAL_RESIDUAL",
obj.info()->addParam( obj, "resizedImageSize", obj.resizedImageSize, false,
reinterpret_cast<SizeGetter>( &StaticSaliencySpectralResidual::getWsize ),
reinterpret_cast<SizeSetter>( &StaticSaliencySpectralResidual::setWsize ) ) );
obj.info()->addParam( obj, "resImWidth", obj.resImWidth);
obj.info()->addParam( obj, "resImHeight", obj.resImHeight));
//CV_INIT_ALGORITHM( MotionSaliencySuBSENSE, "SALIENCY.SuBSENSE", );
......
......@@ -48,19 +48,21 @@ namespace cv
* SaliencySpectralResidual
*/
cv::Ptr<Size> StaticSaliencySpectralResidual::getWsize()
/*cv::Ptr<Size> StaticSaliencySpectralResidual::getWsize()
{
return resizedImageSize;
}
void StaticSaliencySpectralResidual::setWsize( const cv::Ptr<Size>& newSize )
{
resizedImageSize = newSize;
}
}*/
StaticSaliencySpectralResidual::StaticSaliencySpectralResidual()
{
className = "SPECTRAL_RESIDUAL";
resizedImageSize = Ptr<Size>( new Size( 64, 64 ) );
resImWidth=64;
resImHeight=64;
//resizedImageSize = Ptr<Size>( new Size( 64, 64 ) );
}
StaticSaliencySpectralResidual::~StaticSaliencySpectralResidual()
......@@ -82,24 +84,26 @@ bool StaticSaliencySpectralResidual::computeSaliencyImpl( const InputArray image
{
Mat grayTemp, grayDown;
std::vector<Mat> mv;
Mat realImage( *resizedImageSize, CV_64F );
Mat imaginaryImage( *resizedImageSize, CV_64F );
Size resizedImageSize(resImWidth, resImHeight);
Mat realImage( resizedImageSize, CV_64F );
Mat imaginaryImage( resizedImageSize, CV_64F );
imaginaryImage.setTo( 0 );
Mat combinedImage( *resizedImageSize, CV_64FC2 );
Mat combinedImage( resizedImageSize, CV_64FC2 );
Mat imageDFT;
Mat logAmplitude;
Mat angle( *resizedImageSize, CV_64F );
Mat magnitude( *resizedImageSize, CV_64F );
Mat angle( resizedImageSize, CV_64F );
Mat magnitude( resizedImageSize, CV_64F );
Mat logAmplitude_blur, imageGR;
if( image.channels() == 3 )
{
cvtColor( image, imageGR, COLOR_BGR2GRAY );
resize( imageGR, grayDown, *resizedImageSize, 0, 0, INTER_LINEAR );
resize( imageGR, grayDown, resizedImageSize, 0, 0, INTER_LINEAR );
}
else
{
resize( image, grayDown, *resizedImageSize, 0, 0, INTER_LINEAR );
resize( image, grayDown, resizedImageSize, 0, 0, INTER_LINEAR );
}
grayDown.convertTo( realImage, CV_64F );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment