You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use harvester with a spicman fx10e camera to get a hyperspectral image. For now, when i run the code, it can get the camera information, but to fetch an image i only get about 600 values in the buffer. it seems that these values are correct as they change if the light is change.
Maybe the acquisition stops before the entire buffer has been read?
Sample Code
from harvesters.core import Harvester
import matplotlib.pyplot as plt
import numpy as np
h = Harvester()
h.add_file("mvGenTLProducer.cti")
h.update()
h.device_info_list[0]
ia = h.create(0)
ia.start()
with ia.fetch(timeout=10) as buffer:
# Let's create an alias of the 2D image component:
component = buffer.payload.components[0]
print(buffer)
_1d = component.data
np.savetxt('test.txt', _1d)
print('1D: {0}'.format(_1d))
_2d = component.data.reshape(component.height, component.width)
print('2D: {0}'.format(_2d))
print(_2d.shape)
plt.figure()
plt.imshow(_2d)
plt.show()
print(
'AVE: {0}, MIN: {1}, MAX: {2}'.format(
np.average(_2d), _2d.min(), _2d.max()
)
)
ia.stop()
ia.destroy()
h.reset()
Hi all,
I am trying to use harvester with a spicman fx10e camera to get a hyperspectral image. For now, when i run the code, it can get the camera information, but to fetch an image i only get about 600 values in the buffer. it seems that these values are correct as they change if the light is change.
Maybe the acquisition stops before the entire buffer has been read?
Sample Code
1024 x 448, Mono12, 458752 elements,
[1090 1015 1020 ... 0 0 0]
1D: [1090 1015 1020 ... 0 0 0]
2D: [[1090 1015 1020 ... 0 0 0]
[ 0 0 0 ... 0 0 0]
[ 0 0 0 ... 0 0 0]
...
[ 0 0 0 ... 0 0 0]
[ 0 0 0 ... 0 0 0]
[ 0 0 0 ... 0 0 0]]
(448, 1024)
Configuration
The text was updated successfully, but these errors were encountered: