Learning to script, having file permission errors
Posted: Fri Nov 24, 2023 3:45 am
Error - Single frame capture failed - A required privilege not found.
I'm learning how to do Python and not doing a good job at it either.
So far, this is the script that I'm cobbling together. It works after a fashion, but I keep getting the above error. The file permissions within Windows are all set properly, so what am I missing here?
I'm also getting this error for this bit -
SharpCap.SelectedCamera.Controls.OutputFormat.Value = 'PNG files (*.png)'
Traceback (most recent call last):
File "<string>", line 5, in <module>
AttributeError: 'NoneType' object has no attribute 'Controls'
My simplistic code. This was copied and pasted from various sources that I could find.
===========================================================================
SharpCap.SelectedCamera = SharpCap.Cameras.Find(lambda x:x.DeviceName == "QSI Camera")
SharpCap.Wheels.SelectedWheel.Position = 1 #LUM
SharpCap.SelectedCamera.Controls.OutputFormat.Value = 'PNG files (*.png)'
SharpCap.SelectedCamera.Controls.Exposure.Value = 0.02 #seconds
SharpCap.SelectedCamera.CaptureSingleFrameTo("c:\SC_test\test.png")
# SharpCap.Transforms.SelectedTransform = AutoStretch (not sure if this one is correct)
I'm learning how to do Python and not doing a good job at it either.
So far, this is the script that I'm cobbling together. It works after a fashion, but I keep getting the above error. The file permissions within Windows are all set properly, so what am I missing here?
I'm also getting this error for this bit -
SharpCap.SelectedCamera.Controls.OutputFormat.Value = 'PNG files (*.png)'
Traceback (most recent call last):
File "<string>", line 5, in <module>
AttributeError: 'NoneType' object has no attribute 'Controls'
My simplistic code. This was copied and pasted from various sources that I could find.
===========================================================================
SharpCap.SelectedCamera = SharpCap.Cameras.Find(lambda x:x.DeviceName == "QSI Camera")
SharpCap.Wheels.SelectedWheel.Position = 1 #LUM
SharpCap.SelectedCamera.Controls.OutputFormat.Value = 'PNG files (*.png)'
SharpCap.SelectedCamera.Controls.Exposure.Value = 0.02 #seconds
SharpCap.SelectedCamera.CaptureSingleFrameTo("c:\SC_test\test.png")
# SharpCap.Transforms.SelectedTransform = AutoStretch (not sure if this one is correct)