Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
a3b6df3e
Commit
a3b6df3e
authored
Mar 03, 2013
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added get_next_double_click() to the image_ex example.
parent
96b03e70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
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