Crowdfund this: Monkey Camera module

Monkey Forums/Monkey Programming/Crowdfund this: Monkey Camera module

Difference(Posted 2013) [#1]
I thought I'd give this crowdfunding idea a go.
(I havent cleared it with BLR, so feel free to object, lock and delete this topic, If this is a bad place to do this.)

Project:

A Public domain licensed camera module, that works on devices with camera (iOs, Android and Windows phone 8)

The camera module should allow use of a device camera in monkey/mojo resulting in:

1) A live video feed, where it is possible to draw on top with mojo commands.
2) Snapshots with ReadPixeld Access.

(Please use this topic only for pledging, expanding the project description and committing to programming the module)

If you would like to code this. please reply in this topic, and give an estimate.

If you would like to pledge and amount to development, please state your amount.

I Guess payment would be through Paypal.

Programmers : Feel free to set up the project on www.fundageek.com or similar.


[CURRENT FUNDING ( updated 16/5-2013) ]

CopperCircle GBP £50 ( providing there is WP8 support)
Difference 50 USD
Beaker $50 for android and iOS. Pref. One desktop target, OpenCV OK.
Soap $50


Difference(Posted 2013) [#2]
I'm pleading 40 USD for this module if it works at least on iOS and Android.

[EDIT: ] Upped to 50 USD. :-)


EdzUp(Posted 2013) [#3]
I would say all targets should have access to the webcam to some extent as all laptops these days come with webcams. For things like flash/html5 etc even a snapshot system would be cool :)


Skn3(Posted 2013) [#4]
Sorry I did mean to reply in the other thread.

The only open source solution I found that could be wrapped is OpenCV. They support desktop, iOS and android in the lib and there is a port to WP7 but I don't know how much is ported.

If you were to count windows phone out then OpenCV would be quite a nice thing to have in Monkey. It has a ton of things todo with image recognition!

Otherwise, I think to do this properly (for all monkey targets) would require writing a cross platform camera module from scratch. I would say that is a fairly fiddly (and therefor time consuming/expensive) project to take on. I might be interested in developing, but I will see how much interest there is in funding.


Difference(Posted 2013) [#5]
OpenCV sounds great.

I'm pleading 40 USD for OpenCV Monkey.


CopperCircle(Posted 2013) [#6]
I would like WP8 support and would pledge £50


Difference(Posted 2013) [#7]
Bump


Skn3(Posted 2013) [#8]
Roll up roll up, lets be avin ya!


Xaron(Posted 2013) [#9]
You really need that, mhh? ;)


Beaker(Posted 2013) [#10]
I'll put in $50 for android and iOS. One desktop target (flash?) would be good for testing purposes as well, but not essential. OpenCV is a great idea as well.


AdamRedwoods(Posted 2013) [#11]
camera capture seems easier on iOS/android/wp8 than OSX/Win/linux. on WinXP+ one would need to interface with the WIA. Linux would be Video4Linux. OSX would use QtKit.

OpenCV seems large, it uses ffmpeg.


Skn3(Posted 2013) [#12]
It would be fairly straightforward to make the image capture module. Write monkey API, read the different SDK docs and the connect to each platform with glue. The thing is the development time. To get this running on 3+ platforms smoothly would take a fair amount of time so it will be interesting to see if there is enough support to fund it.

As a realistic (and probably optimistic) estimate I would say this would take minimum 30 hours. Probably longer if you take into account documentation, research, testing, bug fixing and potential "hacking" of monkey.


CopperCircle(Posted 2013) [#13]
Maybe we could invest in one target an then see if the community could help with adding the other targets. I would be able to do the WP8 native stuff, I just don't have allot of time at the mo and would rather contribute to a fund to get it done.


Difference(Posted 2013) [#14]
Bumpety


Difference(Posted 2013) [#15]
A final bump before I let this go.

Anyone ?


Soap(Posted 2013) [#16]
I'll put $50 on anything others want. There isn't anything major I really need at the moment.


Evil Roy Ferguson(Posted 2013) [#17]
It's not exactly the platform people are hoping for, but since it's a very quick thing to hammer out in HTML5...

http://wafflemind.net/soft/lib/monkeycam.zip

Should work in Chrome or Firefox; Internet Explorer is somewhat predictably left out of the party.

I'll try to look into adding support for other targets at some point, but can't make any promises re: if or when.


mjcamerer(Posted 2013) [#18]
Hey this is really cool! Thanks!


Soap(Posted 2013) [#19]
Put it up on Github!


blueFire(Posted 2013) [#20]
t's not exactly the platform people are hoping for, but since it's a very quick thing to hammer out in HTML5...

http://wafflemind.net/soft/lib/monkeycam.zip

Should work in Chrome or Firefox; Internet Explorer is somewhat predictably left out of the party.

I'll try to look into adding support for other targets at some point, but can't make any promises re: if or when.


I tried this and got the following error: Error :

C:/Temp/monkeycam/monkeycam/monkeycam.monkey<57> : Error : Type 'CameraImpl' not found

I am new at Monkey so it may be something I done wrong.

Jason


nikoniko(Posted 2014) [#21]
Look at Apache Cordova project (ex PhoneGAP), it has camera plugin for most platforms with source code.


Evil Roy Ferguson(Posted 2014) [#22]
@blueFire: Monkey changed some things since this was written, and it no longer worked. I uploaded a fixed version since the changes were pretty minor. Make sure to run 'test' and to target HTML5.


nikoniko(Posted 2014) [#23]
error in ff25 monkey 76d
Monkey Runtime Error : [Exception... "Component is not available" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://localhost:56380/main.js :: gxtkGraphics.prototype.DrawSurface :: line 1231" data: no]
D:/Monkey/modules/mojo/graphics.monkey<458>
D:/Monkey/NikoGames/tests/monkeycam/test.monkey<30>
D:/Monkey/modules/mojo/app.monkey<65>


Evil Roy Ferguson(Posted 2014) [#24]
http://stackoverflow.com/questions/18580844/firefox-drawimagevideo-fails-with-ns-error-not-available-component-is-not-av

Unfortunately, this is due to a bug in Firefox 21+ or so. Hope they fix it, but, well... check their bug tracker and look at the number of bugs that are five or more years old. Go ahead, I'll wait. :)

Basically, it's failing because Firefox says the video stream is ready before it actually is, so drawing the image to the canvas fails -- unfortunately, since the exception it's causing is a "normal" JS exception, it can't be caught from Monkey code. The only "complete" workaround for now would be, in the .js file, to create a dummy canvas and keep trying to draw the webcam to it until it succeeded before reporting back to Monkey that initializing the camera succeeded. Hopefully, Mozilla will fix the bug before we have to resort to that.

For now, I've uploaded a version that "usually" works by adding a 120ms delay before reporting back that the camera is initialized.


nikoniko(Posted 2014) [#25]
Thanks, now working for me with SetTimeout(.., 200) instead 120 ms

I found working example without settimeout trick with DOMContentLoaded event capture. Seems it is fully correct
Link http://davidwalsh.name/browser-camera


Evil Roy Ferguson(Posted 2014) [#26]
The difference here doesn't actually have anything to do with DOMContentLoaded, but that he's displaying the camera directly via a <video> element, which you can't really do in Monkey. Firefox blows up when you try to grab the contents of the current frame and draw it to a canvas, which his example doesn't do unless you click the "Snap" button.