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
d3f8b2ee
Commit
d3f8b2ee
authored
Aug 10, 2011
by
itsyplen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated using new cmd parser
parent
5678464f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
12 deletions
+21
-12
demhist.cpp
samples/cpp/demhist.cpp
+21
-12
No files found.
samples/cpp/demhist.cpp
View file @
d3f8b2ee
...
...
@@ -56,22 +56,31 @@ void updateBrightnessContrast( int /*arg*/, void* )
}
void
help
()
{
cout
<<
"
\n
This program demonstrates the use of calcHist() -- histogram creation.
\n
"
"
Call:
\n
"
"demhist [image_name -- Defaults to baboon.jpg]
\n
"
<<
endl
;
printf
(
"
\n
This program demonstrates the use of calcHist() -- histogram creation.
\n
"
"
Usage:
\n
"
"demhist [image_name -- Defaults to baboon.jpg]
\n
"
)
;
}
int
main
(
int
argc
,
char
**
argv
)
const
char
*
keys
=
{
// Load the source image. HighGUI use.
image
=
imread
(
argc
==
2
?
argv
[
1
]
:
"baboon.jpg"
,
0
);
"{1| |baboon.jpg|input image file}"
};
int
main
(
int
argc
,
const
char
**
argv
)
{
help
();
CommandLineParser
parser
(
argc
,
argv
,
keys
);
string
inputImage
=
parser
.
get
<
string
>
(
"1"
);
// Load the source image. HighGUI use.
image
=
imread
(
inputImage
,
0
);
if
(
image
.
empty
())
{
printf
(
"Cannot read image file: %s
\n
"
,
inputImage
.
c_str
());
return
-
1
;
}
if
(
image
.
empty
()
)
{
help
();
return
-
1
;
}
help
();
namedWindow
(
"image"
,
0
);
namedWindow
(
"histogram"
,
0
);
...
...
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