Conversation
samples/python/hist.py
Outdated
| hist = np.around(hist_item) | ||
| for x,y in enumerate(hist): | ||
| cv.line(h,(x,0),(x,y),(255,255,255)) | ||
| cv.line(h,(int(x),0),(int(x),int(y)),(255,255,255)) |
There was a problem hiding this comment.
what was wrong with type of y too?
There was a problem hiding this comment.
it is numpy array of one float element
samples/python/video_v4l2.py
Outdated
| cv.namedWindow("Video") | ||
|
|
||
| convert_rgb = True | ||
| convert_rgb = 1 |
There was a problem hiding this comment.
It makes sense to replace passing of convert_rgb argument instead of changing its type:
convert_rgb => 1 if convert_rgb else 0
| fig = plt.figure() | ||
| ax = fig.gca(projection='3d') | ||
| ax.set_aspect("equal") | ||
| ax.set_aspect("auto") |
There was a problem hiding this comment.
There was a problem hiding this comment.
@catree, this is because of matplotlib bug in versions >=3.1.0 on Windows. The picture depends on window size, the graph is still valid. On latest versions of matlotlib the picture doesn't change with window resizing

There was a problem hiding this comment.
Ok, I will trust your change. Any possibility to make it looks good on any platform regardless of the Matplotlib version would be welcome.
|
@APrigarina Please rebase patch on latest master branch (there was merged 3.4 variant of this patch) |
samples/python/hist.py
Outdated
| hist = np.around(hist_item) | ||
| for x,y in enumerate(hist): | ||
| cv.line(h,(x,0),(x,y[0]),(255,255,255)) | ||
| cv.line(h,(x,0),(x,int(y)),(255,255,255)) |
There was a problem hiding this comment.
Why we should have different code on 3.4 and master branch?
There was a problem hiding this comment.
on 3.4 branch there was array of one integer element, on master branch - of one float
There was a problem hiding this comment.
There was hist=np.int32(...) above.
There was a problem hiding this comment.
yes, I missed it, thanks


This PR fixes errors in some samples