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 ...@@ -66,11 +66,11 @@ class CV_EXPORTS_W StaticSaliencySpectralResidual : public StaticSaliency
StaticSaliencySpectralResidual(); StaticSaliencySpectralResidual();
~StaticSaliencySpectralResidual(); ~StaticSaliencySpectralResidual();
typedef Ptr<Size> (Algorithm::*SizeGetter)(); //typedef Ptr<Size> (Algorithm::*SizeGetter)();
typedef void (Algorithm::*SizeSetter)( const Ptr<Size> & ); //typedef void (Algorithm::*SizeSetter)( const Ptr<Size> & );
Ptr<Size> getWsize(); //Ptr<Size> getWsize();
void setWsize( const Ptr<Size> &newSize ); //void setWsize( const Ptr<Size> &newSize );
void read( const FileNode& fn ); void read( const FileNode& fn );
void write( FileStorage& fs ) const; void write( FileStorage& fs ) const;
...@@ -78,7 +78,9 @@ class CV_EXPORTS_W StaticSaliencySpectralResidual : public StaticSaliency ...@@ -78,7 +78,9 @@ class CV_EXPORTS_W StaticSaliencySpectralResidual : public StaticSaliency
protected: protected:
bool computeSaliencyImpl( const InputArray image, OutputArray saliencyMap ); bool computeSaliencyImpl( const InputArray image, OutputArray saliencyMap );
AlgorithmInfo* info() const;CV_PROP_RW AlgorithmInfo* info() const;CV_PROP_RW
Ptr<Size> resizedImageSize; int resImWidth;
int resImHeight;
//Ptr<Size> resizedImageSize;
}; };
......
...@@ -48,9 +48,8 @@ namespace cv ...@@ -48,9 +48,8 @@ namespace cv
CV_INIT_ALGORITHM( CV_INIT_ALGORITHM(
StaticSaliencySpectralResidual, StaticSaliencySpectralResidual,
"SALIENCY.SPECTRAL_RESIDUAL", "SALIENCY.SPECTRAL_RESIDUAL",
obj.info()->addParam( obj, "resizedImageSize", obj.resizedImageSize, false, obj.info()->addParam( obj, "resImWidth", obj.resImWidth);
reinterpret_cast<SizeGetter>( &StaticSaliencySpectralResidual::getWsize ), obj.info()->addParam( obj, "resImHeight", obj.resImHeight));
reinterpret_cast<SizeSetter>( &StaticSaliencySpectralResidual::setWsize ) ) );
//CV_INIT_ALGORITHM( MotionSaliencySuBSENSE, "SALIENCY.SuBSENSE", ); //CV_INIT_ALGORITHM( MotionSaliencySuBSENSE, "SALIENCY.SuBSENSE", );
......
...@@ -48,19 +48,21 @@ namespace cv ...@@ -48,19 +48,21 @@ namespace cv
* SaliencySpectralResidual * SaliencySpectralResidual
*/ */
cv::Ptr<Size> StaticSaliencySpectralResidual::getWsize() /*cv::Ptr<Size> StaticSaliencySpectralResidual::getWsize()
{ {
return resizedImageSize; return resizedImageSize;
} }
void StaticSaliencySpectralResidual::setWsize( const cv::Ptr<Size>& newSize ) void StaticSaliencySpectralResidual::setWsize( const cv::Ptr<Size>& newSize )
{ {
resizedImageSize = newSize; resizedImageSize = newSize;
} }*/
StaticSaliencySpectralResidual::StaticSaliencySpectralResidual() StaticSaliencySpectralResidual::StaticSaliencySpectralResidual()
{ {
className = "SPECTRAL_RESIDUAL"; className = "SPECTRAL_RESIDUAL";
resizedImageSize = Ptr<Size>( new Size( 64, 64 ) ); resImWidth=64;
resImHeight=64;
//resizedImageSize = Ptr<Size>( new Size( 64, 64 ) );
} }
StaticSaliencySpectralResidual::~StaticSaliencySpectralResidual() StaticSaliencySpectralResidual::~StaticSaliencySpectralResidual()
...@@ -82,24 +84,26 @@ bool StaticSaliencySpectralResidual::computeSaliencyImpl( const InputArray image ...@@ -82,24 +84,26 @@ bool StaticSaliencySpectralResidual::computeSaliencyImpl( const InputArray image
{ {
Mat grayTemp, grayDown; Mat grayTemp, grayDown;
std::vector<Mat> mv; std::vector<Mat> mv;
Mat realImage( *resizedImageSize, CV_64F ); Size resizedImageSize(resImWidth, resImHeight);
Mat imaginaryImage( *resizedImageSize, CV_64F );
Mat realImage( resizedImageSize, CV_64F );
Mat imaginaryImage( resizedImageSize, CV_64F );
imaginaryImage.setTo( 0 ); imaginaryImage.setTo( 0 );
Mat combinedImage( *resizedImageSize, CV_64FC2 ); Mat combinedImage( resizedImageSize, CV_64FC2 );
Mat imageDFT; Mat imageDFT;
Mat logAmplitude; Mat logAmplitude;
Mat angle( *resizedImageSize, CV_64F ); Mat angle( resizedImageSize, CV_64F );
Mat magnitude( *resizedImageSize, CV_64F ); Mat magnitude( resizedImageSize, CV_64F );
Mat logAmplitude_blur, imageGR; Mat logAmplitude_blur, imageGR;
if( image.channels() == 3 ) if( image.channels() == 3 )
{ {
cvtColor( image, imageGR, COLOR_BGR2GRAY ); cvtColor( image, imageGR, COLOR_BGR2GRAY );
resize( imageGR, grayDown, *resizedImageSize, 0, 0, INTER_LINEAR ); resize( imageGR, grayDown, resizedImageSize, 0, 0, INTER_LINEAR );
} }
else else
{ {
resize( image, grayDown, *resizedImageSize, 0, 0, INTER_LINEAR ); resize( image, grayDown, resizedImageSize, 0, 0, INTER_LINEAR );
} }
grayDown.convertTo( realImage, CV_64F ); 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