 |
|
 |
Description is ok, but the code is very poorly written.
|
|
|
|
 |
|
 |
i wasn't sure how well this would work but i tried it out and it's just darn neat. But it's now many years since this was posted and newer versions of Microsoft C++ won't compile this for all sorts of reasons. Here's what i remember changing to get it to work
Numerous errors due to pow. All arguments must be typecast to floating point It's used to do calculate the distance between the current and last point (using the Pythagorean theorem). Pow was being a pain so in the end, i wrote my own distance function:
double Board::getStraightLineDistance(POINT start, POINT end)
{
long changeInX = start.x - end.x;
long changeInY = start.y - end.y;
double distance = sqrt((double)(changeInX*changeInX) + (double)(changeInY*changeInY));
return distance;
}
Call it (in TransformPath) like:
d = getStraightLineDistance(*p, *i);
Note that i renamed a lot of the variables, so technically my code says distance=, not d=.
sqrt also complains for the same reason as pow. You have to explicitly convert all the parameters to a floating point number. Here's an example:
m_cosines[n] = float(pt2.y / sqrt((double)(pt2.x * pt2.x) + (double)(pt2.y * pt2.y)));
m_sinuses[n] = (float)sqrt(1. - (double)(m_cosines[n] * m_cosines[n]));
Not sure how this ever compiled:
static vector_to_path(RECT& rc, vector_real_t& vec, path_t& path);
It has no return type. Even though it doesn't return anything, C++ (although not C) requires a return type. So i changed it to this:
static void vector_to_path(RECT& rc, vector_real_t& vec, path_t& path);
i think every change i made was in Board with a single exception. SelectionSliderCtrl's definition is wrong. The first template parameter (type) needs to be written in it's own template fashion. Here's the right way to write it:
template <typename T>
class SelectionSliderCtrlT :
public CWindowImpl<SelectionSliderCtrlT<T>, T>
i think that's everything it took to get this to compile under VS2005. i don't think 2008 requires any additional changes but i haven't tested it yet
-baylor
|
|
|
|
 |
|
 |
congratulation (или поздравлаю и жилаю вам успихи все все..)
really very good working and i like it.
i have a tablet (genuis g-pen 340 3X4) connected to my computer through usb interface.
i like to make a progarm for recognition pen movement in the tablet (i think it like your program).
but i dont know how to start writting this program. how can i read these data through usb.
can you help me with your advice and some steps to go in ride. how can i made use of your program(mouse gestures recognition)
thank you
|
|
|
|
 |
|
 |
Now I am doing an exercise about image processing .If you have ,please sent me to email :umyotabachina@gmai.com
thankS
tuan anh
|
|
|
|
 |
|
 |
How guys!
I am very impressed about the accuracy of this application! Congratulations. I would like to use it (or better - use a small subset of it) for the recognition of a couple of mouse gestures in a console opengl application. how should I integrate this project in my application and pass to it a set of points from my gui frontend? (I have especcialy a problem that your project is a MFC application and I havent done much with it, so I dont know how to port it to a console one)
I will be very very greatful if u give me a hint
Nina
|
|
|
|
 |
|
 |
Is someone can help me to find an algorithm to calculate the best circle by given set of points {Xi,Yi};)
|
|
|
|
 |
|
 |
I need the algorithm for this neural network.
I dont really catch up with it. but I really need it for my paper work. I got problem in pattern-recognition. please help...
|
|
|
|
 |
|
 |
Great program!
I am trying to extend it so that it contiously monitors mouse movements, ie you don't have to click to tell it you're about to start a gesture, instead it would continously monitor the mouse and if it ever performs a full circle (for example), it will pick it up.
Any one have any ideas how to go about this?
Cheers
Adam
|
|
|
|
 |
|
 |
In board.cpp
...
bool Board::TransfromPath()
{
typedef path_t::iterator iterator;
m_path2.assign(m_path.begin(), m_path.end());
if ( 2 > m_path.size())
{
m_path2.clear();
m_mode = recognizing_mode;
return false;
}
else if (NUMBER_OF_ANCHOR_POINTS > m_path.size())
{
// todo : stretch path or warning message;
// m_path.clear();
//AJT interpolate to make the appropriate number of points;
std::vector tempVector;
for (std::list::iterator it = m_path.begin(); it != m_path.end(); it++)
{
tempVector.push_back(*it);
}
m_path2.clear();
long oldPointCount = m_path.size();
for (unsigned int iNewPoint = 0; iNewPoint < NUMBER_OF_ANCHOR_POINTS; iNewPoint++)
{
float newIndex = (float)(oldPointCount-1) * (float)iNewPoint/(float) (NUMBER_OF_ANCHOR_POINTS-1);
int iPoint1 = (int)floor(newIndex);
int iPoint2 = iPoint1 + 1;
float diff = (float)iPoint2 - newIndex;
float newX = 0.0f;
float newY = 0.0f;
newX = diff * tempVector[iPoint1].x;
newY = diff * tempVector[iPoint1].y;
if (!IS_CLOSE(diff,1.0f,0.01))
{
newX += ( 1.0f - diff) * tempVector[iPoint2].x;
newY += ( 1.0f - diff) * tempVector[iPoint2].y;
}
POINT newPt;
newPt.x = (long)newX;
newPt.y = (long)newY;
m_path2.push_back(newPt);
}
//m_path2.push_back(tempVector[oldPointCount-1])
}
else if (NUMBER_OF_ANCHOR_POINTS < m_path.size())
{
...
|
|
|
|
 |
|
 |
What compiler are you using that lets you use std::vector like this? Doesn't compile on VC 6, .NET 2005, or .NET 2008 for me...
I'd love to get this working, because as-is the swift right-to-left movements I'm used to with Opera are not getting accepted.
Regards ~ jp
|
|
|
|
 |
|
 |
Hi,
I'm having some trouble compiling this with Visual Studio .NET. I get the following errors:
Board.cpp(603): error C2589: '(' : illegal token on right side of '::'
Board.cpp(603): error C2059: syntax error : '::'
The line containing the problem is:
m_max_error = std::_MAX(m_max_error, current_error);
If anyone has any suggestions for compiling this, please let me know. I've searched and haven't found much information.
Thanks,
Jordan
|
|
|
|
 |
|
 |
Well I guess std::_MAX is not defined in vc7. There should be a max function somewhere in vc7 or define it yourself...
template <class T>
T max(T a, T b)
{
return a > b ? a : b ;
}
John
|
|
|
|
 |
|
 |
Thanks for the help. Apparently it's just "max" now.
Jordan
|
|
|
|
 |
|
 |
I looked into the vc6 code. _MAX is a define that makes use of a inline template version of max similar to the one I posted above...
John
|
|
|
|
 |
|
 |
Hi there.
I am impressed with gestures and neural networks.
But i had no idea how to use it!
This was what i did:
1) Neural Net -> Train... (I had no idea what is it training)
2) I can see a red graph dropping fast!
3) Then, when it is done, should i choose Neural Net -> Test or Neural Net -> Recognize?
4) I assume you can test your gestures in Test! But when i test it, nothing special about it?
5) I can see the points running on the application... not sure what is the purpose for?
6) Comes back to Recognize, i drag some gestures with the right hand mouse, hmm.. nothing special happening!
Argh, friendly speaking, it is kind of confusing using your apps. Maybe you can give me some further guidelines on how your app works?
Is neural networks that necessary for mouse gestures? Is it because you allowed the end user to create their own gestures?
Any help?
Thanks.
Regards,
Chua Wen Ching :p
|
|
|
|
 |
|
 |
Hi Chua Wen Ching,
I'm not Konstantin Boukreev, but i can help you.
I am interested in the implementation of neuronal network. Befor i see this code i think in objects (like node and layer). But i was very surprised that hi used one simple vector to store the weights. After long code reading i can say very good, but difficult to understand for users which don't know how NN works.
For your problem:
1. Train is necessary!
- instead to use the train dialog, you can simple load the file 'gesture.weights'. ready to recognize!
2. If you use the test dialog without modification the programm will test all patterns.
- This process takes many time but you can cancel it by pressing ESC!
- if you check the box you can select the pattern for testing!
3. If the programme process the test you can't recognize!
4. That's all. Have fun.
PS: Is my english good?
|
|
|
|
 |
|
 |
Hi,
First of all I liked your project. Very good job. And thanks for a source code and explanation.
Now, I need help in image recognition. I have to write a program that recieves a shape/pattern/image of a control of some dialog box for example and recognizes it. I now that this is connected to Neural Network and Pattern Recognition. If you have some links or books or some idea about it please write me.
Thank you,
Alex
|
|
|
|
 |
|
 |
Hello Friend's
I am working on speech recognition and i am very new in this field, If anyone who working on this type of project can help me. i am facing a problem that which neural network algo i an going to use for recognition. If anybody have some code or links please send me.
Mahesh Bhargava
mb_bhargava@yahoo.com
|
|
|
|
 |
|
 |
Hi,
First of all I liked your project. Very good job, and thanks for a source code and explanation.
Now, I need help in image recognition. I have to write a program that recives a pattern/shape/image of a control of a Windows dialog box for example and would recognize it. I know that this is connected to Neural Network and Pattern Recognition. If you have some links or books or some idea about this please write me.
Thank you,
Alex
|
|
|
|
 |
|
 |
the classes are constructed weirdly.
|
|
|
|
 |
|
 |
what can I use it to ? it does not make sens for me
|
|
|
|
 |
|
 |
This is great! very cool.
|
|
|
|
 |
|
 |
To make your recognition direction of stroke independent you may consider small preprocessing before generating your input layer data...
I mean => simply normalize your signal.
To do that I would recommend scaling (if necessary???) input points and then rotating them into some normal position.
The simpliest would be very simple calculation of Axes of Inertia => then rotating all set of points to move that axes horisontally => point rearanging, so array will start with lowest X...
Will work => it did work 7 years ago when I was involved with Target recognition using backpropagation NN...
You are great, Kostia => again Molodec...
|
|
|
|
 |
|
 |
Hello Igor, Thanks for you suggestions.
I already thought about it too but I put off implementation because of some complexity.
I agree it will improve the usability of this code.
Thanks again
|
|
|
|
 |
|
 |
I am interested in the neural network code ,but can you provide some instruction for your code?
|
|
|
|
 |