#include "defines.h"
+#ifdef __ARM_NEON__
+#include "arm_neon.h"
+#endif
namespace cvflann
{
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);
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;
result += __builtin_popcountll(a_final ^ b_final);
}
}
+#endif //NEON
#else
HammingLUT lut;
result = lut(reinterpret_cast<const unsigned char*> (a),
//
// connect uridecodebin dynamically created source pads to colourconverter
//
-void CvCapture_GStreamer::newPad(GstElement *uridecodebin,
+void CvCapture_GStreamer::newPad(GstElement * /*uridecodebin*/,
GstPad *pad,
gpointer data)
{
result = window->useGl;
__END__;
+#else
+ (void)name;
#endif
return result;
drawGl(window);
return TRUE;
}
+#else
+ (void)data;
#endif
CvImageWidget *image_widget;
* **CV_COMP_INTERSECT** Intersection
* **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::
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::
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 */
{
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