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
948d9664
Commit
948d9664
authored
Oct 21, 2010
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change at<double> => at<float>, since the histogram is cv_32f, not cv_64f
parent
25919884
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
quadsubpix.cpp
modules/contrib/src/quadsubpix.cpp
+5
-5
No files found.
modules/contrib/src/quadsubpix.cpp
View file @
948d9664
...
...
@@ -62,7 +62,7 @@ void drawCircles(Mat& img, const vector<Point2f>& corners, const vector<float>&
}
}
int
histQuantile
(
const
Mat
ND
&
hist
,
float
quantile
)
int
histQuantile
(
const
Mat
&
hist
,
float
quantile
)
{
if
(
hist
.
dims
>
1
)
return
-
1
;
// works for 1D histograms only
...
...
@@ -71,7 +71,7 @@ int histQuantile(const MatND& hist, float quantile)
float
quantile_sum
=
total_sum
*
quantile
;
for
(
int
j
=
0
;
j
<
hist
.
size
[
0
];
j
++
)
{
cur_sum
+=
(
float
)
hist
.
at
<
double
>
(
j
);
cur_sum
+=
(
float
)
hist
.
at
<
float
>
(
j
);
if
(
cur_sum
>
quantile_sum
)
{
return
j
;
...
...
@@ -173,7 +173,7 @@ void findCorner(const vector<Point2f>& contour, Point2f point, Point2f& corner)
return
;
}
int
segment_hist_max
(
const
Mat
ND
&
hist
,
int
&
low_thresh
,
int
&
high_thresh
)
int
segment_hist_max
(
const
Mat
&
hist
,
int
&
low_thresh
,
int
&
high_thresh
)
{
Mat
bw
;
//const double max_bell_width = 20; // we expect two bells with width bounded above
...
...
@@ -194,7 +194,7 @@ int segment_hist_max(const MatND& hist, int& low_thresh, int& high_thresh)
const
double
out_of_bells_fraction
=
0.1
;
for
(
int
x
=
0
;
x
<
hist
.
size
[
0
];
x
++
)
{
quantile_sum
+=
hist
.
at
<
double
>
(
x
);
quantile_sum
+=
hist
.
at
<
float
>
(
x
);
if
(
quantile_sum
<
0.2
*
total_sum
)
continue
;
if
(
quantile_sum
-
low_sum
>
out_of_bells_fraction
*
total_sum
)
...
...
@@ -228,7 +228,7 @@ bool find4QuadCornerSubpix(const Mat& img, std::vector<Point2f>& corners, Size r
const
int
nbins
=
256
;
float
ranges
[]
=
{
0
,
256
};
const
float
*
_ranges
=
ranges
;
Mat
ND
hist
;
Mat
hist
;
#if defined(_SUBPIX_VERBOSE)
vector
<
float
>
radius
;
...
...
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