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

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

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.

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

that' it...:cool:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.