0

Hey friends lets checkout a small, simple and cute python program for taking photos with with your webcam without the help of any third party application programs.

import os
   import datetime
   import opencv.adaptors
   from opencv import highgui 
   import Image

   def get_image(camera):
       im = highgui.cvQueryFrame(camera)
        # Add the line below if you need it (Ubuntu 8.04+)
       im = opencv.cvGetMat(im)
      #convert Ipl image to PIL image
   dir(im)
   print "image taken"
       return opencv.adaptors.Ipl2PIL(im) 

   #_______________find usernae___________
   a=os.popen('whoami')
   l=a.read() 
   s=l.split('\n')
   uname=s[0]

   #______________find date n time  _________
   now = datetime.datetime.now()
   now = str(now)
  
   im=None
   camera= highgui.cvCreateCameraCapture(0)
   im = get_image(camera)
   os.chdir('/home/%s/Pictures' %(uname) )
   fname='image_'+now+'.png'
   im.save(fname, "PNG")
   ####  code ends here

for more details check crack bytezz

3
Contributors
3
Replies
7
Views
6 Years
Discussion Span
Last Post by jintujacob
0

Your indention is off, for other things I can not help as you do not explain your problem.

0

Your indention is off, for other things I can not help as you do not explain your problem.

I think it's just a code snippet. Gives me some ideas for retrieving movies from my camcorder though.

0

I think it's just a code snippet. Gives me some ideas for retrieving movies from my camcorder though.

that' it...:cool:

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.