|
let say, there is a track....my mobile robot need to move along the track...the track is about 3 cm width...the reference for the mobile robot is the center point of the track...how can i get the center point?
im using the edge detection method but still cannot find the center point
|
|
|
|
|
The midpoint between two points (x1,y1) and (x2,y2) could be found something like
(xMid, yMid) = ((x1 + x2) / 2, (y1 + y2) / 2)
I imagine for those two points, you'll need points on your detected lines that are perpendicular to the
robot...or something like that.
You'll need to do a little math
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Assuming the track delimiting lines parallel, at every point (of one of the two lines) you have to find the perpendicular line and choose on it the point that is halfway the two lines of the track.
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
|
|
|
|
|
Have you troubles with
(1) C++ language?
(2) Analytic geometry?
(3) Windows programming?
(4) Bitmaps
(5) All of the above stuff?
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
|
|
|
|
|
Hi,
Do you mean "intersection point of 2 lines"?
If so, find equation of both lines, at the point of intersection both equations are same.
If not, Explain the problem more clear.
Best Regards,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
Very simple!
But you have to explain the scenario clearly...I have done same the thing you have puzzled.
Explain it again!
Thanks a lot
|
|
|
|
|
let say, there is a track....my mobile root need to move along the track...the track is about 3 cm width...the reference for the mobile robot is the center point of the track...how can i get the center point?
|
|
|
|
|
I'm using Visual C++ in VS2008.
It's slow, who knows what it is busy with?
modified on Saturday, March 29, 2008 2:29 AM
|
|
|
|
|
It's speeding up your code-development process.
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
|
|
|
|
|
Probably continuously updating and verifying Intellisense[^]
Best Wishes,
-David Delaune
|
|
|
|
|
time might come for hardware update
|
|
|
|
|
followait wrote: It's slow
Dump it and use Eclipse and stop complaining
led mike
|
|
|
|
|
I'm not complaining.
I'm thinking about the design.
|
|
|
|
|
followait wrote: I'm thinking about the design.
Excellent. You should apply for a position on the VS team. I'm sure they would snap you up!
led mike
|
|
|
|
|
Can Any one explain what is alpha in image processing (particular in DICOM IMAGES)
|
|
|
|
|
|
Did you get a job doing image processing on medical imagery??
|
|
|
|
|
I had two cpp file, there i one common .h included file to both of them. appart from their respective .h files
so I declard a variable in the common .h file, so that I can access it from the both the cpp files..
is there a better OO way
|
|
|
|
|
ptr_Electron wrote: is there a better OO way
yes. use a public static member of a class...
|
|
|
|
|
If you wish to use a global variable the correct way is.
1. Define it in one of your source (*.cpp) files.
2. Declare it as extern in the other source files.
for instance:
file foo1.cpp
int iGlobal;
file foo2.cpp, foo3.cpp, foo4.cpp, ...
(alternatively you may include the following declaration inside a header file, included by all the above sources)
extern int iGlobal;
IMHO global varibles are not evil, anyway you should use it sparingly. OOP offers some techniques to avoid typical global variables issues (like name clashes, arbitray access...).
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
|
|
|
|
|
Thanks for your responce, but it just flashes following...
warning LNK4006: "int ::nFuncEqu" (?nFuncEqu@ @@3HA) already defined in stdafx.obj; second definition ignored
and
error LNK2005: "int ::nFuncEqu" (?nFuncEqu@ @@3HA) already defined in StdAfx.obj
|
|
|
|
|
Could you please post the relevant code (i.e. where variable is referenced, both declarations and definitions)?
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
|
|
|
|
|
mainly used .h file included in most of the files
int nFuncEqu;
using File1 // modiying the value in this file
extern int nFuncEqu;
using File2 // using the value in this file
extern int nFuncEqu;
All the abov things are not with in any class
|
|
|
|
|
[added]
here [^] it is explained very well.
[/added]
ptr_Electron wrote: mainly used .h file included in most of the files
int nFuncEqu;
change to
extern int nFuncEqu;
ptr_Electron wrote: using File1 // modiying the value in this file
extern int nFuncEqu;
change to:
int nFuncEqu; (and you don't need to include the header file there).
ptr_Electron wrote: using File2 // using the value in this file
extern int nFuncEqu;
if you include the header file then remove the declaration. On the other hand, if you don't include the header file, leave the declaration as it stands.
The rule for extern declarations is:
you must declare your variable as int nFuncEqu only inside one source file (i.e. .cpp ) while declaring it extern int nFuncEqu in all other source files. Including the header (containing extern int nFuncEqu ) is simply a shortcut for all those extern declarations.
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
modified on Friday, March 28, 2008 11:13 AM
|
|
|
|
|
I made it as static, it is compiling , i modified the value form one file, and it was not reflecting when I am accessing if from the other file, it was not modified inbetween… it remains zero,
|
|
|
|