954,496 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

USB webcam support in C(running under LINUX)

Ok, i am just starting out in C. This isn't my first programming language, though(i don't mean to brag, but i am a BASIC master), so i know quite a bit about computer architecture, and all that good stuff.

The project i am designing is a robot with stereo vision. I chose to learn C because, well, after looking at some of the code, i fell in love, and i chose Linux as my OS because of it's power.

I need to figure of how to get pictures from the two cams on my USB ports. I was told on another forum that there were libraries for USB Webcams, but i cant find any. Does anyone know where there is some? If so, please point me in that direction.

Sure, there is NOT A CHANCE that i will really understand the code, but it will get me started.:lol:


THANKS!!!

-Dusty

Marks256
Junior Poster
117 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

You mean something like this?
http://www.neurotechnologija.com/vl_sdk.html

Sorry, I don't know of any free ones.

John A
Vampirical Lurker
Team Colleague
7,630 posts since Apr 2006
Reputation Points: 2,240
Solved Threads: 339
 

Your link didn't work :( Oh well. An SDK would be nice... How much did it cost? Anybody else(free would be awesome, but i am not too pickey as of right now)... :p

Marks256
Junior Poster
117 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

http://clusty.com/search?query=linux+webcam+howto
Use the "howto" keyword when searching for a lot of Linux information.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

All of the links that i came up with showed how to gain webcam support in linux, not how to program it. Thanks for the contribution, though.

Marks256
Junior Poster
117 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

Hmpf, obviously not reading enough.

1st link.
"4. Framegrabbing Applications"
Follow some more links, download some source code, visit their homepages and start reading.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

I am not really sure what is that i am looking for, so i am not sure what i will find. Thank you for pointing that out, but i am still learning, so ease off.

Marks256
Junior Poster
117 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

I think OpenCV is what your looking for, it's free, windows/linux and has a imagerecognition.

Nick Evan
Not a Llama
Moderator
10,112 posts since Oct 2006
Reputation Points: 4,142
Solved Threads: 403
 

Thank you. I am going to try to download it now. Once my cameras come(ebay), i will start playing around with it.

Marks256
Junior Poster
117 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

I am trying to do the same thing and it is difficult. the following may help.

1) I sugest you stay away from windows and use command line only.

2) Be aware that C is ment for all computers. Thus if you wnat to do somthing limitted to your machiene, like light up one pixel ( or display a whole screen) you will need a library to do that I suggest svaglib.

3) I am waiting on a book on webcams. It is from Intel & called
- USB Design by Example: A Practical Guide to Building I/O Devices
(2nd Edition... What you have picked is not a beginner project good luck

arydberg
Newbie Poster
2 posts since Dec 2006
Reputation Points: 10
Solved Threads: 0
 

Umm, do you happen to have dyslexia? Lol, just kidding.


1. All ready said i was going to use Linux(Debian)
2. I know that.
3. I know that it is not a beginners project. It was either program the whole thing in QBasic(which would be impossible), or learn C(which i know is possible).

Marks256
Junior Poster
117 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

I think you will wind up in assembly language but that is only my opinion.

Good luck.

arydberg
Newbie Poster
2 posts since Dec 2006
Reputation Points: 10
Solved Threads: 0
 

Eww. Assembly sounds like bad news... Oh well, i am learning assembly at the moment also, so it might not be too big of a deal...

Marks256
Junior Poster
117 posts since Jun 2006
Reputation Points: 10
Solved Threads: 0
 

> I think you will wind up in assembly language but that is only my opinion.
I've seen nothing here to suggest why that would be.

The only part which involves the hardware (and thus any possible reason you could have for using asm) is grabbing the frames in the first place.
If the cameras are common enough, then there's likely to be a Linux driver out there already to drive it.

The rest of the problem ( machine vision ) is just some really serious algorithmic work.

Salem
Posting Sage
Team Colleague
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You