Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
3def8436
Commit
3def8436
authored
Jun 28, 2012
by
Marina Kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merged the trunk r8719:8731 and 8807
parent
01570fa8
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
15 deletions
+25
-15
dist.h
modules/flann/include/opencv2/flann/dist.h
+8
-5
cap_gstreamer.cpp
modules/highgui/src/cap_gstreamer.cpp
+1
-1
window_gtk.cpp
modules/highgui/src/window_gtk.cpp
+4
-0
histograms.rst
modules/imgproc/doc/histograms.rst
+6
-4
types_c.h
modules/imgproc/include/opencv2/imgproc/types_c.h
+2
-1
ts_func.cpp
modules/ts/src/ts_func.cpp
+4
-4
No files found.
modules/flann/include/opencv2/flann/dist.h
View file @
3def8436
...
@@ -43,6 +43,9 @@ typedef unsigned __int64 uint64_t;
...
@@ -43,6 +43,9 @@ typedef unsigned __int64 uint64_t;
#include "defines.h"
#include "defines.h"
#ifdef __ARM_NEON__
#include "arm_neon.h"
#endif
namespace
cvflann
namespace
cvflann
{
{
...
@@ -416,9 +419,9 @@ struct Hamming
...
@@ -416,9 +419,9 @@ struct Hamming
ResultType
operator
()(
Iterator1
a
,
Iterator2
b
,
size_t
size
,
ResultType
/*worst_dist*/
=
-
1
)
const
ResultType
operator
()(
Iterator1
a
,
Iterator2
b
,
size_t
size
,
ResultType
/*worst_dist*/
=
-
1
)
const
{
{
ResultType
result
=
0
;
ResultType
result
=
0
;
#if __GNUC__
#if
def
__GNUC__
#if
CV_NEON
#if
def __ARM_NEON__
if
(
CPU_HAS_NEON_FEATURE
)
{
{
uint32x4_t
bits
=
vmovq_n_u32
(
0
);
uint32x4_t
bits
=
vmovq_n_u32
(
0
);
for
(
size_t
i
=
0
;
i
<
size
;
i
+=
16
)
{
for
(
size_t
i
=
0
;
i
<
size
;
i
+=
16
)
{
uint8x16_t
A_vec
=
vld1q_u8
(
a
+
i
);
uint8x16_t
A_vec
=
vld1q_u8
(
a
+
i
);
...
@@ -433,8 +436,7 @@ struct Hamming
...
@@ -433,8 +436,7 @@ struct Hamming
result
=
vgetq_lane_s32
(
vreinterpretq_s32_u64
(
bitSet2
),
0
);
result
=
vgetq_lane_s32
(
vreinterpretq_s32_u64
(
bitSet2
),
0
);
result
+=
vgetq_lane_s32
(
vreinterpretq_s32_u64
(
bitSet2
),
2
);
result
+=
vgetq_lane_s32
(
vreinterpretq_s32_u64
(
bitSet2
),
2
);
}
}
else
#else
#endif
{
{
//for portability just use unsigned long -- and use the __builtin_popcountll (see docs for __builtin_popcountll)
//for portability just use unsigned long -- and use the __builtin_popcountll (see docs for __builtin_popcountll)
typedef
unsigned
long
long
pop_t
;
typedef
unsigned
long
long
pop_t
;
...
@@ -454,6 +456,7 @@ struct Hamming
...
@@ -454,6 +456,7 @@ struct Hamming
result
+=
__builtin_popcountll
(
a_final
^
b_final
);
result
+=
__builtin_popcountll
(
a_final
^
b_final
);
}
}
}
}
#endif //NEON
#else
#else
HammingLUT
lut
;
HammingLUT
lut
;
result
=
lut
(
reinterpret_cast
<
const
unsigned
char
*>
(
a
),
result
=
lut
(
reinterpret_cast
<
const
unsigned
char
*>
(
a
),
...
...
modules/highgui/src/cap_gstreamer.cpp
View file @
3def8436
...
@@ -274,7 +274,7 @@ void CvCapture_GStreamer::removeFilter(const char *filter)
...
@@ -274,7 +274,7 @@ void CvCapture_GStreamer::removeFilter(const char *filter)
//
//
// connect uridecodebin dynamically created source pads to colourconverter
// connect uridecodebin dynamically created source pads to colourconverter
//
//
void
CvCapture_GStreamer
::
newPad
(
GstElement
*
uridecodebin
,
void
CvCapture_GStreamer
::
newPad
(
GstElement
*
/*uridecodebin*/
,
GstPad
*
pad
,
GstPad
*
pad
,
gpointer
data
)
gpointer
data
)
{
{
...
...
modules/highgui/src/window_gtk.cpp
View file @
3def8436
...
@@ -678,6 +678,8 @@ double cvGetOpenGlProp_GTK(const char* name)
...
@@ -678,6 +678,8 @@ double cvGetOpenGlProp_GTK(const char* name)
result
=
window
->
useGl
;
result
=
window
->
useGl
;
__END__
;
__END__
;
#else
(
void
)
name
;
#endif
#endif
return
result
;
return
result
;
...
@@ -1004,6 +1006,8 @@ static gboolean cvImageWidget_expose(GtkWidget* widget, GdkEventExpose* event, g
...
@@ -1004,6 +1006,8 @@ static gboolean cvImageWidget_expose(GtkWidget* widget, GdkEventExpose* event, g
drawGl
(
window
);
drawGl
(
window
);
return
TRUE
;
return
TRUE
;
}
}
#else
(
void
)
data
;
#endif
#endif
CvImageWidget
*
image_widget
;
CvImageWidget
*
image_widget
;
...
...
modules/imgproc/doc/histograms.rst
View file @
3def8436
...
@@ -175,9 +175,11 @@ Compares two histograms.
...
@@ -175,9 +175,11 @@ Compares two histograms.
* **CV_COMP_BHATTACHARYYA** Bhattacharyya distance
* **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:
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::
.. math::
...
@@ -192,19 +194,19 @@ The functions ``compareHist`` compare two dense or two sparse histograms using t
...
@@ -192,19 +194,19 @@ The functions ``compareHist`` compare two dense or two sparse histograms using t
and
and
:math:`N` is a total number of histogram bins.
:math:`N` is a total number of histogram bins.
* Chi-Square (
method=CV\_COMP\_CHISQR
)
* Chi-Square (
``method=CV_COMP_CHISQR``
)
.. math::
.. math::
d(H_1,H_2) = \sum _I \frac{\left(H_1(I)-H_2(I)\right)^2}{H_1(I)}
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::
.. math::
d(H_1,H_2) = \sum _I \min (H_1(I), H_2(I))
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::
.. math::
...
...
modules/imgproc/include/opencv2/imgproc/types_c.h
View file @
3def8436
...
@@ -533,7 +533,8 @@ enum
...
@@ -533,7 +533,8 @@ enum
CV_COMP_CORREL
=
0
,
CV_COMP_CORREL
=
0
,
CV_COMP_CHISQR
=
1
,
CV_COMP_CHISQR
=
1
,
CV_COMP_INTERSECT
=
2
,
CV_COMP_INTERSECT
=
2
,
CV_COMP_BHATTACHARYYA
=
3
CV_COMP_BHATTACHARYYA
=
3
,
CV_COMP_HELLINGER
=
CV_COMP_BHATTACHARYYA
};
};
/* Mask size for distance transform */
/* Mask size for distance transform */
...
...
modules/ts/src/ts_func.cpp
View file @
3def8436
...
@@ -1129,26 +1129,26 @@ norm_(const _Tp* src, size_t total, int cn, int normType, double startval, const
...
@@ -1129,26 +1129,26 @@ norm_(const _Tp* src, size_t total, int cn, int normType, double startval, const
{
{
if
(
!
mask
)
if
(
!
mask
)
for
(
i
=
0
;
i
<
total
;
i
++
)
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
else
for
(
int
c
=
0
;
c
<
cn
;
c
++
)
for
(
int
c
=
0
;
c
<
cn
;
c
++
)
{
{
for
(
i
=
0
;
i
<
total
;
i
++
)
for
(
i
=
0
;
i
<
total
;
i
++
)
if
(
mask
[
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
)
else
if
(
normType
==
NORM_L1
)
{
{
if
(
!
mask
)
if
(
!
mask
)
for
(
i
=
0
;
i
<
total
;
i
++
)
for
(
i
=
0
;
i
<
total
;
i
++
)
result
+=
std
::
abs
(
int
(
src
[
i
])
);
result
+=
std
::
abs
(
0
+
src
[
i
]
);
else
else
for
(
int
c
=
0
;
c
<
cn
;
c
++
)
for
(
int
c
=
0
;
c
<
cn
;
c
++
)
{
{
for
(
i
=
0
;
i
<
total
;
i
++
)
for
(
i
=
0
;
i
<
total
;
i
++
)
if
(
mask
[
i
]
)
if
(
mask
[
i
]
)
result
+=
std
::
abs
(
int
(
src
[
i
*
cn
+
c
])
);
result
+=
std
::
abs
(
0
+
src
[
i
*
cn
+
c
]
);
}
}
}
}
else
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment