merged the trunk r8719:8731 and 8807
This commit is contained in:
parent
01570fa800
commit
3def843652
@ -43,6 +43,9 @@ typedef unsigned __int64 uint64_t;
|
||||
|
||||
#include "defines.h"
|
||||
|
||||
#ifdef __ARM_NEON__
|
||||
#include "arm_neon.h"
|
||||
#endif
|
||||
|
||||
namespace cvflann
|
||||
{
|
||||
@ -416,9 +419,9 @@ struct Hamming
|
||||
ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const
|
||||
{
|
||||
ResultType result = 0;
|
||||
#if __GNUC__
|
||||
#if CV_NEON
|
||||
if (CPU_HAS_NEON_FEATURE) {
|
||||
#ifdef __GNUC__
|
||||
#ifdef __ARM_NEON__
|
||||
{
|
||||
uint32x4_t bits = vmovq_n_u32(0);
|
||||
for (size_t i = 0; i < size; i += 16) {
|
||||
uint8x16_t A_vec = vld1q_u8 (a + i);
|
||||
@ -433,8 +436,7 @@ struct Hamming
|
||||
result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0);
|
||||
result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#else
|
||||
{
|
||||
//for portability just use unsigned long -- and use the __builtin_popcountll (see docs for __builtin_popcountll)
|
||||
typedef unsigned long long pop_t;
|
||||
@ -454,6 +456,7 @@ struct Hamming
|
||||
result += __builtin_popcountll(a_final ^ b_final);
|
||||
}
|
||||
}
|
||||
#endif //NEON
|
||||
#else
|
||||
HammingLUT lut;
|
||||
result = lut(reinterpret_cast<const unsigned char*> (a),
|
||||
|
@ -274,7 +274,7 @@ void CvCapture_GStreamer::removeFilter(const char *filter)
|
||||
//
|
||||
// connect uridecodebin dynamically created source pads to colourconverter
|
||||
//
|
||||
void CvCapture_GStreamer::newPad(GstElement *uridecodebin,
|
||||
void CvCapture_GStreamer::newPad(GstElement * /*uridecodebin*/,
|
||||
GstPad *pad,
|
||||
gpointer data)
|
||||
{
|
||||
|
@ -678,6 +678,8 @@ double cvGetOpenGlProp_GTK(const char* name)
|
||||
result = window->useGl;
|
||||
|
||||
__END__;
|
||||
#else
|
||||
(void)name;
|
||||
#endif
|
||||
|
||||
return result;
|
||||
@ -1004,6 +1006,8 @@ static gboolean cvImageWidget_expose(GtkWidget* widget, GdkEventExpose* event, g
|
||||
drawGl(window);
|
||||
return TRUE;
|
||||
}
|
||||
#else
|
||||
(void)data;
|
||||
#endif
|
||||
|
||||
CvImageWidget *image_widget;
|
||||
|
@ -175,9 +175,11 @@ Compares two histograms.
|
||||
|
||||
* **CV_COMP_BHATTACHARYYA** Bhattacharyya distance
|
||||
|
||||
* **CV_COMP_HELLINGER** Synonym for ``CV_COMP_BHATTACHARYYA``
|
||||
|
||||
The functions ``compareHist`` compare two dense or two sparse histograms using the specified method:
|
||||
|
||||
* Correlation (method=CV\_COMP\_CORREL)
|
||||
* Correlation (``method=CV_COMP_CORREL``)
|
||||
|
||||
.. math::
|
||||
|
||||
@ -192,19 +194,19 @@ The functions ``compareHist`` compare two dense or two sparse histograms using t
|
||||
and
|
||||
:math:`N` is a total number of histogram bins.
|
||||
|
||||
* Chi-Square (method=CV\_COMP\_CHISQR)
|
||||
* Chi-Square (``method=CV_COMP_CHISQR``)
|
||||
|
||||
.. math::
|
||||
|
||||
d(H_1,H_2) = \sum _I \frac{\left(H_1(I)-H_2(I)\right)^2}{H_1(I)}
|
||||
|
||||
* Intersection (method=CV\_COMP\_INTERSECT)
|
||||
* Intersection (``method=CV_COMP_INTERSECT``)
|
||||
|
||||
.. math::
|
||||
|
||||
d(H_1,H_2) = \sum _I \min (H_1(I), H_2(I))
|
||||
|
||||
* Bhattacharyya distance (method=CV\_COMP\_BHATTACHARYYA)
|
||||
* Bhattacharyya distance (``method=CV_COMP_BHATTACHARYYA`` or ``method=CV_COMP_HELLINGER``). In fact, OpenCV computes Hellinger distance, which is related to Bhattacharyya coefficient.
|
||||
|
||||
.. math::
|
||||
|
||||
|
@ -533,7 +533,8 @@ enum
|
||||
CV_COMP_CORREL =0,
|
||||
CV_COMP_CHISQR =1,
|
||||
CV_COMP_INTERSECT =2,
|
||||
CV_COMP_BHATTACHARYYA =3
|
||||
CV_COMP_BHATTACHARYYA =3,
|
||||
CV_COMP_HELLINGER =CV_COMP_BHATTACHARYYA
|
||||
};
|
||||
|
||||
/* Mask size for distance transform */
|
||||
|
@ -1129,26 +1129,26 @@ norm_(const _Tp* src, size_t total, int cn, int normType, double startval, const
|
||||
{
|
||||
if( !mask )
|
||||
for( i = 0; i < total; i++ )
|
||||
result = std::max(result, (double)std::abs(int(src[i])));
|
||||
result = std::max(result, (double)std::abs(0+src[i]));// trick with 0 used to quiet gcc warning
|
||||
else
|
||||
for( int c = 0; c < cn; c++ )
|
||||
{
|
||||
for( i = 0; i < total; i++ )
|
||||
if( mask[i] )
|
||||
result = std::max(result, (double)std::abs(int(src[i*cn + c])));
|
||||
result = std::max(result, (double)std::abs(0+src[i*cn + c]));
|
||||
}
|
||||
}
|
||||
else if( normType == NORM_L1 )
|
||||
{
|
||||
if( !mask )
|
||||
for( i = 0; i < total; i++ )
|
||||
result += std::abs(int(src[i]));
|
||||
result += std::abs(0+src[i]);
|
||||
else
|
||||
for( int c = 0; c < cn; c++ )
|
||||
{
|
||||
for( i = 0; i < total; i++ )
|
||||
if( mask[i] )
|
||||
result += std::abs(int(src[i*cn + c]));
|
||||
result += std::abs(0+src[i*cn + c]);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user