Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spicman fx10e camera, buffer has only one line #467

Open
Neithard opened this issue Jul 3, 2024 · 0 comments
Open

spicman fx10e camera, buffer has only one line #467

Neithard opened this issue Jul 3, 2024 · 0 comments

Comments

@Neithard
Copy link

Neithard commented Jul 3, 2024

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

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()

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

  • OS: Windows 10
  • Python: 3.11
  • Harvester: latest
  • GenTL Producer: Balluff
  • Camera: spicman fx10e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant