|
Unfortunately given the way the solution is overall designed, that is not possible.
|
|
|
|
|
When I compiled a free-source code for a KLT point implementation (a feature point used widely in Computer vision) using VC with MFC support,
I got a compilation error "error C2632: 'float' followed by 'char' is illegal " for the line:
"float small,"
and error "C2062: type 'char' unexpected" for the line " if (det < small) return (int)(KLT_SMALL_DET);"
Seems the variable name "small" is illegal in VC 2005, I have tried "t_small" instead, then the problem is gone!!
That is really weird!!! Is "small" a reserved keyword in VC2005?.
I have never seen that kind of error message before!.
Following is the source code, the problematic line is in bold font:
static int _solveEquation(
float gxx, float gxy, float gyy,
float ex, float ey,
float small,
float *dx, float *dy)
{ float det = gxx*gyy - gxy*gxy;
if (det < small) return (int)(KLT_SMALL_DET);
*dx = (gyy*ex - gxy*ey)/det;
*dy = (gxx*ey - gxy*ex)/det;
return KLT_TRACKED;
}
|
|
|
|
|
According to this[^] it shouldn't.
Is there any typedef or any other kind of association with that word in the programm? Try to look for "small" in all files in your project. The compiler can complain about that use, but the cause could be in any other place.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
The source code you provided compiles fine on 2010 (provided KLT_SMALL_DET and KLT_TRACKED are defined).
Are you sure there arent't spurious characters in your original source file?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You missed one of the bold-lines, the problem is not with KLT_SMALL_DET, it is with "small" variable name.
And the fact that you can compile that code snippet, is a kind of confirmation about my theory that "small" is maybe being defined in other place.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I missed nothing, of course.
I copied the whole OP function and made it compilable by defining (with dummy values) KLT_SMALL_DET , KLT_TRACKED just to check if small could be the issue: it turned out that was not the case.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I think I have to readapt the "if you drink, don't drive" with "if you drink, don't post in CP", it is my second missunderstanding today
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Nah, I post here only while I'm very well drunk...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Aaah, ok, now I understand
|
|
|
|
|
Cedric Moonen wrote: Aaah, ok, now I understand
Noooooooooooo, you cannot understand: you're just freshly married...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
siyuanfang wrote: I got a compilation error "error C2632: 'float' followed by 'char' is illegal " for the line:
"float small,
If you hover your mouse over the word small it shows #define small char , and Go To Definition takes you to line 153 in RpcNdr.h .
|
|
|
|
|
I've the variable
float hops; causing a similar problem.
Could you please indicate the header file and the line number of the troubling #define ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: float hops;
Sorry, doesn't show up in my compilation unit. If you get the problem why can't you find its definition using the method above? Or are you not using Visual Studio?
[edit]But I suspect 'hops' has something to do with TCP/IP[/edit]
|
|
|
|
|
Richard MacCutchan wrote: Or are you not using Visual Studio?
Yes, I'm using Visual Beck's .
Richard MacCutchan wrote: [edit]But I suspect 'hops' has something to do with TCP/IP[/edit]
Actually I suspect it is related to Lager/Brewing ...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Aaargh! you got me ... 
|
|
|
|
|
I know this may look a little more than a little strange! But for a reason I want to write a whole function in a file at run-time. OK, let's do some clarification:
see you have a function like:
void foo ()
{
your code ...
}
after compilation we have some thing like:
push 210
mov eax, ebx
...
and in binary level:
E8 00 DA 65 00 00 DF
What I need is to write these binary codes in a file.
Note
1- There's no such an instruction like mov eax, eip or pop eip in Intel instruction set. Actually there's no instruction to get or set eip directlt.
Thank you masters!
|
|
|
|
|
Why don't you get the compiler output?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
because I need to write it anywhere I want. I don't want to use the simple copy-paste method.
|
|
|
|
|
The you have to write a compiler...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
As I understand it, you want to include in your executable, a number of Datablocks which you want to use as prototype executable files, to be called by your process. This can be done, and I've done it. If that's what you want, it also requires No ASM Code to implement!
Bram van Kampen
|
|
|
|
|
Hi,
I have a binary image with black background and a white object. I want to implement c++ codes that will detect when there is a hole in the object (black cell in the white object). I want to be able to know precisely the size of the hole and where it is located on the object.
Can someone give me any advice.
Thanks in advance,
Franck
|
|
|
|
|
One possibility could be using GetPixel () .
If you know the coordenates of that white shape, then you can just check in the shape if the pixels contained are white or black and increment a counter to know the area of the target object.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Thanks for the answer,
Unfortunately, I do not know the coordinates of the white shape.
Franck
|
|
|
|
|
Then you are going to use the same to locate it first.
If the white object is with a random shape, and random coordinates I think you are going to check the whole image, and then process it.
You can get an approach of using a 2d array full with 0 (black) and 1 (white) to simbolize the image.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
the main term you'll need to research is "blob detection and analysis".
it's a big and complicated subject, however.
|
|
|
|