webcam instead of laser sensor

(i'm sorry for my bad english...)

hi, I'm wondering to myself if i can connect a webcam to arduino using it like a laser sensor. I have to check if a small ball cross an immaginary line. so i can use a laser sensor but i should buy it because i don't have one. my question is: can I capture pictures with webcam and pass it to arduino? i have to control the pixels one at the time with a FOR loop or exist some libreries to compare pictures?

How big are the pictures and where are you going to store them during the comparison process? And then how long will the whole process take?

It's not impossible but is the sort of thing you would attempt as an exercise. The Arduino is a microcontroller, not microprocessor. Image manipulation is not it's forté!

Stick with the laser, much, much simpler!