original fw + ftrobopy+ OpenCV ?
Forumsregeln
Bitte beachte die Forumsregeln!
Bitte beachte die Forumsregeln!
original fw + ftrobopy+ OpenCV ?
@Torsten as discussed in http://forum.ftcommunity.de/viewtopic.php?f=33&t=4470, is it possible to add OpenCV to ftrobopy somehow so it can be used on the original firmware?
Thank you.
hvn
Thank you.
hvn
Re: original fw + ftrobopy+ OpenCV ?
Hi hvn,
If you need camera access with the original firmware you could use the v4l-Libraries (see my ftDigiCam-Project).
Best,
Torsten
I think that it is possible but it would need quite some work. OpenCV is a big package and depends on many other modules that all would have to be ported. Since OpenCV is nicely supported under the cfw this is the way to go. I don't see myself porting OpenCV to the original firmware soon (or ever).hvn hat geschrieben:@Torsten as discussed in http://forum.ftcommunity.de/viewtopic.php?f=33&t=4470, is it possible to add OpenCV to ftrobopy somehow so it can be used on the original firmware?
Thank you.
hvn
If you need camera access with the original firmware you could use the v4l-Libraries (see my ftDigiCam-Project).
Best,
Torsten
Re: original fw + ftrobopy+ OpenCV ?
Hi Torsten,
Thank you for the answer. Didn't know about that project and will give it a try.
Regards,
hvn
Thank you for the answer. Didn't know about that project and will give it a try.
Regards,
hvn
Re: original fw + ftrobopy+ OpenCV ?
I installed ftrobopytools and get a pixel error using .initCam(fps, width, height, 0, 0) while partly following your github example, actually on both firmwares. Any idea why?
Re: original fw + ftrobopy+ OpenCV ?
What error do you exactly get ? and how does your python script look like ?hvn hat geschrieben:I installed ftrobopytools and get a pixel error using .initCam(fps, width, height, 0, 0) while partly following your github example, actually on both firmwares. Any idea why?
Re: original fw + ftrobopy+ OpenCV ?
The error I first got was: "ftrobopytools.error: error set pixel format in cam_init
Now I get another error: "undefined symbol: Py_InitModule4".
What I used from you ftDigiCam.py is the initialization:
import ftrobopytools
fps = 15
width = 320
height = 240
videv = ftrobopytools.camInit(fps, width, height, 0, 0)
Now I get another error: "undefined symbol: Py_InitModule4".
What I used from you ftDigiCam.py is the initialization:
import ftrobopytools
fps = 15
width = 320
height = 240
videv = ftrobopytools.camInit(fps, width, height, 0, 0)
Re: original fw + ftrobopy+ OpenCV ?
The commands I can see here are correct but be aware that ftrobopytools can not be used together with the ftrobopy camera commands (startCameraOnline, stopCameraOnline and getCameraFrame). Make sure that ftrobopy.startCameraOnline is _not_ called, when using ftrobopytools.camInit(...)hvn hat geschrieben:The error I first got was: "ftrobopytools.error: error set pixel format in cam_init
Now I get another error: "undefined symbol: Py_InitModule4".
What I used from you ftDigiCam.py is the initialization:
import ftrobopytools
fps = 15
width = 320
height = 240
videv = ftrobopytools.camInit(fps, width, height, 0, 0)
Re: original fw + ftrobopy+ OpenCV ?
More info. First: the error I get now:
$ ./run_python Mirft2.py
Connected to TX2013 firmware version 4.2.4
Camera connected
Traceback (most recent call last):
File "Mirft2.py", line 41, in <module>
videv = ftrobopytools.camInit(fps, width, height, 0, 0)
ftrobopytools.error: error set pixel format in cam_init
Network error 'NoneType' object is not callable
Network error
Exception in thread Thread-3 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/opt/knobloch/lib/python2.7/threading.py", line 810, in __bootstrap_inner
File "/opt/knobloch/ftrobopy.py", line 1291, in run
<type 'exceptions.TypeError'>: 'NoneType' object is not callable
Then the code, taken from ftDigiCam.py at GitHub:
# cam init
fps = 15
width = 320
height = 240
videv = ftrobopytools.camInit(fps, width, height, 0, 0) # line 41
#take ftrobopytools image
jpg = ftrobopytools.getJPEGImage(videv)
ftrobopytools.camClose(videv, 0)
try:
with open(fname_prefix+'IDX','r') as f:
pict_number = int(f.read())
except:
pict_number = 0
with open(fname_prefix + '%04i' % pict_number +'.JPG', 'wb') as f:
f.write(jpg)
with open(fname_prefix+'IDX','w') as f:
f.write(str(pict_number + 1))
# rest of program
Initially I thought that txt.getCameraFrame() would harm, but that's in a separate function not being called yet at the time of this error.
$ ./run_python Mirft2.py
Connected to TX2013 firmware version 4.2.4
Camera connected
Traceback (most recent call last):
File "Mirft2.py", line 41, in <module>
videv = ftrobopytools.camInit(fps, width, height, 0, 0)
ftrobopytools.error: error set pixel format in cam_init
Network error 'NoneType' object is not callable
Network error
Exception in thread Thread-3 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/opt/knobloch/lib/python2.7/threading.py", line 810, in __bootstrap_inner
File "/opt/knobloch/ftrobopy.py", line 1291, in run
<type 'exceptions.TypeError'>: 'NoneType' object is not callable
Then the code, taken from ftDigiCam.py at GitHub:
# cam init
fps = 15
width = 320
height = 240
videv = ftrobopytools.camInit(fps, width, height, 0, 0) # line 41
#take ftrobopytools image
jpg = ftrobopytools.getJPEGImage(videv)
ftrobopytools.camClose(videv, 0)
try:
with open(fname_prefix+'IDX','r') as f:
pict_number = int(f.read())
except:
pict_number = 0
with open(fname_prefix + '%04i' % pict_number +'.JPG', 'wb') as f:
f.write(jpg)
with open(fname_prefix+'IDX','w') as f:
f.write(str(pict_number + 1))
# rest of program
Initially I thought that txt.getCameraFrame() would harm, but that's in a separate function not being called yet at the time of this error.