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
16d825ad
Commit
16d825ad
authored
Feb 12, 2013
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed compile warnings and opencv_perf_imgproc failures
parent
944588e7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
17 deletions
+18
-17
perf_houghLines.cpp
modules/imgproc/perf/perf_houghLines.cpp
+4
-3
distransform.cpp
modules/imgproc/src/distransform.cpp
+1
-1
hough.cpp
modules/imgproc/src/hough.cpp
+12
-12
samplers.cpp
modules/imgproc/src/samplers.cpp
+1
-1
No files found.
modules/imgproc/perf/perf_houghLines.cpp
View file @
16d825ad
...
@@ -31,11 +31,12 @@ PERF_TEST_P(Image_RhoStep_ThetaStep_Threshold, HoughLines,
...
@@ -31,11 +31,12 @@ PERF_TEST_P(Image_RhoStep_ThetaStep_Threshold, HoughLines,
Canny
(
image
,
image
,
0
,
0
);
Canny
(
image
,
image
,
0
,
0
);
Mat
lines
;
Mat
lines
_t
,
lines
;
declare
.
time
(
60
);
declare
.
time
(
60
);
TEST_CYCLE
()
HoughLines
(
image
,
lines
,
rhoStep
,
thetaStep
,
threshold
);
TEST_CYCLE
()
HoughLines
(
image
,
lines
_t
,
rhoStep
,
thetaStep
,
threshold
);
transpose
(
lines
,
lines
);
if
(
!
lines_t
.
empty
()
)
transpose
(
lines_t
,
lines
);
SANITY_CHECK
(
lines
);
SANITY_CHECK
(
lines
);
}
}
modules/imgproc/src/distransform.cpp
View file @
16d825ad
...
@@ -766,7 +766,7 @@ icvDistanceATS_L1_8u( const cv::Mat& src, cv::Mat& dst )
...
@@ -766,7 +766,7 @@ icvDistanceATS_L1_8u( const cv::Mat& src, cv::Mat& dst )
CV_IMPL
void
CV_IMPL
void
cvDistTransform
(
const
void
*
srcarr
,
void
*
dstarr
,
cvDistTransform
(
const
void
*
srcarr
,
void
*
dstarr
,
int
distType
,
int
maskSize
,
int
distType
,
int
maskSize
,
const
float
*
mask
,
const
float
*
/*mask*/
,
void
*
labelsarr
,
int
labelType
)
void
*
labelsarr
,
int
labelType
)
{
{
cv
::
Mat
src
=
cv
::
cvarrToMat
(
srcarr
),
dst
=
cv
::
cvarrToMat
(
dstarr
);
cv
::
Mat
src
=
cv
::
cvarrToMat
(
srcarr
),
dst
=
cv
::
cvarrToMat
(
dstarr
);
...
...
modules/imgproc/src/hough.cpp
View file @
16d825ad
...
@@ -88,10 +88,10 @@ HoughLinesStandard( const Mat& img, float rho, float theta,
...
@@ -88,10 +88,10 @@ HoughLinesStandard( const Mat& img, float rho, float theta,
int
numrho
=
cvRound
(((
width
+
height
)
*
2
+
1
)
/
rho
);
int
numrho
=
cvRound
(((
width
+
height
)
*
2
+
1
)
/
rho
);
AutoBuffer
<
int
>
_accum
((
numangle
+
2
)
*
(
numrho
+
2
));
AutoBuffer
<
int
>
_accum
((
numangle
+
2
)
*
(
numrho
+
2
));
AutoBuffer
<
int
>
_sort_buf
(
numangle
*
numrho
)
;
vector
<
int
>
_sort_buf
;
AutoBuffer
<
float
>
_tabSin
(
numangle
);
AutoBuffer
<
float
>
_tabSin
(
numangle
);
AutoBuffer
<
float
>
_tabCos
(
numangle
);
AutoBuffer
<
float
>
_tabCos
(
numangle
);
int
*
accum
=
_accum
,
*
sort_buf
=
_sort_buf
;
int
*
accum
=
_accum
;
float
*
tabSin
=
_tabSin
,
*
tabCos
=
_tabCos
;
float
*
tabSin
=
_tabSin
,
*
tabCos
=
_tabCos
;
memset
(
accum
,
0
,
sizeof
(
accum
[
0
])
*
(
numangle
+
2
)
*
(
numrho
+
2
)
);
memset
(
accum
,
0
,
sizeof
(
accum
[
0
])
*
(
numangle
+
2
)
*
(
numrho
+
2
)
);
...
@@ -124,19 +124,19 @@ HoughLinesStandard( const Mat& img, float rho, float theta,
...
@@ -124,19 +124,19 @@ HoughLinesStandard( const Mat& img, float rho, float theta,
if
(
accum
[
base
]
>
threshold
&&
if
(
accum
[
base
]
>
threshold
&&
accum
[
base
]
>
accum
[
base
-
1
]
&&
accum
[
base
]
>=
accum
[
base
+
1
]
&&
accum
[
base
]
>
accum
[
base
-
1
]
&&
accum
[
base
]
>=
accum
[
base
+
1
]
&&
accum
[
base
]
>
accum
[
base
-
numrho
-
2
]
&&
accum
[
base
]
>=
accum
[
base
+
numrho
+
2
]
)
accum
[
base
]
>
accum
[
base
-
numrho
-
2
]
&&
accum
[
base
]
>=
accum
[
base
+
numrho
+
2
]
)
sort_buf
[
total
++
]
=
base
;
_sort_buf
.
push_back
(
base
)
;
}
}
// stage 3. sort the detected lines by accumulator value
// stage 3. sort the detected lines by accumulator value
std
::
sort
(
sort_buf
,
sort_buf
+
total
,
hough_cmp_gt
(
accum
));
cv
::
sort
(
_sort_buf
,
hough_cmp_gt
(
accum
));
// stage 4. store the first min(total,linesMax) lines to the output buffer
// stage 4. store the first min(total,linesMax) lines to the output buffer
linesMax
=
MIN
(
linesMax
,
total
);
linesMax
=
min
(
linesMax
,
(
int
)
_sort_buf
.
size
()
);
double
scale
=
1.
/
(
numrho
+
2
);
double
scale
=
1.
/
(
numrho
+
2
);
for
(
i
=
0
;
i
<
linesMax
;
i
++
)
for
(
i
=
0
;
i
<
linesMax
;
i
++
)
{
{
LinePolar
line
;
LinePolar
line
;
int
idx
=
sort_buf
[
i
];
int
idx
=
_
sort_buf
[
i
];
int
n
=
cvFloor
(
idx
*
scale
)
-
1
;
int
n
=
cvFloor
(
idx
*
scale
)
-
1
;
int
r
=
idx
-
(
n
+
1
)
*
(
numrho
+
2
)
-
1
;
int
r
=
idx
-
(
n
+
1
)
*
(
numrho
+
2
)
-
1
;
line
.
rho
=
(
r
-
(
numrho
-
1
)
*
0.5
f
)
*
rho
;
line
.
rho
=
(
r
-
(
numrho
-
1
)
*
0.5
f
)
*
rho
;
...
@@ -362,11 +362,11 @@ HoughLinesSDiv( const Mat& img,
...
@@ -362,11 +362,11 @@ HoughLinesSDiv( const Mat& img,
}
}
}
}
for
(
size_t
i
=
0
;
i
<
lst
.
size
();
i
++
)
for
(
size_t
i
dx
=
0
;
idx
<
lst
.
size
();
idx
++
)
{
{
if
(
lst
[
i
].
rho
<
0
)
if
(
lst
[
i
dx
].
rho
<
0
)
continue
;
continue
;
lines
.
push_back
(
Vec2f
(
lst
[
i
].
rho
,
lst
[
i
].
theta
));
lines
.
push_back
(
Vec2f
(
lst
[
i
dx
].
rho
,
lst
[
idx
].
theta
));
}
}
}
}
...
@@ -604,9 +604,9 @@ void cv::HoughLines( InputArray _image, OutputArray _lines,
...
@@ -604,9 +604,9 @@ void cv::HoughLines( InputArray _image, OutputArray _lines,
vector
<
Vec2f
>
lines
;
vector
<
Vec2f
>
lines
;
if
(
srn
==
0
&&
stn
==
0
)
if
(
srn
==
0
&&
stn
==
0
)
HoughLinesStandard
(
image
,
rho
,
theta
,
threshold
,
lines
,
INT_MAX
);
HoughLinesStandard
(
image
,
(
float
)
rho
,
(
float
)
theta
,
threshold
,
lines
,
INT_MAX
);
else
else
HoughLinesSDiv
(
image
,
rho
,
theta
,
threshold
,
srn
,
stn
,
lines
,
INT_MAX
);
HoughLinesSDiv
(
image
,
(
float
)
rho
,
(
float
)
theta
,
threshold
,
(
float
)
srn
,
(
float
)
stn
,
lines
,
INT_MAX
);
Mat
(
lines
).
copyTo
(
_lines
);
Mat
(
lines
).
copyTo
(
_lines
);
}
}
...
@@ -618,7 +618,7 @@ void cv::HoughLinesP(InputArray _image, OutputArray _lines,
...
@@ -618,7 +618,7 @@ void cv::HoughLinesP(InputArray _image, OutputArray _lines,
{
{
Mat
image
=
_image
.
getMat
();
Mat
image
=
_image
.
getMat
();
vector
<
Vec4i
>
lines
;
vector
<
Vec4i
>
lines
;
HoughLinesProbabilistic
(
image
,
rho
,
theta
,
threshold
,
minLineLength
,
maxGap
,
lines
,
INT_MAX
);
HoughLinesProbabilistic
(
image
,
(
float
)
rho
,
(
float
)
theta
,
threshold
,
cvRound
(
minLineLength
),
cvRound
(
maxGap
)
,
lines
,
INT_MAX
);
Mat
(
lines
).
copyTo
(
_lines
);
Mat
(
lines
).
copyTo
(
_lines
);
}
}
...
...
modules/imgproc/src/samplers.cpp
View file @
16d825ad
...
@@ -205,7 +205,7 @@ void getRectSubPix_Cn_(const _Tp* src, int src_step, Size src_size,
...
@@ -205,7 +205,7 @@ void getRectSubPix_Cn_(const _Tp* src, int src_step, Size src_size,
for
(
j
=
r
.
x
*
cn
;
j
<
r
.
width
*
cn
;
j
++
)
for
(
j
=
r
.
x
*
cn
;
j
<
r
.
width
*
cn
;
j
++
)
{
{
_WTp
s0
=
src
[
j
]
*
a11
+
src
[
j
+
cn
]
*
a12
+
src2
[
j
]
*
a21
+
src2
[
j
+
cn
]
*
a22
;
s0
=
src
[
j
]
*
a11
+
src
[
j
+
cn
]
*
a12
+
src2
[
j
]
*
a21
+
src2
[
j
+
cn
]
*
a22
;
dst
[
j
]
=
cast_op
(
s0
);
dst
[
j
]
=
cast_op
(
s0
);
}
}
...
...
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