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
08724393
Commit
08724393
authored
Jul 03, 2011
by
Ana Huaman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tutorial sample code: EqualizeHist_Demo.cpp
parent
d3da43c8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
EqualizeHist_Demo.cpp
...p/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp
+51
-0
No files found.
samples/cpp/tutorial_code/Histograms_Matching/EqualizeHist_Demo.cpp
0 → 100644
View file @
08724393
/**
* @function EqualizeHist_Demo.cpp
* @brief Demo code for equalizeHist function
* @author OpenCV team
*/
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>
using
namespace
cv
;
using
namespace
std
;
/**
* @function main
*/
int
main
(
int
argc
,
char
**
argv
)
{
Mat
src
,
dst
;
char
*
source_window
=
"Source image"
;
char
*
equalized_window
=
"Equalized Image"
;
/// Load image
src
=
imread
(
argv
[
1
],
1
);
if
(
!
src
.
data
)
{
cout
<<
"Usage: ./Histogram_Demo <path_to_image>"
<<
endl
;
return
-
1
;
}
/// Convert to grayscale
cvtColor
(
src
,
src
,
CV_BGR2GRAY
);
/// Apply Histogram Equalization
equalizeHist
(
src
,
dst
);
/// Display results
namedWindow
(
source_window
,
CV_WINDOW_AUTOSIZE
);
namedWindow
(
equalized_window
,
CV_WINDOW_AUTOSIZE
);
imshow
(
source_window
,
src
);
imshow
(
equalized_window
,
dst
);
/// Wait until user exits the program
waitKey
(
0
);
return
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