Accesing Pictures From my Basler Camera
Hi all,
i am using pypylon 1.1.0 with Python 3.6 and a Basler acA2500-14gm. My Problem is that when i Try to "Grab" an Image The Code Ends Without an Error.
This is The Code I am Using
import pypylon.pylon as pylon
import matplotlib.pyplot as plt
import numpy as np
import cv2
tlfactory = pylon.TlFactory.GetInstance()
ptl = tlfactory.CreateTl('BaslerGigE')
detected_devices = ptl.EnumerateDevices()
print('%i devices detected:' % len(detected_devices))
print([d.GetFriendlyName() for d in detected_devices])
print(' ')
if(len(detected_devices) == 0):
import sys; sys.exit()
print('Create camera device')
cam = pylon.InstantCamera(ptl.CreateDevice(detected_devices[0]))
print("123")
counter = 0
print("123")
cam.Open
print("123")
grab_results = cam.GrabOne(40)
print(grab_results)
print("DONE")
image = grab_results.Array
plt.imshow(image)
plt.show()
And This is The Output
=============================== RESTART: Shell ===============================
>>>
RESTART: C:\Users\Kieran Hedges\Documents\python\Testing Cython\Basler Kamera\Test_2.py
1 devices detected:
['Basler acA2500-14gm (22576214)']
Create camera device
123
123
123
=============================== RESTART: Shell ===============================
>>>
Does Someone Have An Idea What The Problem Could Be?
Thanks
So The Problem is solved it seems that my installation was Accesing other installations of similar packages (that were also called pypylon) and that was causing all of the trouble