merged the trunk r8719:8731 and 8807
authorMarina Kolpakova <no@email>
Thu, 28 Jun 2012 16:39:53 +0000 (16:39 +0000)
committerMarina Kolpakova <no@email>
Thu, 28 Jun 2012 16:39:53 +0000 (16:39 +0000)
modules/flann/include/opencv2/flann/dist.h
modules/highgui/src/cap_gstreamer.cpp
modules/highgui/src/window_gtk.cpp
modules/imgproc/doc/histograms.rst
modules/imgproc/include/opencv2/imgproc/types_c.h
modules/ts/src/ts_func.cpp

index d76cdb6..ceb8354 100644 (file)
@@ -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),
index fd55435..ecce0b5 100644 (file)
@@ -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)
 {
index 5beb785..7b9169e 100644 (file)
@@ -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;
index db731a8..f576d5d 100644 (file)
@@ -174,10 +174,12 @@ Compares two histograms.
             * **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::
 
@@ -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::
 
index 40e8d06..601ee39 100644 (file)
@@ -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 */
index 41f32e4..fbbe8ec 100644 (file)
@@ -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