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
a3b6df3e
"vscode:/vscode.git/clone" did not exist on "5dc4080c83082b808d8d7367d01ecea111a2fab9"
Commit
a3b6df3e
authored
Mar 03, 2013
by
Davis King
Browse files
Added get_next_double_click() to the image_ex example.
parent
96b03e70
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
examples/image_ex.cpp
examples/image_ex.cpp
+11
-1
No files found.
examples/image_ex.cpp
View file @
a3b6df3e
...
...
@@ -69,9 +69,19 @@ int main(int argc, char** argv)
// also make a window to display the original image
image_window
my_window2
(
img
,
"Original Image"
);
// Sometimes you want to get input from the user about which pixels are important
// for some task. You can do this easily by trapping user clicks as shown below.
// This loop executes every time the user double clicks on some image pixel and it
// will terminate once the user closes the window.
point
p
;
while
(
my_window
.
get_next_double_click
(
p
))
{
cout
<<
"User double clicked on pixel: "
<<
p
<<
endl
;
cout
<<
"edge pixel value at this location is: "
<<
(
int
)
edge_image
[
p
.
y
()][
p
.
x
()]
<<
endl
;
}
// wait until the user closes the windows before we let the program
// terminate.
my_window
.
wait_until_closed
();
win_hot
.
wait_until_closed
();
my_window2
.
wait_until_closed
();
}
...
...
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