Merged the trunk r8547:8574, r8587
This commit is contained in:
@@ -161,34 +161,34 @@ Return value: detected phase shift (sub-pixel) between the two arrays.
|
||||
|
||||
The function performs the following equations
|
||||
|
||||
*
|
||||
First it applies a Hanning window (see http://en.wikipedia.org/wiki/Hann\_function) to each image to remove possible edge effects. This window is cached until the array size changes to speed up processing time.
|
||||
* First it applies a Hanning window (see http://en.wikipedia.org/wiki/Hann\_function) to each image to remove possible edge effects. This window is cached until the array size changes to speed up processing time.
|
||||
|
||||
*
|
||||
Next it computes the forward DFTs of each source array:
|
||||
.. math::
|
||||
* Next it computes the forward DFTs of each source array:
|
||||
|
||||
.. math::
|
||||
|
||||
\mathbf{G}_a = \mathcal{F}\{src_1\}, \; \mathbf{G}_b = \mathcal{F}\{src_2\}
|
||||
|
||||
where
|
||||
:math:`\mathcal{F}` is the forward DFT.
|
||||
where
|
||||
:math:`\mathcal{F}` is the forward DFT.
|
||||
|
||||
* It then computes the cross-power spectrum of each frequency domain array:
|
||||
|
||||
*
|
||||
It then computes the cross-power spectrum of each frequency domain array:
|
||||
.. math::
|
||||
|
||||
R = \frac{ \mathbf{G}_a \mathbf{G}_b^*}{|\mathbf{G}_a \mathbf{G}_b^*|}
|
||||
R = \frac{ \mathbf{G}_a \mathbf{G}_b^*}{|\mathbf{G}_a \mathbf{G}_b^*|}
|
||||
|
||||
* Next the cross-correlation is converted back into the time domain via the inverse DFT:
|
||||
|
||||
*
|
||||
Next the cross-correlation is converted back into the time domain via the inverse DFT:
|
||||
.. math::
|
||||
|
||||
r = \mathcal{F}^{-1}\{R\}
|
||||
*
|
||||
Finally, it computes the peak location and computes a 5x5 weighted centroid around the peak to achieve sub-pixel accuracy.
|
||||
r = \mathcal{F}^{-1}\{R\}
|
||||
|
||||
* Finally, it computes the peak location and computes a 5x5 weighted centroid around the peak to achieve sub-pixel accuracy.
|
||||
|
||||
.. math::
|
||||
|
||||
(\Delta x, \Delta y) = \texttt{weighted_centroid}\{\arg \max_{(x, y)}\{r\}\}
|
||||
(\Delta x, \Delta y) = \texttt{weightedCentroid} \{\arg \max_{(x, y)}\{r\}\}
|
||||
|
||||
.. seealso::
|
||||
:ocv:func:`dft`,
|
||||
|
@@ -1207,7 +1207,7 @@ struct DecimateAlpha
|
||||
};
|
||||
|
||||
template<typename T, typename WT>
|
||||
static void resizeArea_( const Mat& src, Mat& dst, const DecimateAlpha* xofs, int xofs_count )
|
||||
static void resizeArea_( const Mat& src, Mat& dst, const DecimateAlpha* xofs, int xofs_count, double scale_y_)
|
||||
{
|
||||
Size ssize = src.size(), dsize = dst.size();
|
||||
int cn = src.channels();
|
||||
@@ -1215,7 +1215,7 @@ static void resizeArea_( const Mat& src, Mat& dst, const DecimateAlpha* xofs, in
|
||||
AutoBuffer<WT> _buffer(dsize.width*2);
|
||||
WT *buf = _buffer, *sum = buf + dsize.width;
|
||||
int k, sy, dx, cur_dy = 0;
|
||||
WT scale_y = (WT)ssize.height/dsize.height;
|
||||
WT scale_y = (WT)scale_y_;
|
||||
|
||||
CV_Assert( cn <= 4 );
|
||||
for( dx = 0; dx < dsize.width; dx++ )
|
||||
@@ -1315,7 +1315,7 @@ typedef void (*ResizeAreaFastFunc)( const Mat& src, Mat& dst,
|
||||
int scale_x, int scale_y );
|
||||
|
||||
typedef void (*ResizeAreaFunc)( const Mat& src, Mat& dst,
|
||||
const DecimateAlpha* xofs, int xofs_count );
|
||||
const DecimateAlpha* xofs, int xofs_count, double scale_y_);
|
||||
|
||||
}
|
||||
|
||||
@@ -1532,7 +1532,7 @@ void cv::resize( InputArray _src, OutputArray _dst, Size dsize,
|
||||
}
|
||||
}
|
||||
|
||||
func( src, dst, xofs, k );
|
||||
func( src, dst, xofs, k ,scale_y);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -1132,7 +1132,7 @@ CvBoost::update_weights( CvBoostTree* tree )
|
||||
else
|
||||
{
|
||||
if( have_subsample )
|
||||
_buf_size += data->buf->step*(sizeof(float)+sizeof(uchar));
|
||||
_buf_size += data->buf->cols*(sizeof(float)+sizeof(uchar));
|
||||
}
|
||||
inn_buf.allocate(_buf_size);
|
||||
uchar* cur_buf_pos = (uchar*)inn_buf;
|
||||
|
@@ -45,13 +45,13 @@
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/features2d/features2d.hpp"
|
||||
#include "warpers.hpp"
|
||||
#include "detail/matchers.hpp"
|
||||
#include "detail/motion_estimators.hpp"
|
||||
#include "detail/exposure_compensate.hpp"
|
||||
#include "detail/seam_finders.hpp"
|
||||
#include "detail/blenders.hpp"
|
||||
#include "detail/camera.hpp"
|
||||
#include "opencv2/stitching/warpers.hpp"
|
||||
#include "opencv2/stitching/detail/matchers.hpp"
|
||||
#include "opencv2/stitching/detail/motion_estimators.hpp"
|
||||
#include "opencv2/stitching/detail/exposure_compensate.hpp"
|
||||
#include "opencv2/stitching/detail/seam_finders.hpp"
|
||||
#include "opencv2/stitching/detail/blenders.hpp"
|
||||
#include "opencv2/stitching/detail/camera.hpp"
|
||||
|
||||
namespace cv {
|
||||
|
||||
|
@@ -43,7 +43,7 @@
|
||||
#ifndef __OPENCV_STITCHING_WARPER_CREATORS_HPP__
|
||||
#define __OPENCV_STITCHING_WARPER_CREATORS_HPP__
|
||||
|
||||
#include "detail/warpers.hpp"
|
||||
#include "opencv2/stitching/detail/warpers.hpp"
|
||||
|
||||
namespace cv {
|
||||
|
||||
|
Reference in New Issue
Block a user