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
27a6ad45
Commit
27a6ad45
authored
Sep 24, 2011
by
Davis King
Browse files
Added a blur step to the edge finding example.
parent
6aaf3467
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
examples/image_ex.cpp
examples/image_ex.cpp
+7
-4
No files found.
examples/image_ex.cpp
View file @
27a6ad45
...
...
@@ -45,12 +45,15 @@ int main(int argc, char** argv)
// to BMP files.
load_image
(
img
,
argv
[
1
]);
// Now lets use some image functions. This example is going to perform
// simple edge detection on the image. First lets find the horizontal and
// vertical gradient images.
// Now lets use some image functions. First lets blur the image a little.
array2d
<
unsigned
char
>
blurred_img
;
gaussian_blur
(
img
,
blurred_img
);
// Now find the horizontal and vertical gradient images.
array2d
<
short
>
horz_gradient
,
vert_gradient
;
array2d
<
unsigned
char
>
edge_image
;
sobel_edge_detector
(
img
,
horz_gradient
,
vert_gradient
);
sobel_edge_detector
(
blurred_
img
,
horz_gradient
,
vert_gradient
);
// now we do the non-maximum edge suppression step so that our edges are nice and thin
suppress_non_maximum_edges
(
horz_gradient
,
vert_gradient
,
edge_image
);
...
...
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