get live film from a camera by ported usb or other

Just starting out? Need help? Post your questions and find answers here.
chris319
Enthusiast
Enthusiast
Posts: 782
Joined: Mon Oct 24, 2005 1:05 pm

Re: get live film from a camera by ported usb or other

Post by chris319 »

Another minor optimization: the line

Code: Select all

hm1 - pitch
reduces the amount of calculation needed when moving through horizontal rows of pixels (note that the addressing works from bottom to top).
r7mk4
User
User
Posts: 13
Joined: Tue Aug 02, 2005 2:23 pm

Re: get live film from a camera by ported usb or other

Post by r7mk4 »

Anyone has done the update of the escapi files to Purebasic 5.1 and higher...
I get the error: Native types can't be used with pointers

BTW: Has anyone recorded a movie file (not only pictures) with escapi?


Cheers
technopol
User
User
Posts: 27
Joined: Thu Mar 24, 2011 11:00 pm

Re: get live film from a camera by ported usb or other

Post by technopol »

I guess it doesn't work on 64-bit purebasic (V5.20 LTS); all I get is "Unable to initialize ESCAPI."

Lib is copied to UserLibraries, DLL installed in Windows\system32 but not sure is well registered as regsvr32 didn't recognize it as 32 or 64 bit.

Or is there anything I've done wrong?

Any 64-bit version around?
technopol
User
User
Posts: 27
Joined: Thu Mar 24, 2011 11:00 pm

Re: get live film from a camera by ported usb or other

Post by technopol »

r7mk4 wrote:Anyone has done the update of the escapi files to Purebasic 5.1 and higher...
I get the error: Native types can't be used with pointers

BTW: Has anyone recorded a movie file (not only pictures) with escapi?


Cheers
Just remove the .l after "*mTargetBuf" (line 4 of escapi.pbi). pointers are now all set to integer.
User avatar
JHPJHP
Addict
Addict
Posts: 2251
Joined: Sat Oct 09, 2010 3:47 am

Re: get live film from a camera by ported usb or other

Post by JHPJHP »

OpenCV
- alternative to the Escapi solution
-- everything is located in the zip file
--- 32 / 64 bit (works for most webcams)

Includes
- opencv.pbi
-- show.pb (window resize, window move, mouse callback)
-- capture.pb (saves nframes / nTime)
-- captureall.pb (saves all frames)
-- video.pb (saves video)

Note:
- Esc key to close examples
- fps currently set for 7 (captureall.pb, video.pb)
- CV_FOURCC("M", "S", "V", "C")
-- hundreds of codecs to choose from: http://www.fourcc.org/codecs.php

This is an updated version from work started here: http://www.purebasic.fr/english/viewtop ... 13&t=57128
Last edited by JHPJHP on Thu Oct 31, 2013 11:34 pm, edited 1 time in total.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
User avatar
JHPJHP
Addict
Addict
Posts: 2251
Joined: Sat Oct 09, 2010 3:47 am

Re: get live film from a camera by ported usb or other

Post by JHPJHP »

Updated
- New Functions (opencv.pbi)
-- cvLoadImage
-- cvConvertImage
-- cvGetWindowHandle
-- cvGetWindowName
- New Example
-- convert.pb (cvLoadImage, cvConvertImage)
- Updated show.pb
-- added WindowCallback to capture #WM_DESTROY Window Msg
Last edited by JHPJHP on Thu Oct 31, 2013 11:35 pm, edited 1 time in total.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Mythros
Enthusiast
Enthusiast
Posts: 306
Joined: Mon Aug 19, 2013 3:28 pm

Re: get live film from a camera by ported usb or other

Post by Mythros »

@JHP: OMG! THIS IS AWESOME! However, I have one small request. Can you add compatibility for Carmine 1.09 (OpenNI) & Kinect (XBox360 / PC)?

Thanks alot, buddy!

Keep up the WONDERFUL work! :D
User avatar
JHPJHP
Addict
Addict
Posts: 2251
Joined: Sat Oct 09, 2010 3:47 am

Re: get live film from a camera by ported usb or other

Post by JHPJHP »

Hi Mythros,

That's something I wanted to do when we were working from the previous thread, but I think the only way for me add that compatibility, would be to have either of those webcams to test with - but I don't. I'll do some more research, but I'm not optimistic - Sorry!

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
IdeasVacuum
Always Here
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

Post by IdeasVacuum »

Mythros, as you know, neither the Carmine or the Kinect are standard webcam devices. Why not take a look at their APIs?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Mythros
Enthusiast
Enthusiast
Posts: 306
Joined: Mon Aug 19, 2013 3:28 pm

Re: get live film from a camera by ported usb or other

Post by Mythros »

@JHP, I can test it for you! That wouldn't be a problem at all! :)
User avatar
JHPJHP
Addict
Addict
Posts: 2251
Joined: Sat Oct 09, 2010 3:47 am

Re: get live film from a camera by ported usb or other

Post by JHPJHP »

Hi Mythros,

You were right with your original assessment concerning the steps required to get OpenNI working with OpenCV.
- minimum requirements for 3D sensing Webcam's to work with OpenCV is installing OpenNI, and creating your own binaries
-- http://seevisionc.blogspot.ca/2012/07/c ... i-for.html

But I may have found some precompiled binaries - I'm interested to know if they will work for you?
- binaries, help, and website included in the download (OpenNI required)
Last edited by JHPJHP on Thu Oct 31, 2013 11:35 pm, edited 1 time in total.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Mythros
Enthusiast
Enthusiast
Posts: 306
Joined: Mon Aug 19, 2013 3:28 pm

Re: get live film from a camera by ported usb or other

Post by Mythros »

Idk because I'm not a C++ coder. Even with instructions, I have no idea how to compile it. HOWEVER. If you can compile it and upload it to dropbox, I will be more than willing to test it! :)

Thanks alot, JHP! :)
User avatar
JHPJHP
Addict
Addict
Posts: 2251
Joined: Sat Oct 09, 2010 3:47 am

Re: get live film from a camera by ported usb or other

Post by JHPJHP »

The second part of my previous post included compiled binaries, the first part was only to confirm your initial apprehension.
- I don't currently have the means to compile my own binaries, that's why I'm hoping the following will work for you
But I may have found some precompiled binaries - I'm interested to know if they will work for you?
- binaries, help, and website included in the download (OpenNI required)
Last edited by JHPJHP on Thu Oct 31, 2013 11:36 pm, edited 1 time in total.

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Mythros
Enthusiast
Enthusiast
Posts: 306
Joined: Mon Aug 19, 2013 3:28 pm

Re: get live film from a camera by ported usb or other

Post by Mythros »

Is there supposed to be an EXE in there? Cuz' there's not.

If not, then tell me what you want me to do.

Thanks JHP! :)
User avatar
JHPJHP
Addict
Addict
Posts: 2251
Joined: Sat Oct 09, 2010 3:47 am

Re: get live film from a camera by ported usb or other

Post by JHPJHP »

Refer to the included README.txt. The binaries I'm referring to are the included DLL's, from what I read you need OpenNI installed, and by placing the DLL's into the correct OpenNI folder, OpenCV may be able to recognize your Webcam?
- link includes the URL to the original website: website.txt (also found in README.txt)

If you're not investing in yourself, you're falling behind.

My PureBasic StuffFREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Post Reply