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. Most probably the Ubuntu like linux distributions comes without a pre-installed application for imaging with webcam. I suggest this small piece of code because most of the linux distributions includes python as pre-installed.
I have simplified the code to the extend that any newbie to python can understand it. Also you should install the following python library for this program to work.
You can install this library using synaptic package manager or apt. The package name is 'python-opencv'
from opencv import highgui
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
print "image taken"
#______________find date n time _________
now = datetime.datetime.now()
now = str(now)
im = get_image(camera)
os.chdir('/home/%s/Pictures' %(uname) )
#### code ends here
You can run this program using the terminal as follows
The images will be automatically stored inside the Pictures folder inside the home directory.