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
6ebb0e2a
Commit
6ebb0e2a
authored
Feb 20, 2013
by
Andrey Kamaev
Committed by
OpenCV Buildbot
Feb 20, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #505 from abidrahmank:2.4
parents
5691fd3a
96b2898f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
hist.py
samples/python2/hist.py
+2
-2
No files found.
samples/python2/hist.py
View file @
6ebb0e2a
...
...
@@ -27,7 +27,7 @@ def hist_curve(im):
elif
im
.
shape
[
2
]
==
3
:
color
=
[
(
255
,
0
,
0
),(
0
,
255
,
0
),(
0
,
0
,
255
)
]
for
ch
,
col
in
enumerate
(
color
):
hist_item
=
cv2
.
calcHist
([
im
],[
ch
],
None
,[
256
],[
0
,
25
5
])
hist_item
=
cv2
.
calcHist
([
im
],[
ch
],
None
,[
256
],[
0
,
25
6
])
cv2
.
normalize
(
hist_item
,
hist_item
,
0
,
255
,
cv2
.
NORM_MINMAX
)
hist
=
np
.
int32
(
np
.
around
(
hist_item
))
pts
=
np
.
int32
(
np
.
column_stack
((
bins
,
hist
)))
...
...
@@ -41,7 +41,7 @@ def hist_lines(im):
print
"hist_lines applicable only for grayscale images"
#print "so converting image to grayscale for representation"
im
=
cv2
.
cvtColor
(
im
,
cv2
.
COLOR_BGR2GRAY
)
hist_item
=
cv2
.
calcHist
([
im
],[
0
],
None
,[
256
],[
0
,
25
5
])
hist_item
=
cv2
.
calcHist
([
im
],[
0
],
None
,[
256
],[
0
,
25
6
])
cv2
.
normalize
(
hist_item
,
hist_item
,
0
,
255
,
cv2
.
NORM_MINMAX
)
hist
=
np
.
int32
(
np
.
around
(
hist_item
))
for
x
,
y
in
enumerate
(
hist
):
...
...
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