|
hy,so you mean i should basically reduce the imagesize of the images i compare? but in the end i must compare pixels etc? i think youre right,
maby even black/white pictures will do the job. what do you mean with
"You could even be really elegant and sample as per a comb filter at the Nyquist frequency!"
?
thanx, greez
|
|
|
|
|
hmm you probably need to standardise the distance so you know that the hand is always i metre away from the camera say.
Then you probably could figure out the "width" and "height" of the view from 1 metre.
and then you can tell that 1 pixel at NxM res' corresponds to a set area.
then it comes down to figuring out when and where the motion started and when and where it finishes.
Sounds like a 3 year computer science project to me
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
3 years,oh my gosh!? i thought i could do this in an afternoon
but im convinced there is an easy approach! and remember, all i want is
relative velocity, not abolute. i just want to know if the hand moves slow or fast. so i was thinking about making every x ms a bitmap, and then compare them. lets say i wear a white t-shirt, and my hand is black. so when
i move the hand up and down i could detect, how many light or dark pixels are in lets say 4 zones of the bitmap. so i could detect the position of the hand, and with that also the velocity. i think i could do this in 2 days, what do you think??
|
|
|
|
|
Comparing two bitmaps (or anything) is simple; just compute a CRC over both and you will know whether anything has changed or not.
However, this is not the solution to your problem. You'd need to detect characteristic patterns (at least in case two subsequent images that are in fact different) in the first, try to locate the similar pattern in the second, measure the distance along X and Y axis, employ a second camera at a slightly different angle so that you can establish the distance along Z, know the time between the two pictures, and you're done.
Oh, you will also have to recognize similar but distinct patterns: the hand might turn a little when being moved, the ball might rotate, the cloud changes shape.
Not sure about the 3 years, but 1+: definitively.
Enjoy!
Bernd
|
|
|
|
|
maby youre right! nevertheless ill try to do it in 3 days
could you maby explain me shortly what means to compute a CRC over both images?
thanx
|
|
|
|
|
Oh - it means to compute a checksum over the images. This will be quicker than pixel-by-pixel comparison. It might even be faster (depending on your CPU power and bitmap size) to compress these images, and then to compute the checksum over the compressed data.
CRC is the name for a family of standard checksum algorithms. Simply adding all bytes will not be good enough, you'd need something that produces a different signature (aka checksum) for different data. A simple addition won't do.
Bernd
|
|
|
|
|
ah, ok, but i think that would be difficult, because every frame you capture
is basically different, even if nothing moves, because of the signal/noise ratio..ok, thanx for your help!
|
|
|
|
|
Andreas,
You might want to read this - technologies like the Lempel Ziv Welch compression algorithm are designed to detect similarieties and reoccurring patterns.
For example, you might have two subsequent shots A and B(bitmaps). You could reduce their complexity by reducing the color resolution to B/W, or 4 grayscales maybe.
Then you could create bitmap C = A + B by simply appending the two, run it through LZW and see where signifficant reoccurring patters are.
Next, you could rotate B by 90 degrees clockwise to B', create C' = A + B', and run this through LZW.
This could give you a start, at least for verical and horicontal movement. Not sure. This is just brainstorming.
Good luck,
Bernd
|
|
|
|
|
You should check out OpenCv, which is an open source image processing library which has a whole branch associated with calculation of optical flow (it also has a built in feature tracker). The sample apps which come with it are helpful, and there is a yahoogroup if you get stuck.
If performance is a big issue, you're probably going to need to use directshow to capture the images from the webcam. Check out the playcap sample in the DirectX SDK.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
ok, thanx for the tip! what do you think about Vision SDK from MS?
i tried several times to run any sample porgram, but i never could compile it, i always had errors!!!!
greets
|
|
|
|
|
If it's the SDK I'm thinking of (and from a very quick look at the Microsoft website, it is) it stinks.
We had heaps of problems with it when we did a little work, and found that OpenCV with pure directshow was a much better solution. Even still it took a long time to get everything up and running properly, and we were learning it from scratch.
If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts you aim;
Yours is the Earth and everything that's in it.
Rudyard Kipling
|
|
|
|
|
Hi,
does anyone know how to access the format intfoamtion of an MS word/Excel session. For the Fonts available and other options.
Any reply appreciated
Stephen
|
|
|
|
|
Any advice about the following would very much appreciated.
Is it possible to create an event that can be waited on in any thread, not just an owning thread or a child thread.
Is this possible ?.
Thanks.
|
|
|
|
|
An unnamed Event can be waited on in any thread that belongs to the process it is created in. If the event is inheritable, it can also be waited on in any thread of a child process.
To wait on an event in any process, use a named event, each Process must call CreateEvent or OpenEvent, however.
Flirt harder, I'm a coder.
mlog || Agile Programming | doxygen
|
|
|
|
|
char somechar = 30;
now in java when i write:
char somecharinJava = 30;
it is not the same, it returns string representation..
how can I produce equivalent of "char somechar = 30; // in c++", in java?
_ra
|
|
|
|
|
char somechar = (char)30;
int someint = (int)somechar; -> return 30
|
|
|
|
|
I'm confused, this code:
char ch = 30;
Behaves in, nearly, the same way in both Java and C++, which is: the value of ch is set to 30.
The only difference is that char in Java is a 16 bit type that holds Unicode values, while char in C++ is an 8 bit type.
Did you perhaps mean this:
<code>Java:</code>
String s = 30;
<code>C++:</code>
string s = 30;
If that is the case, then you can take a look at the standard C++ implementation of a string [^]. This should help you to create a descandant of that type with an overloaded '=' operator that translates 30 to "30".
"After all it's just text at the end of the day. - Colin Davies
"For example, when a VB programmer comes to my house, they may say 'does your pool need cleaning, sir ?' " - Christian Graus
|
|
|
|
|
I'm not sure if this is the correct forum but ...
I'm trying to find out if VC++ supports pipe select operations.
In case my terminology differs from yours, by pipe select operation, I mean: the ability to block-wait for data to arrive on any one of a group of pipes.
Thanks
|
|
|
|
|
No, the pipe in Win32 works differently from Unix, and you cannot use 'select' on it. Instead you would need to use the Win32 version of pipe (created with CreatePipe), and then use the standard WaitForSingleObject/WaitForMultipleObject functions to do the equivalent of a pipe select.
You may also be able to use an external library, such as cygwin, to provide unix-style pipe emulation.
|
|
|
|
|
MFC MDI project:
I didnt name my project with the final name in mind, and now i cant seem to change the title bar of the project. In project settings i was able to give a suitable new name to the exe but the title bar still has the name of the project in it, even though I rebuilt the prj. Please tell me theres some trivial way of changing the name in the title bar....
I looked into the rc file with notepad but dont see anything I can change there, (I dont really know what I'm looking for.) Anyways is is safe to edit the rc file?
Thanks,
ns
I tried SetWindowText in mainfrms OnCreate and also in OnInitialUpdate of the view...didnt work.
Also did cs.lpSzName in PreCreateWindow....thats no good too.
|
|
|
|
|
In the resource view, open the String Table and edit the IDR_MAINFRAME caption to what you want to appear in the titlebar of your project.
You might also want to change the AFX_IDS_APP_TITLE string caption to something different as well since calling AfxMessageBox(...) will display the AFX_IDS_APP_TITLE string caption in its titlebar. That should do it.
Happy Programming!
WWW::CodeProject::BNEACETP
|
|
|
|
|
Wow! Cant wait to try it tomorrow. Thanks so much!!!!
ns
|
|
|
|
|
nss wrote:
Thanks so much!!!!
No problem. Glad to help.
Happy Programming!
WWW::CodeProject::BNEACETP
|
|
|
|
|
Well, that works great, but now, in the title I get:
MyGoodProjectName - OldPrjName1....sort of like thats the name of the document or view or something. I tried changing the IDR_STRAINTYPE string but thats not it apparently. So the old prj name is still sneaking in....
Ideas?
Thanks,
ns
|
|
|
|
|
By looking to IDR_STRAINTYPE, you are on the right track. That is the string that you need to change. I built a quick app named "newMFC" and I have its "TYPE" string resource below:
\nnewMFC\nnewMFC\n123 Files (*.123)\n.123\nnewMFC.Document\nnewMFC.Document
Change the first "line" or section of this string to what you want the document to be called by default. For instance, if I wanted it to show "New Document" I would change the above line to:
\nNew Document\nnewMFC\n123 Files (*.123)\n.123\nnewMFC.Document\nnewMFC.Document
DO NOT remove the new line characters (\n) in the process. That should do it.
For future reference, below is what each section is for, corresponding to the MFC App Wizard:
1) \nnewMFC - Document Type Name
2) \nnewMFC - File new short name
3) \n123 Files (*.123) - The filter name
4) \n.123 - The actual file type filter
5) \nnewMFC.Document - The file type ID
6) \nnewMFC.Document - The File type Long name
I hope that fixes things for you. If I understand your problem right, it should. Good luck with the rest of your project.
Happy Programming!
WWW::CodeProject::BNEACETP
|
|
|
|