Click here to Skip to main content
15,881,423 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more: , +
hello together,

can anyone give me hints to (c++/mfc) source to construct an image with a moving webcam.

my father has a debility of sight and I'd like to develop an application for him that "scans" a newsletter column while moving a webcam over it. I already get the image of the webcam (yes, it's not rocket science) and detect a (vertical) move of the image taken (well, also not a big job).

Now I'm searching for algorithms to glue the images (correctly aligned) together for viewing them later as a combined bitmap larger in height than the image scan window to make it scrollable by the user.

the bitmap should be correctly vertically aligned. I tried to get every row/pixel line and compare it to the previous ones but I'm not satisfied with the results.

any clever hints?

greetings from germany
Posted
Comments
Sergey Alexandrovich Kryukov 12-Jun-13 17:23pm    
Great project and purpose! My 5 for asking about this matter.

I tried to answer, but my experience in this particular problem of image recognition is somewhat limited. I more used available software, but did not personally use the particular method I'm writing about. There is a big literature on this topic, as well as open-source software. I saw a lot of it. I suggested one library which I think is the closest for your needs, but there is a lot more.

Wish you the best of luck,
—SA
R.Lohmueller 12-Jun-13 17:47pm    
Hey Sergey,
thanks for your prompt response. I ensure I have no commercial interests and why I'm asking here is because I am very upset about solutions that are sold to old people (like "electronic glasses" with a 3,7" display for about 2000+ $). Thanks for your hints! I'll have a look at your links. Well, I'm not a computer graphics specialist - I'm simply a database programmer (and application designer) with MFC knowledge and if I have success, I'll publish it. (If anyone has further hints or even examples, you're welcome).
r.lohmueller
Sergey Alexandrovich Kryukov 12-Jun-13 23:09pm    
First of all, pay attention: you did not reply to my comment or solution, you replied to your own post, that's why I did not receive notification. You should understand that you only effectively communicate to members if you reply to their posts, directly or not, otherwise people are not notified. I paid attention for your post just because I wanted to check up what's going on with your interesting and important work.

I happened to read about the vision aids you mentioned, did not know much about their fallacies. That makes your work even more important. It really looks realistic. About "specialist" — you would be surprised to know how many "non-professionals" achieved prominent results in programming (but fundamental education usually played important role, self-education or not), and how many "trained" programming "professionals" are hopelessly incompetent.

So, you probably just get well into it and take is seriously. It would probably the best to move from some simplest prototypes, making some additional plans after each, making sure you have something running and testable on each stage. Try to move into it first starting in the direction I suggested, and, when you face some problems or have concerns, ask more questions. I will try to help as much as I can, but you should understand that we don't really have resources to do real work; I personally probably already spend more time on this site than I should allow myself.

Why this way? Not just because I know it better. I actually know about a number of major big libraries and use the one for .NET myself (AForge.NET). Stitching is actually more developed in some photo panorama projects, but trust me, there are quite messy, too hard to understand, besides, your problem is cleaner then that, so you would waste too much time on it. Also, try to abstract and isolate your work from your MFC as much as possible. Not only you have to isolate any UI, but also, MFC is nearly obsolete and not effective for development, so better involve it to some minimum. You should better concentrate on mathematical part and image processing itself, as this part is the most critical. It's fine if you spend most of the time in console-only test application before you even get to UI. It would be frustrating to polish some UI and have some failures with image processing. Image processing without UI still makes some sense, but not UI without image processing.

How are you going to use it, ultimately? Probably you will have to buy a pretty big monitor, to compensate vision limitation. I actually really like your general idea and believe it really can be a great help to people, , extend their activity, much better than the available tools you criticized.

Now, will you accept my answer formally (green button)? It won't mean closing the issue. Other members will be able to add some advice anyway.

Cheers,
—SA

1 solution

This is quite a complex problem, but I think you can solve it if you study the subject properly and put some decent effort. I hope you goals really worth the effort, and, additionally, you could potentially help many other people. So, thank you very much for your interest in this work and your dedication which you will certainly need.

The problem is quite solvable, because there is much more complex problem: creation of panoramic images out of a set of separate images, not using information on exact camera positions/angles. People found quite nice solution to this complex problem. Your problem can be considerably simpler, because you can consider images "flat" and probably base your techniques on the non-distorted (or distorted just a bit) images. You need to find correlations between neighboring images using their common features.

Let's start with something, which will be much closer to the rocket surgery. From what I know so far, such problems are solved using RANSAC algorithms. Please see:
http://en.wikipedia.org/wiki/RANSAC[^].

With C++, you can take a benefit of using the Open Source Computer Vision Library, Open CV:
http://en.wikipedia.org/wiki/Open_CV[^],
http://opencv.org/[^].

This is the relevant code sample I was able to find so far: http://docs.opencv.org/doc/tutorials/features2d/feature_homography/feature_homography.html[^].

Starting from this page, locate related library classes in Open CV documentation and learn using then. It will give you recognition of the matching features of different images. From this information, you should be able to derive relative orientation and shift between different images and ultimately stitch them together.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900