|
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
|
|
|
|
|
By golly!
You have done it again!!! I had eralier tried exactly what you say to do, but I hadnt closed the editbox (after I changed the entry so the change didnt take effect) before building the proj again which is why I saw no difference. But this time I edited the resource , saved it, closed the editbox and then built and ran....viola! I appreciate your careful explanation of the various sections. It still likes to tack on a "1" at the end of the title as in : MyProject - CorrectNAme1
--- which is quite acceptable. SO, many many thanks again!
ns
|
|
|
|
|
One more thing since you mentioned it. It may or may not matter much, but I think it looks a little nicer if there is a space between the new document name and the number. This "New Document 1" instead of this "New Document1". If you would like the first effect, just insert a space after the name and MFC will tack on the number after the space which, just according to my preference, looks a bit nicer.
\nNew Document \nnewMFC... PROMPTS "AppName - New Document 1"
instead of
\nNew Document\nnewMFC... PROMPTS "AppName - New Document1"
Just thought you might be interested. Once again, good luck with your project!
ns wrote:
SO, many many thanks again!
Your welcome!
Happy Programming!
WWW::CodeProject::BNEACETP
|
|
|
|
|
Hello all
How do one should go about changing the background color of CDialog and its elements like buttons,group boxes etc. Pls help me with an example.
Many thanks for your help.
Hari.
|
|
|
|
|
hy, try to overwrite OnEraseBkg, and also OnCTLColor
try something like this:
HBRUSH CBaseView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
switch (nCtlColor)
{
case CTLCOLOR_STATIC:
case CTLCOLOR_LISTBOX:
case CTLCOLOR_BTN:
pDC->SetBkColor(GetSysColor(COLOR_BTNFACE));
return (HBRUSH)m_grayBrushPtr->GetSafeHandle();
break;
default:
return CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
break;
}
}
|
|
|
|
|
there is an easy was aswell
take a variable of type CBrush at class level like
CBrush m_Bursh;
initiate it in OnInitDialog like
m_Bursh.CreateSolidBrush(RGB(0,0,0));//OR ANY OTHER COLOR u WANT
override the WM_CTCOLOR message handler
and add this line to its implemention
HBRUSH CBaseView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
return m_Brush;
}
|
|
|
|
|
Hi.
I am trying to use the CImage class from ATL to handle images in my GDI game.
I manage to make it draw the images, or at least some formats. It says in the documentation that the CImage::Draw function is supposed to support both transparency and alpha channel. But I can't seem to make that work.
I was wondering if it's just the format that I save my images in that is wrong? I have tried different PNG formats and GIF, but none work correctly. As far as I understand the documentation I am supposed to be able to create a PNG containing transparent color and alpha channel and the Draw function will take care of the rest when I call it... Is that the case?
Does anyone know what format I have to save my images in to make them work properly? I tried to save the image with transparency and alpha channel as PNG-24 (from Photoshop), but the transparent color is just semi-transparent when I render it in my game. Anyone know what's wrong?
Thanks.
|
|
|
|