Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
840bb5bc
"tools/python/vscode:/vscode.git/clone" did not exist on "d0fc6023ce0720a96d33347cfec59a817e3b7be8"
Commit
840bb5bc
authored
May 24, 2018
by
Davis King
Browse files
Updated to work with new extract_image_4points() interface.
parent
91ae3de1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
tools/python/src/image2.cpp
tools/python/src/image2.cpp
+15
-14
No files found.
tools/python/src/image2.cpp
View file @
840bb5bc
...
...
@@ -554,14 +554,14 @@ numpy_image<T> py_extract_image_4points (
set_image_size
(
out
,
rows
,
columns
);
try
{
extract_image_4points
(
img
,
out
,
python_list_to_
vector
<
dpoint
>
(
corners
));
extract_image_4points
(
img
,
out
,
python_list_to_
array
<
dpoint
,
4
>
(
corners
));
return
out
;
}
catch
(
py
::
cast_error
&
){}
try
{
extract_image_4points
(
img
,
out
,
python_list_to_
vector
<
line
>
(
corners
));
extract_image_4points
(
img
,
out
,
python_list_to_
array
<
line
,
4
>
(
corners
));
return
out
;
}
catch
(
py
::
cast_error
&
)
...
...
@@ -657,6 +657,7 @@ ensures \n\
- PTS is just line with some elements removed.
!*/
py
::
register_exception
<
no_convex_quadrilateral
>
(
m
,
"no_convex_quadrilateral"
);
m
.
def
(
"extract_image_4points"
,
&
py_extract_image_4points
<
uint8_t
>
,
py
::
arg
(
"img"
),
py
::
arg
(
"corners"
),
py
::
arg
(
"rows"
),
py
::
arg
(
"columns"
));
m
.
def
(
"extract_image_4points"
,
&
py_extract_image_4points
<
uint16_t
>
,
py
::
arg
(
"img"
),
py
::
arg
(
"corners"
),
py
::
arg
(
"rows"
),
py
::
arg
(
"columns"
));
...
...
@@ -689,12 +690,12 @@ ensures \n\
left corner to upper left corner, upper right corner to upper right
\n
\
corner, etc.).
\n
\
- else
\n
\
- This routine
simply
finds the 4 intersecting points of the given lines
\n
\
and uses them as described above to extract
an image. i.e. It just then
\n
\
calls: extract_image_4points(img,
intersections_between_lines, rows, columns).
\n
\
- Since 4 lines might intersect at more than 4 locations, we select the
\n
\
intersections that give a quadrilateral with opposing sides that are a
s
\n
\
parallel as possible
."
- This routine finds the 4 intersecting points of the given lines
which
\n
\
form a convex quadrilateral
and uses them as described above to extract
\n
\
an image. i.e. It just then
calls: extract_image_4points(img,
\n
\
intersections_between_lines, rows, columns).
\n
\
- If no convex quadrilateral can be made from the given lines then thi
s
\n
\
routine throws no_convex_quadrilateral
."
/*!
requires
- corners is a list of dpoint or line objects.
...
...
@@ -716,12 +717,12 @@ ensures \n\
left corner to upper left corner, upper right corner to upper right
corner, etc.).
- else
- This routine
simply
finds the 4 intersecting points of the given lines
and uses them as described above to extract
an image. i.e. It just then
calls: extract_image_4points(img,
intersections_between_lines, rows, columns).
- Since 4 lines might intersect at more than 4 locations, we select the
intersections that give a quadrilateral with opposing sides that are a
s
parallel as possible
.
- This routine finds the 4 intersecting points of the given lines
which
form a convex quadrilateral
and uses them as described above to extract
an image. i.e. It just then
calls: extract_image_4points(img,
intersections_between_lines, rows, columns).
- If no convex quadrilateral can be made from the given lines then thi
s
routine throws no_convex_quadrilateral
.
!*/
);
...
...
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