|
Hi, i was able to detect finger tips and valleys using cvConvexityDefects() and Convexhull functions...now i want to identify what finger tip is belongs to what finger...for an example i want to detect finger tip of the thumb and do something..Need some tips...Thanks in advance 
|
|
|
|
|
I would venture that you need to identify the entire hand contour and get the individual fingers.
I think you need to find the skeleton – I think is is called erosion.
Take a look at OpenCV for contour function.
Vaclav
|
|
|
|
|
hi,thnx for the rply..i used cvFindCountours() function to get the contours of the hand..i will try the skeleton one as ypu suggested..but i want to know how to use depth value of convexitydefects to identify fingers...Thank you
|
|
|
|
|
hi,thnx for the rply..i used cvFindCountours() function to get the contours of the hand..i will try the skeleton one as you suggested..but i want to know how to use depth value of convexitydefects to identify fingers...Thank you
|
|
|
|
|
These days ,i read the source code of cocos2d-x . When i read the CCApplication class of win32 platform , in the function run of CCApplication ,there is a function :
static void PVRFrameEnableControlWindow(bool bEnable)
{
HKEY hKey = 0;
if(ERROR_SUCCESS != RegCreateKeyExW(HKEY_CURRENT_USER,
L"Software\\Imagination Technologies\\PVRVFRame\\STARTUP\\",
0,
0,
REG_OPTION_NON_VOLATILE,
KEY_ALL_ACCESS,
0,
&hKey,
NULL))
{
return;
}
const WCHAR* wszValue = L"hide_gui";
const WCHAR* wszNewData = (bEnable) ? L"NO" : L"YES";
WCHAR wszOldData[256] = {0};
DWORD dwSize = sizeof(wszOldData);
LSTATUS status = RegQueryValueExW(hKey, wszValue, 0, NULL, (LPBYTE)wszOldData, &dwSize);
if (ERROR_FILE_NOT_FOUND == status || (ERROR_SUCCESS == status && 0 != wcscmp(wszNewData, wszOldData))) {
dwSize = sizeof(WCHAR) * (wcslen(wszNewData) + 1);
RegSetValueEx(hKey, wszValue, 0, REG_SZ, (const BYTE *)wszNewData, dwSize);
}
RegCloseKey(hKey);
}
i do not understand the key value "hide_gui" .What can it do to effect my app ?
I am a new learner in C++ and i am not a english speaker , so if you do not understand my meaning ,i am very sorry for that .
|
|
|
|
|
You need to contact Imagination Technologies about this, it's their software. However, the code above sets its value to "NO" or "YES" , according to whether bEnable is true or not.
Use the best guess
|
|
|
|
|
Dear Friends,
I want to design function using C++. Like this
int GetValue(CString VariName );
I will pass Variable name as a String into function and function should return value of the variable.
struct StudentInfo
{
int rollnum;
int mark1;
int mark2;
} *stud;
int GetVal( _T("Stud->rollnum")); // Now function should return the value of Stud->rollnum
Friends help me...
Thanks and Regards,
S.Shanmuga Raja
|
|
|
|
|
Answer is apart. Why you want to do it Like that?
|
|
|
|
|
C/C++ has no built-in mechanism to do that.
you will have to come up with some kind of data structure which maps a string to a variable. maybe put the variable name in the structure itself, then search your collection of structs to find the one you want. or, create a std::map which uses a string (var name) as the key and a struct as the value. or... there are lots of options - none of them are great.
|
|
|
|
|
If you want to use c++ make a class instead of struct:
class CStudentInfo
{
public:
enum EVal
{
erollnumEVal,
emark1EVal,
emark2EVal
};
int GetValue( EVal eVal )
{
int iRetVal = 0;
switch( eVal )
{
case erollnumEVal:
iRetVal = rollnum;
break;
case emark1EVal:
iRetVal = mark1;
break;
case emark2EVal:
iRetVal = mark2;
break;
default:
ASSERT( FALSE );
break;
}
return iRetVal;
}
private:
int rollnum;
int mark1;
int mark2;
}
But why do you need something like this?
couldn't it be just simple:
class CStudentInfo
{
public:
int Getrollnum()
{
return rollnum;
}
int Getmark1()
{
return mark1;
}
int Getmark2()
{
return mark2;
}
private:
int rollnum;
int mark1;
int mark2;
}
|
|
|
|
|
Use a hash map. The name of the variable in the name of the entry. The value of the variable is the value of the entry.
|
|
|
|
|
Please do not cross-post! It just makes it harder for everyone to gather the sparse information that is already there[^], and makes people waste time repeating the same queastions and suggestions in two different places!
Instead, please answer the questions, especially what you need this for. The answers to these questions are really necessary for us to make a meaningful response that actually helps you with your problem. As long as you're silent about your real intent, we can only guess! And, judging by the little information you gave us, you don't know what you're doing. Much less do we.
Also, please respond to the suggestions already made, whether or not they fulfill your purpose. If you ask a question, you expect a response. Likewise, the people responding expect that you indicate when that wasn't helpful, and why.
P.S.: Just to make a point and explain why I think you do not know what you'r doing or asking:
The name of a variable in a program only really makes sense to the programmer who wrote it. The same object stored under that variable name may be stored under a different name in another part of the program. Likewise, a different part of the program may store a different object under the same name.
As a result, the user of the program can never tell with certainty what the name of a specific object in the source code of the program at any given time is. the only way to tell this, is if you are looking at the source code that is currently executed, i. e. if you are debugging the code. Is that your purpose? If so, the task you're on is likely a whole lot more complex than you can imagine. If not, you're probably asking the wrong question, and you need something different than what you're asking for.
|
|
|
|
|
I have an MDI application ... somewhere, I had open an CDialog derived dialog, where I have only two buttons ... but in this dialog I can not catch any OnKeyDown event ... why ?
I had tried in follow way:
void CMyDialog::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
MessageBox("A");
CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
}
void CMyDialog::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
MessageBox("B");
CDialog::OnChar(nChar, nRepCnt, nFlags);
}
on any key pressed, I see no MessageBox ... why ?
I even had overridden ON_WM_GETDLGCODE:
UINT CMyDialog::OnGetDlgCode()
{
return DLGC_WANTALLKEYS;
}
nothing worked ... what should I do to know when the user press a key, when CMyDialog has the focus ?
Thank you.
modified 30-Apr-13 5:59am.
|
|
|
|
|
|
Great, now does function ! Thanks !
|
|
|
|
|
Hi
I have a child process a win32 program
The parent is a console program
In the child process I would like
To read the console buffer only in certain
Situations
Can I have a ReadFile with the handle
Of the parents stdout and signal
The read from the parent process
By signaling the hEvent of the overlapped
Structure
Thanks
|
|
|
|
|
|
Hi
Thanks but I want the child windows
Program to read the parents (console program)
Stdout
|
|
|
|
|
This is no joke, so please no “update” suggestions, OK.
I have regretfully downloaded both VS 2010 and VS2008 to do some testing with Cmake.
Now my VC 6.0 is building DSW and SLN and some other crap files – but no DSP!
The most visible result is – no more access to “workspace”, my VC IDE is toast!
I am about to delete all the new crap I downloaded and start over.
I recall that when MS came up with VB4 the developers had similar problems working with older VB.
Any other suggestions to fix this? I really need to finish the project in VC 6.0 than MAYBE switch to VS2008, but this is nuts.
Only serious replies will be appreciated, not in the mood.
Cheers Vaclav
|
|
|
|
|
Vaclav_Sal wrote: Now my VC 6.0 is building DSW and SLN and some other crap files – but no DSP! Building DSW and SLN files? Do you mean it is building a (DLL/EXE) project from those files?
Vaclav_Sal wrote: The most visible result is – no more access to “workspace”, my VC IDE is toast! So if you try and open a DSW file from within the IDE, you get this message?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
No, I load workspace using DSP project file.
When I compile it my "workspace" window freezes.
I cannot move aroudn the files , no scroll, and or when I click on any file I get something I assume is pointer failure and the IDE closes. I am not smart enough to troubleshoot the compiler problem like this one.
When I check where the original project DSP file was I got SLN and DSW and some other junk there. When I got rid of the SLN file it partially worked again.
I did get rid of all VS downloads and have no more of this problem. It sure looked like when you are using VS on VC programs and you get the "it was compiled with... do you want to convert to ..." , but it does the conversion half baked and automatically.
I did have some partial 2012 files which never completed the download.
It seem that some of the new stuff will work only in Win7 but it is not advertized as such.
I did not try to run the sln file. It would be interesting what would happen.
Vaclav
|
|
|
|
|
Vaclav_Sal wrote: No, I load workspace using DSP project file. With which version VC or VS2010?
Vaclav_Sal wrote: When I check where the original project DSP file was I got SLN and DSW and some other junk there. So you tried to update the project to a newer version of the IDE; again which one?
Vaclav_Sal wrote: it does the conversion half baked and automatically. That has never happened in my experience. Did you keep backups of your original files?
Vaclav_Sal wrote: I did not try to run the sln file. .SLN files are merely text files containing XML which describes the names and locations of the projects witihn a solution. It is used by Visual Studio to access the project files, and hence the source files and build rules.
Understanding the structiure of Solution and Project files is important when using any version of Visual C++ or Visual Studio. MSDN contains information about them, and Microsoft has a forum dedicated to the subject.
Use the best guess
|
|
|
|
|
Richard,
Fortunately I archive my project after each major task is completed. As far as I know only VS / VC6.0 has DSP project files, but I may be wrong. I guess my the main question remains - why does my VC IDE bombs out when I have ANY VS 20xx installed and I am not using them.
Thanks for all you comments.
Vaclav
|
|
|
|
|
Vaclav_Sal wrote: why does my VC IDE bombs out when I have ANY VS 20xx installed and I am not using them. Sorry, no idea. As I said above, I have done this myself without problems in the past. I can only assume that you tried opening one of the VC6 solutions in a later Visual Studio which converted or somehow corrupted one of the project files.
Use the best guess
|
|
|
|
|
The problem is obviously that you converted the old workspace into a new one (.dsw to .sln). After that you can't use it anymore with VS 6. Your best option is to revert to the files you had before conversion. If you don't have a backup you can either try to open the .dsw file (that contains the old workspace information for VS 6) or you may try to recreate all the projects, add the source files and hope that you get the project settings correctly.
I have installed VS 6 and some newer ones (up to VS 2010) in parallel on my machine. Usually this gives no problem. The key rule is: Always keep the projects separate, never open a project in anover VS version than it is intended for.
|
|
|
|