get live film from a camera by ported usb or other
Re: get live film from a camera by ported usb or other
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
- 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
Last edited by JHPJHP on Thu Oct 31, 2013 11:41 pm, edited 2 times in total.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: get live film from a camera by ported usb or other
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

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
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
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)
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: get live film from a camera by ported usb or other
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

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
Looks like your still missing the following DLLs:
- Kinect.dll
- OniFile.dll
- PS1080.dll
Sorry, it's hard for me to do anything more then this - I'm a Trial & Error kinda programmer.
- Kinect.dll
- OniFile.dll
- PS1080.dll
Missing PrimeSense and possibly the Kinect SDK?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)
Sorry, it's hard for me to do anything more then this - I'm a Trial & Error kinda programmer.

If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: get live film from a camera by ported usb or other
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.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: get live film from a camera by ported usb or other
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?
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?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: get live film from a camera by ported usb or other
That would be GREAT... But afaic, C++ doesn't like me, and I don't like C++.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: get live film from a camera by ported usb or other
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
Interestingly, there is a Kinect Wrapper on the German Forum:
http://www.purebasic.fr/german/viewtopi ... 4&start=10
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: get live film from a camera by ported usb or other
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?
Can someone please make a wrapper for Carmine 1.09 / Kinect?

Re: get live film from a camera by ported usb or other
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
- 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
Last edited by JHPJHP on Fri Nov 01, 2013 12:29 am, edited 2 times in total.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: get live film from a camera by ported usb or other
Did you try this one Mythros?Can someone please make a wrapper for Carmine 1.09 / Kinect?
http://www.purebasic.fr/german/viewtopi ... 4&start=10
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: get live film from a camera by ported usb or other
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.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: get live film from a camera by ported usb or other
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!

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
Code: Select all
ImportC "CLNUIDevice.lib"
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: get live film from a camera by ported usb or other
...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
C Programming in Easy Steps
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.