Commit 16daec9c authored by Alexander Alekhin's avatar Alexander Alekhin

Merge remote-tracking branch 'upstream/3.4' into merge-3.4

parents 5d3928e4 1f6d6f06
......@@ -278,7 +278,7 @@ bool ocl_getAllDCTDescriptorsForImage( const Mat *imgCh, std::vector< GPCPatchDe
(int)globSize[0], (int)globSize[1], (int)patchRadius )
.run( 2, globSize, 0, true ) == false )
return false;
Mat cpuOut = out.getMat( 0 );
Mat cpuOut = out.getMat( ACCESS_READ );
for ( int i = 0; i + 2 * patchRadius < sz.height; ++i )
for ( int j = 0; j + 2 * patchRadius < sz.width; ++j )
descr.push_back( *cpuOut.ptr< GPCPatchDescriptor >( i * globSize[1] + j ) );
......
......@@ -53,6 +53,7 @@ namespace saliency
bool StaticSaliency::computeBinaryMap( InputArray _saliencyMap, OutputArray _binaryMap )
{
Mat saliencyMap = _saliencyMap.getMat();
CV_CheckTypeEQ(saliencyMap.type(), CV_32FC1, "");
Mat labels = Mat::zeros( saliencyMap.rows * saliencyMap.cols, 1, 1 );
Mat samples = Mat_<float>( saliencyMap.rows * saliencyMap.cols, 1 );
Mat centers;
......
......@@ -66,7 +66,7 @@ bool StaticSaliencyFineGrained::computeSaliencyImpl(InputArray image, OutputArra
{
Mat dst(Size(image.getMat().cols, image.getMat().rows), CV_8UC1);
calcIntensityChannel(image.getMat(), dst);
dst.copyTo(saliencyMap);
dst.convertTo(saliencyMap, CV_32F, 1.0f/255.0f); // values are in range [0; 1]
#ifdef SALIENCY_DEBUG
// visualize saliency map
......
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