Hi everyone Is this correct way to set the basler camera parameters using basler?
Is any other way to access camera after calling camera.stratGrabbing() function?
I am getting error like :
return _genicam.IInteger_SetValue(self, Value, Verify)
_genicam.AccessException: Node is not writable. : AccessException thrown in node 'Height' while calling 'Height.SetValue()' (file 'integert.h', line 77)
import cv2
from pypylon import pylon
camera = pylon.InstantCamera(pylon.TlFactory.GetInstance().CreateFirstDevice())
converter = pylon.ImageFormatConverter()
camera.Open()
camera.CenterX=False
camera.CenterY=False
# demonstrate some feature access
new_width = camera.Width.GetValue() - camera.Width.GetInc()
if new_width >= camera.Width.GetMin():
camera.Width.SetValue(new_width)
numberOfImagesToGrab = 100
camera.StartGrabbing()
camera.Open()
print("Max gain",camera.Gain.Max)
print("Min gain",camera.Gain.Min)
print("Max ExposureTime",camera.ExposureTime.Max)
print("Min ExposureTime",camera.ExposureTime.Min)
i=0
j=0
while camera.IsGrabbing():
grabResult = camera.RetrieveResult(5000, pylon.TimeoutHandling_ThrowException)
if grabResult.GrabSucceeded():
i+=1
j+=1
if i==700:
print(i)
#camera.Open()
camera.Height.SetValue( 200)
camera.Width.SetValue( 300)
camera.Gain=5
camera.ExposureTime=8000
i=0
if j==500:
#camera.Open()
print(j)
camera.Height.SetValue(1088)
camera.Width.SetValue( 2048)
camera.Gain=20
camera.ExposureTime=8000
j=0
# Access the image data.
print("AMAR :",camera.IsOpen())
image = converter.Convert(grabResult)
img = image.GetArray()
cv2.imshow("image",img)
cv2.waitKey(1)
grabResult.Release()
camera.Close()