OpenCores
URL https://opencores.org/ocsvn/qaz_libs/qaz_libs/trunk

Subversion Repositories qaz_libs

[/] [qaz_libs/] [trunk/] [BFM/] [sim/] [tests/] [tb_video_frame_dpi/] [py_video.py] - Blame information for rev 43

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 43 qaztronic
#
2
 
3
import numpy as np
4
import matplotlib.pyplot as plt
5
 
6
fname = 'count.raw'
7
v_frames = 1
8
v_width = 8
9
v_height = 16
10
 
11
data = np.arange(v_frames*v_width*v_height, dtype='uint16')
12
 
13
with open(fname, 'w+') as infile:
14
  data.tofile(infile, format='uint16')
15
 
16
infile.close()
17
 
18
# ---------------------------------------------------------
19
with open(fname, 'r') as infile:
20
  data = np.fromfile(infile, dtype='uint16').reshape(v_frames, v_height, v_width)
21
 
22
np.set_printoptions(formatter={'int':hex})
23
 
24
for i in range(v_frames):
25
  fig, ax = plt.subplots()
26
  im = ax.imshow(data[i], cmap='gray')
27
  ax.set(xticks=[], yticks=[])
28
  fig.colorbar(im)
29
  plt.show()
30
 
31
print(data[0])

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.