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

pull/1743/head
Alexander Alekhin 7 years ago
commit 16daec9c5c
  1. 2
      modules/optflow/src/sparse_matching_gpc.cpp
  2. 1
      modules/saliency/src/staticSaliency.cpp
  3. 2
      modules/saliency/src/staticSaliencyFineGrained.cpp

@ -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

Loading…
Cancel
Save