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

Connect two Gig-E cameras in the same python script #344

Open
FabioContipolimi opened this issue May 16, 2022 · 10 comments
Open

Connect two Gig-E cameras in the same python script #344

FabioContipolimi opened this issue May 16, 2022 · 10 comments
Labels
question Need knowledge

Comments

@FabioContipolimi
Copy link

Hi,

is it possible to connect two Gig-E cameras within the same python script?

@TKaluza
Copy link

TKaluza commented May 17, 2022

Hello!

This depends on your "script" or program.

@FabioContipolimi
Copy link
Author

FabioContipolimi commented May 17, 2022 via email

@TouchTheFishy
Copy link

Hey Fabio,

I did it myself so it is possible. You just need to :

  • Create one image acquirer that connects to both cameras and return the handler
  • Create two threads (one per camera) and pass it the handler object. These will scan simultaneously.

If you create two image acquirer you'll have IO conflicts.

Cheers

Fishy

@kazunarikudo
Copy link
Member

@FabioContipolimi Hi Fabio, thank you for the message and I am sorry for having kept you waiting.

is it possible to connect two Gig-E cameras within the same python script?

Sure, it is. In general, you need just one Harvester object no matter how many devices you work with; you can have multiple Harvester objects but it is not necessary to talk now.

On the Harvester.update method call, then it will update the list of device information and you should be able to check the result by reading its Harvester.device_info_list property. There you will find the devices that you should be familiar with.

You can learn how an ImageAcquirer object by visiting this test script but the most trivial approach would be to pass an index to the Harvester.create method.

Anyway, please give it a try and let me know if you face an issue that you do not expect to see. Regards, Kazunari.

@kazunarikudo kazunarikudo added the question Need knowledge label May 30, 2022
@FabioContipolimi
Copy link
Author

FabioContipolimi commented May 30, 2022 via email

@FabioContipolimi
Copy link
Author

FabioContipolimi commented May 30, 2022 via email

@kazunarikudo
Copy link
Member

Hi, thank you for the update.

is it possible to use a multiprocess approach rather than multithreading?

I am afraid, but the current Harvester supports threading but not processing. I would appreciate it if you could tell me why you need processing instead of threading. Yes, that would be great if you could show a piece of code you expect to have just as an example. Thanks.

@FabioContipolimi
Copy link
Author

FabioContipolimi commented May 30, 2022 via email

@y2k0999
Copy link

y2k0999 commented Jun 28, 2024

Hey Fabio,

I did it myself so it is possible. You just need to :

  • Create one image acquirer that connects to both cameras and return the handler
  • Create two threads (one per camera) and pass it the handler object. These will scan simultaneously.

If you create two image acquirer you'll have IO conflicts.

Cheers

Fishy

Are you conflating image acquirer objects with a harvester core object? I don't think one image acquirer can connect to multiple devices.

Do you still have the code where you did this?

Best

@JianxiangFENG
Copy link

Hey Fabio,
I did it myself so it is possible. You just need to :

  • Create one image acquirer that connects to both cameras and return the handler
  • Create two threads (one per camera) and pass it the handler object. These will scan simultaneously.

If you create two image acquirer you'll have IO conflicts.
Cheers
Fishy

Are you conflating image acquirer objects with a harvester core object? I don't think one image acquirer can connect to multiple devices.

Do you still have the code where you did this?

Best

I am also stuck in the same problem, where two image acquirers for two cameras don't work. Have you found any solutions on this? Any information would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Need knowledge
Projects
None yet
Development

No branches or pull requests

6 participants