Camera Code
Mar 28 2009, 7:10 pm
By: A_of-s_t  

Mar 28 2009, 7:10 pm A_of-s_t Post #1

aka idmontie

Does any one know any source code for any language that would make a connected camera take a picture and save it? If it helps, I'm using an outdated Argus DC 1600.



Personal GitHub
Starcraft GitHub Organization - Feel free to request member status!
TwitchTV

Mar 30 2009, 10:04 pm Doodle77 Post #2



Is it a webcam?
If not, set up your cd-rom drive so that it hits the button to take a picture and use
Code
#include <mmsystem.h>
...
 mciSendString("open cdaudio",0,0,0);
 mciSendString("set cdaudio door open",0,0,0);
 mciSendString("close cdaudio",0,0,0);


Post has been edited 1 time(s), last time on Mar 30 2009, 10:11 pm by Doodle77.



None.

Mar 31 2009, 5:38 am A_of-s_t Post #3

aka idmontie

Hmm... that might not work in this case. However, it COULD be a webcam, it depends on which computer I use.

Post has been edited 1 time(s), last time on Mar 31 2009, 5:46 am by A_of-s_t.



Personal GitHub
Starcraft GitHub Organization - Feel free to request member status!
TwitchTV

Apr 1 2009, 2:21 am A_of-s_t Post #4

aka idmontie

I found some code for python that I'm going to try out:

Code
import appuifw, e32, camera


app_lock = e32.Ao_lock()
#Define the exit function
def quit():
    #Close the viewfinder
    camera.stop_finder()
    #Release the camera so that other programs can use it
    camera.release()
    app_lock.signal()
appuifw.app.exit_key_handler = quit

#Function for displaying the viewfinder
def vf(im):
    appuifw.app.body.blit(im)

#Function for taking the picture
def take_picture():
    #Take the photo
    photo = camera.take_photo('RGB', (1024, 768))
    #Save it at maximum quality
    photo.save(photo_savepath, quality = 100)
    #Restart the viewfinder
    camera.stop_finder()
    camera.start_finder(vf)

photo_savepath = u"C:\\photo.jpg"  
#This is the path and name for storing the photo

#Set the application's body to Canvas
appuifw.app.body = appuifw.Canvas()

#Start the viewfinder
camera.start_finder(vf)

#Set the script title
appuifw.app.title = u"Capture Photo"

#Set the application's menu with the option to take the photo
appuifw.app.menu=[(u"Take photo", take_picture),(u"Exit",quit)]

#Wait for the user to request the exit
app_lock.wait()


Problem solved.... FOR NOW >.>



Personal GitHub
Starcraft GitHub Organization - Feel free to request member status!
TwitchTV

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[10:13 pm]
Oh_Man -- No APM in chess. Computer just outthinks the human by seeing more moves ahead and more permutations
[10:12 pm]
Oh_Man -- U reckon? Kasparov waa defeated by computer decades ago
[05:47 pm]
NimoStar -- If its any consolation, the human brain would still mop the floor with this bot if it wasn't limited by the mechanical interface
[05:34 pm]
NimoStar -- Well. The bot didn't come up with any new strategy. It just has superhuman micro. Hard to beat that. I reckon even the simplest dedicated chess engines are unbeatable for humans now.
[02:13 pm]
Oh_Man -- all g
[10:54 am]
NudeRaider -- Oh_Man
Oh_Man shouted: NudeRaider did u watch the entire video? it's not one game. it's currently dominating the ladder at number 1 position. do ur research first!
Oops, caught me there, no I haven't. :( I was imagining how the game went. Sorry for that. Watching it now. brb
[10:52 am]
NudeRaider -- NimoStar
NimoStar shouted: They were not "Unprepared" that was their fifth loss in a row against the bot. The other replays are also available
that doesn't mean he was prepared. When humans come around with new strategies it often takes weeks until the pros figure out how to shut it down. Oh_Man that's certainly a way more convincing argument for micro being "too good to beat".
[09:43 am]
DiearAnother -- wirefram
[08:35 am]
NimoStar -- Well, pros showed that long ago... half of zerg pros just ling muta rush
[08:35 am]
NimoStar -- " its shown is that you can trade 1000's of apm to make up for lack of strategy"
Please log in to shout.


Members Online: DarkenedFantasies, Symmetry