Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am a Computer Science undergrad from India and an amateur programmer with knowledge of Java, and some Python as well. I have also dabbled a bit into functional programming.

For my final year project, I have chosen to build a cursor control system using face and eyeball tracking, wherein the cursor movement on the monitor will be controlled by face feature tracking(to be done using a webcam). The basic aim of the system is to simplify HCI (Human Computer Interaction) for individuals. Considering the various products in market, I am planning to eliminate most of the inconsistencies other products have.

I was told by my project guide that it'd be best to go for Java as an implementation language, while C could be used for interfacing.

A senior friend suggested that I should instead go for C# .NET as it would eliminate the C-interfacing trouble.

I am very much confused. Please advise me on what language and approach I should go for, considering the factors such as our experience (it's a team of four, all amateur programmers), the learning curve involved, the time available (we have roughly two months in hand to complete this project).

share|improve this question

closed as off-topic by gnat, Bart van Ingen Schenau, MichaelT, Michael Kohne, GlenH7 Dec 31 '13 at 12:38

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about what language, technology, or project one should take up next are off topic on Programmers, as they can only attract subjective opinions for answers. There are too many individual factors behind the question to create answers that will have lasting value. You may be able to get help in The Whiteboard, our chat room." – Bart van Ingen Schenau, MichaelT, Michael Kohne, GlenH7
If this question can be reworded to fit the rules in the help center, please edit the question.

add comment

5 Answers

Two months is an insanely short timescale for such an ambitious project. Remember that image recognition is pretty damn hard, and the fact that webcams deliver relatively poor image quality doesn't make it any easier.

Given the timescale, I recommend you do everything you can to save time (in a sensible way):

  • Find libraries for everything non-specific. You don't want to code webcam image capturing yourself, you don't want to dig into low-level code to inject mouse movement events, and you certainly don't want to deal with pixel formats and image data management yourself. There are libraries for each of these; find them, and use them.
  • Two months is way too short to accommodate learning a new programming language on top of finishing the project. Use a language in which you are all proficient.
  • Forget cross-platform things, forget shiny GUIs, as you don't have time for these right now. Focus on the core mechanism - face recognition. Get the core functionality right, that is, a really simply UI (a blank window with one button maybe, or just a command-line program), save the UI for later.

That said...

...C# would be a good candidate because it can easily integrate with C libraries (and C is still your best bet for the support libraries), and because whipping up a "works for now" GUI is a matter of minutes with Visual Studio; but if you have no prior experience with it, you won't make it in two months - P/Invoke (the technology you use to call C library functions) is excellent, but it takes a while to wrap your head around it; I wouldn't recommend using it without mastering the basics of both C# and C

...Java, as you say, makes it hard to integrate C libraries, but if you're lucky enough to find suitable Java libraries for what you need, I'd consider it the best candidate, considering it is your strongest language

...Python could also work out well; it has a rich set of libraries out-of-the-box, and wrapping C libraries for use in Python is fairly straightforward.

I suggest you split up the work for the first week: assign one or two programmers to each candidate language, and have each one find libraries and write a prototype that does the following:

  • grab image data from the webcam
  • do a rudimentary operation on the image, e.g. find the darkest pixel in the image
  • move the mouse to a specified position on the screen

This should be doable in a week in any of the given languages; evaluate all candidates and go with the one that looks most promising.

From there, you need to fill in the blanks: write a core routine that does the actual image processing and translates image data into mouse movements. Either of these languages should be equally suitable, provided that you have the above framework up and running.

share|improve this answer
Wow... even I was about to ask the very same question for a different project... Thanks a lot for the approach!!! –  yati sagade Sep 11 '11 at 18:28
Just wondering: Why is JNI considered harder than P/Invoke? I remember I used it years ago and it wasn't that hard at all. –  Falcon Sep 11 '11 at 19:03
+1 Great answer. It acknowledges the extreme time constraint you are working with, gives you specific tasks you can use to quickly evaluate your tools (this is critical given your time), and tells you to KISS - Keep It Simple Stupid. If you can pull this off in 2 months you should have a good future in programming. Good luck! –  Peter Rowell Sep 11 '11 at 19:15
@Falcon: In all honesty, I have only used P/Invoke myself, not JNI, but while I often hear P/Invoke mentioned as a viable option, I've only heard / read bad things about JNI so far. Maybe that's because C# is practically tied to the Windows platform, which would remove a bunch of problems Java has to cope with in this context. –  tdammers Sep 11 '11 at 20:09
@tdammers: I reviewed JNI again and realized it is indeed far more cumbersome than P/Invoke. You have to create a C++ Wrapper around your native library before you can even think about integrating it with JNI. –  Falcon Sep 12 '11 at 7:05
add comment

I'd think that you'll probably have libraries for both C# and Java, so I think you can safely ignore the C interfacing part of it. Since you say you already do Java, I'd vote for it. I'm not too familiar with Image recognition in general though. Here're some existing answers in SO -



share|improve this answer
add comment

Having been [exactly] in your shoes just last year, i can say the following things :

1. (2_months == too_less) esp since our (indian) professors suck (except if you are in some IIT or something)

2 Best thing to do now is focus on some very specific part of some very specific API/Platform/functionality and build a project 'around' it.

3. Dont fall for buzzwords; keep the functionality to the minimum and focus on technology (eg nail the API that you are targeting but dont try to build a castle with the API ... its too late for that)

4. Dont matter if you have 2 months or 20 years, you wont complete something you hate. So be wise and pick something up that you really wanna do ! I would really have you focus on this point because you are looking at quite a few all-nighters IMHO.

P.S. #All-Nighters Rock !!!

share|improve this answer
add comment

I did something similar, but we used our Hands (with a Makeshift Glove) to Control the Cursor (you can see it here: http://www.youtube.com/watch?v=Ia3d9Bsos_c&feature=channel_video_title_ It's VERY VERY basic, but honestly getting to know the Library in 2-3 Months proved time consuming.

For reference we used C++ and OpenCV, we got an A on the project...but ya Face tracking is much more difficult....because of the different tones, unless you use Halaa maps (or w/e they are called). Color tracking was the easiest for us to get done in the amount of time we had though.


share|improve this answer
add comment

Just pick the one that you're most comfortable with. C, Java and Python (in that order) are probably going to have the most diverse set of libraries for this sort of thing.

Python might make it a bit slow, but it doesn't really matter. Just keep the code clean.

With a working implementation of this kind of thing, once you get something working out there, it shouldn't be a big problem porting it to any language or operating-system.

The big deal here is the actual math and algorithms, not the language.

Good luck!

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.