Page 3 of 5
Re: get live film from a camera by ported usb or other
Posted: Wed Oct 30, 2013 6:14 pm
by JHPJHP
I've only scratched the surface with the few functions included in the pbi, but there are literally 100s to choose from.
- I don't mind continuing if there is interest, otherwise this will probably be my last update
Updated
- New Functions (opencv.pbi)
-- cvCreateTrackbar
-- cvGetTrackbarPos
-- cvSetTrackbarPos
-- cvCreateMat (I could not get cvCreateImage working with PureBasic, but the newer cvCreateMat worked flawlessly)
-- cvReleaseImage
- Multiple changes to Constants, Structures, and Procedures
Re: get live film from a camera by ported usb or other
Posted: Wed Oct 30, 2013 6:30 pm
by Mythros
I am
VERY interested in this! PLEASE continue it! I will continue providing beta test support for you!
Also, I will check the DLLs for the camera in a few mins.
Also, is there a way to make the AVI videos 30+ FPS & add captured sound to them from Line-in?
That would be GREAT!
Thanks again, JHP!
Mythros
Re: get live film from a camera by ported usb or other
Posted: Wed Oct 30, 2013 6:46 pm
by JHPJHP
Hi Mythros,
From what I read OpenCV doesn't deal with audio, but I'll see what I can find.
To increase the FPS, modify the following function:
- change the 7 to your desired speed - 30 FPS should be no problem
- FPS is only determined by your camera's limit, and what processing is done after each capture
Code: Select all
*writer = cvCreateVideoWriter(sVideo, CV_FOURCC("M", "S", "V", "C"), 7, @size, 0)
Re: get live film from a camera by ported usb or other
Posted: Wed Oct 30, 2013 8:30 pm
by Mythros
It didn't work.
It's still not detecting my camera...
Here's an image of where I have the files:
http://oi41.tinypic.com/2yzht2f.jpg
Re: get live film from a camera by ported usb or other
Posted: Wed Oct 30, 2013 9:22 pm
by JHPJHP
Looks like your still missing the following DLLs:
- Kinect.dll
- OniFile.dll
- PS1080.dll
To use this driver module, simply put the precompiled dll file(OpenCVCamera32.dll or OpenCVCamera64.dll) in the folder "\OpenNI2\Drivers".
(Where should also has PS1080.dll, OniFile.dll and Kinect.dll)
Missing PrimeSense and possibly the Kinect SDK?
Sorry, it's hard for me to do anything more then this - I'm a Trial & Error kinda programmer.

Re: get live film from a camera by ported usb or other
Posted: Wed Oct 30, 2013 10:27 pm
by Mythros
I think there MAY be a way, but only if you can get PureBasic to work with Python, possibly via OpenCV. And the above didn't work, btw.
Re: get live film from a camera by ported usb or other
Posted: Wed Oct 30, 2013 11:35 pm
by IdeasVacuum
OpenNI + OpenCV + PB = ?
I think if the goal is to use PB with Carmine/Kinect devices, then an OpenNI wrapper might be the best choice, or perhaps the Microsoft SDK:
Kinect For Windows 1.8
Perhaps someone could request an OpenNI lib to be added to PB?
Re: get live film from a camera by ported usb or other
Posted: Wed Oct 30, 2013 11:36 pm
by Mythros
That would be GREAT... But afaic, C++ doesn't like me, and I don't like C++.
Re: get live film from a camera by ported usb or other
Posted: Thu Oct 31, 2013 12:20 am
by IdeasVacuum
With a PB Wrapper, you won't have to worry about C++ (incidently, for devices, the C++ files tend to contain a lot of C, which is easier to follow as it's not so different to Basic).
Interestingly, there is a Kinect Wrapper on the German Forum:
http://www.purebasic.fr/german/viewtopi ... 4&start=10
Re: get live film from a camera by ported usb or other
Posted: Thu Oct 31, 2013 4:32 pm
by Mythros
Grrr. that makes me SO mad.. WHY must it use a C file? WHY?! :'(
Can someone please make a wrapper for Carmine 1.09 / Kinect?

Re: get live film from a camera by ported usb or other
Posted: Thu Oct 31, 2013 11:12 pm
by JHPJHP
The following update includes some examples of what OpenCV can do with images.
- the trick to get some of the functions working was not trusting the documentation 100%
-- cvCreateImage does work with PureBasic, but its parameters were not documented correctly
- added the WindowCallback Procedure to all examples
- flip.pb now has a working example of cvTrackbarCallback
- added the following examples: canny.pb, gray.pb
Update
- added a resize routine to the relevant examples
- added a second swap.pb example... just another way to accomplish a similar result
Re: get live film from a camera by ported usb or other
Posted: Thu Oct 31, 2013 11:29 pm
by IdeasVacuum
Can someone please make a wrapper for Carmine 1.09 / Kinect?
Did you try this one Mythros?
http://www.purebasic.fr/german/viewtopi ... 4&start=10
Re: get live film from a camera by ported usb or other
Posted: Thu Oct 31, 2013 11:32 pm
by Mythros
I tried to get it to work, but I couldn't. for one, I don't understand a word of German, and also, I think it requires some kind of C files, and me & C don't go good together at all.
Re: get live film from a camera by ported usb or other
Posted: Fri Nov 01, 2013 12:15 am
by IdeasVacuum
Well, the code is in English

You don't need to worry about the C code because that is what the PB Wrapper is for.
Download CL NUI SDK (The C code SDK that the PB wrapper is for).
Bottom-right hand corner of their webpage.
http://codelaboratories.com/nui
This is a binary installer, does the work for you. It puts an icon on your desktop, a test app to see if CL NUI can find your Kinect.
It adds a folder in Program Files for the SDK, which includes the lib file that the PB code wraps. The path is something like this (I'm using WinXP): C:\Program Files\Code Laboratories\CL NUI Platform\SDK\Lib
In the PB wrapper code, find the line
and change that to be the full path to the lib. Dige has posted some sample PB code in a further message on the same forum post. So, give it a go!
Re: get live film from a camera by ported usb or other
Posted: Fri Nov 01, 2013 12:20 am
by IdeasVacuum
...by the way, there is absolutely no need for an aversion to C. If you can code in PB, then you can definitely code in C, it is a very simple language. You will find that to be true if you just give it 30 minutes of your time:
C Programming in Easy Steps