Open Achim123 opened 7 years ago
Hello! Yes I didn't know that 3.10 had been released. I have only tested with 3.08. I'll take a look at this tonight.
Thanks for the report!
Hello, I was able to reproduce the issue by running it in Python3. I have pushed some changes that should resolve it: https://github.com/derricw/pysentech/commit/e01080e47bed7699cade90b40f30af03e2897fd8
Give it a try and let me know if it works for you.
Hello Derric,
thank you four your first help ! i tested my code again with the new version : it's getting better , but not ok ...
sys.path.append('C:\Python36\lib\site-packages\pysentech') from pysentechimport SentechSystem os.environ['PATH']+= os.pathsep+ 'D:\Open-CV\StandardSDK\Bin\x64' system= SentechSystem('d:/open-cv/StandardSDK')
print( system.camera_count())
""" Or saved to a file using the SDK's file-saving functions: cmode = c_ushort() cam.StCam_GetBinningSumMode(byref(cmode)) cmode.value """ cam= system.get_camera(0) print(cam.model)
frame= cam.grab_frame()
print(frame)
output: it seems so that some functions with the frame instance are not working: as_numpy, as_pil, to_file
1
b'STC-MCCM200U3V'
(2048, 1088)
<pysentech.frame._SentechFrame object at 0x000001E6E46CAEB8>
Traceback (most recent call last):
File "D:/Open-CV/sentech.py", line 33, in
the next text with your example: low_level_cv2.py:
C:\Python36\pythonw.exe D:/Open-CV/examples/low_level_cv2.py
DLL loaded!
Cameras found: 1
Camera open! Handle: 13856768
Camera image shape: 2048x1088
Failed to set pixel format!
Camera pixel format: 4
Camera bits per pixel: 1
Camera bytes per image: 2228224
Traceback (most recent call last):
File "D:/Open-CV/examples/low_level_cv2.py", line 111, in
Am 28.02.2017 um 06:28 schrieb Derric Williams:
Hello, I was able to reproduce the issue by running it in Python3. I have pushed some changes that should resolve it: e01080e https://github.com/derricw/pysentech/commit/e01080e47bed7699cade90b40f30af03e2897fd8
Give it a try and let me know if it works for you.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/derricw/pysentech/issues/1#issuecomment-282946147, or mute the thread https://github.com/notifications/unsubscribe-auth/AY3QJEDRYcd9JLfj3vDWyCaCBe5pRb3Qks5rg7BqgaJpZM4MNjo1.
It looks like you are using a color camera.
I will take a look at this tonight, but unfortunately I don't have a color camera to test with. It is definitely a problem with the creation of the image array. We may just be able to create a 2048x1088x3 c_ubyte array (and a matching numpy one) to accommodate the color image buffers.
If you open the camera in StCamWare software, are you able to set it to "GRAY8", or some format that only uses 8 bits per pixel? What formats are available?
Hello Derric, thanks for your answer. yes , you are right, i use a color-camera. It is not possible to set GRAY8 in the StCamWare software.
thanks for your help ! Joachim
Am 28.02.2017 um 23:29 schrieb Derric Williams:
It looks like you are using a color camera. Try setting the pixel format to "Mono8". I will take a look at this tonight, but unfortunately I don't have a color camera to test with.
If you open the camera in StCamWare software, are you able to set it to "GRAY8"?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/derricw/pysentech/issues/1#issuecomment-283182116, or mute the thread https://github.com/notifications/unsubscribe-auth/AY3QJFzx1h4n9IoGSgzGwFqGRogR8Cr6ks5rhJ_ggaJpZM4MNjo1.
Hey, I still don't have a color camera to test with, but I've added a script that should work. Take a look at low_level_color_cv2.py and let me know if it works. If so I'll try and add support to the high-level interface.
Dear derricw, Thanks for package it's really help. Had error when run the camera.
I have followed all you correction to get in Python 3 and SDK 3.10, knowing that SDK know is in 3.12 version. Using color camera MCA05MUSB3.
tested the low_level_color_cv2.py.
When : cameras_available = dll.StCam_CameraCount(None) print("Cameras found: {}".format(cameras_available))
the error :
C:/Users/t.abed/Desktop/sdk_folder
Traceback (most recent call last):
File "C:/Users/t.abed/Desktop/.PyCharmCE2017.1/cam/CameraSentech.py", line 16, in
Should i change something in DLL. Thank you in advance.
Hello, i have a a problem: sdk: 3.10 and python 3.6.0 # thank you for help !
TestCode:
-*- coding: utf-8
import sys,os sys.path.append('C:\Python36\lib\site-packages\pysentech') from pysentech import SentechSystem os.environ['PATH'] += os.pathsep + 'D:\Open-CV\StandardSDK\Bin\x64' system = SentechSystem('d:/open-cv/StandardSDK') print( system.camera_count()) # this works ! cam = system.get_camera(0) # here the error appears !
C:\Python36\pythonw.exe D:/Open-CV/sentech.py 1 Traceback (most recent call last): File "D:/Open-CV/sentech.py", line 26, in
cam = system.get_camera(0)
File "C:\Python36\lib\site-packages\pysentech\system.py", line 39, in get_camera
return SentechCamera(index, self.dll)
File "C:\Python36\lib\site-packages\pysentech\camera.py", line 67, in init
self._setup_frame()
File "C:\Python36\lib\site-packages\pysentech\camera.py", line 88, in _setup_frame
width, height = self.image_shape
File "C:\Python36\lib\site-packages\pysentech\camera.py", line 126, in image_shape
cwidth, cheight)
File "C:\Python36\lib\site-packages\pysentech\camera.py", line 42, in method
result = function(cam.handle, *args, **kwargs)
OSError: exception: access violation reading 0x000000005B2C0B28
Exception ignored in: <bound method SentechCamera.del of <camera.SentechCamera object at 0x0000026C5A475390>>
Traceback (most recent call last):
File "C:\Python36\lib\site-packages\pysentech\camera.py", line 286, in del
File "C:\Python36\lib\site-packages\pysentech\camera.py", line 282, in release
AttributeError: frame
Process finished with exit code 1