|
Eddy,
1) My program is a console app.
2) It is totally MASM (except API calls for I/O).
3) It honors the Intel ABI, but in addition it saves and restores all registers around calls and saves flags around all API calls.
4) It uses mainly register calling sequences, not calling arguments (I think that is correct - from my ancient Fortran AutoCoder, "Parameters" are what you expect, "Argument" are what you get).
5) It returns no values, only zero or non-zero flags - any returned values are saved in fixed locations.
6) It uses no call stack frame - ebp is used as a general purpose register.
7) It has tons of commentary to explain What I did so I can pick up the program 20 years from now and understand Why I did what I did.
8) It uses many levels of conditional assembly to do validations and/or timing displays, not checking option flags and branching around unused code - the unused code is not even assembled.
9) There are conditional code segments in the RedBlackTree implementation to validate correctness and to display the tree structure (a short 31 element tree build).
10) The conditional code snipits save and restore any used registers to prevent any side effects.
11) It does not use anonymous symbols, instead, it uses lots of meaningful long labels everywhere, including places where a label is not needed but separates code groups.
12) Need I say more.
Nobody will like it here.
Dave.
|
|
|
|
|
The graph must be sparsed.
|
|
|
|
|
A sparse graph is useful for representing a matrix when you know most of the elements are going to be zero. It only represents the non-zero elements and their positions, which saves a lot of memory. Processing is faster too.
|
|
|
|
|
Using a sparse vs. dense representation is a decision driven mostly by the requirements of your algorithms and your memory constraints. Certain graphs lend themselves better to sparse representations, because they are sparse in nature. For example, the density of a graph of street segments, where intersections represent vertexes, and street segments between them represent edges, is very close to zero even for a city of a modest size.
The only time I needed a sparse graph representation in production was when I modeled a sparse multilevel whole-part relationship that contained a significant number of individual parts, and a relatively small number of groups.
|
|
|
|
|
Hi Everyone,
I am building a robotic turret with an airsoft gun monted on a set of tank tracks, i have found some code for tracking movement on a video feed from a static camera, the problem is everytime the turret moves to aquire the target the camera moves with the gun screwing up the tracking, what i am looking for is some kind of algorithm that allows for the video feed to track and center the target while sending the commands to the turret to pan and tilt (aiming), the camera is mounted on the barrel for aiming and the gun is mounted on a 2 axis servo system, i dont know what i would call an algorithm like this to look for one.
Any help would be greatly appricated.
Thanks
Andrew
|
|
|
|
|
So you want our help writing an application to shoot people? You're sick.
|
|
|
|
|
I would say sick if I was going to strap an ACTUAL gun to the rig, airsoft is a game.
|
|
|
|
|
Calculate the centroid of the target outline relative to the center of the screen, then command the aiming system to move in the directions required to center that point. Remember that the airsoft pellets are ballistic, and will drop with distance; once you have the azimuth on target, you'll need to move the barrel upward to overcome that. This will have the effect of causing your image centroid to appear below the center of the display, if the camera is mounted above the barrel, and above the center if mounted below. If you have room for a laser rangefinder on that rig, use it to paint the target and provide ranging information to adjust for gravitational error. Tack on an anemometer if there's room, too, so you can estimate windage corrections.
If you want it to be truly useful, make that video camera an infrared type so you can hunt cats at night.
Will Rogers never met me.
|
|
|
|
|
the issue is I am able to locate the target as it moves (detection), it draws a square around the target, but as soon as the pan and tilt operations happen to move the target center the camera moves and picks up movement accross the whole screen which makes the entire video feed the target (square changes to the whole screen) this is what i am trying to fix now.... as for range finding i was thinking of using a stereo camera rig and calculating distance to target from the angle offset in each feed relative to the space between the two cameras, first prize for now would be to sort the motion tracking and target aquisition system. but i will look into laser range finding.
I didnt think of using a anemometer for windage this would be great as this will be used for outdoor combat. it going to be about the size of a lawn mower when it finished. as for Hunting Cats i happen to have two and dont think they would enjoy being shot at, this will however be used at airsoft games.
|
|
|
|
|
Other people's jobs are much more interesting than mine.......
|
|
|
|
|
i wish this was my nine to five, its actually a side home project, in my normal life i build ERP business software for a logistics company.... dead boring...
|
|
|
|
|
|
I have worked on several tracking algorithm. In many algorithm we need to give the boundary of the object to track. So if its not possible in your case, first you need to do some motion segmentation, then you need to track.
Tracking is definitely complicated, so if you have time i would suggest you to look into active contours and SIFT feature tracking , otherwise try to implement mean shift algorithm, the problem with mean shift is it is not scale invariant. You also need to predict the camera object movement ( using kallman filter )
Hopes this will give you a very high level introduction.
If u can Dream... U can do it
|
|
|
|
|
Thanks JK, the Kallman Filter approach seems to be the best option, you have definatly given me some good direction, thanks again.
|
|
|
|
|
Tell me If you got it working.am just curious.
If u can Dream... U can do it
|
|
|
|
|
|
You saw what happened yesterday when you didn't follow the guidelines. Why do you think it will be any different today?
Albert Einstein once said "The definition of insanity is doing the same thing over and over again and expecting different results". refer here
Software rusts. Simon Stephenson, ca 1994.
|
|
|
|
|
forum, u identify the installshield application send me the name i don't know?
|
|
|
|
|
Wow, you really are stupid. I just saw the email from you saying sorry for multiple posts and now you immediately post your question for a seventh time. That should guarantee that nobody will respond to you.
I must get a clever new signature for 2011.
|
|
|
|
|
You should post your question at the InstallShield forums[^] in the forum specific to the product/version you are using.
Jack of all trades ~ Master of none.
|
|
|
|
|
I agree!
"Program testing can be used to show the presence of bugs, but never to show their absence."
<< please vote!! >>
|
|
|
|
|
SOLVED
For anyone interested here is the solution to my problem:
public IEnumerable<Tile> PathFind(Tile startNode, Tile endNode)
{
List<Tile> openNodes = new List<Tile>() { startNode };
List<Tile> closedNodes = new List<Tile>();
Tile lowestFScore = null;
while (openNodes.Count > 0 && lowestFScore != endNode)
{
lowestFScore = GetLowestScoringTile(openNodes, endNode);
openNodes.Remove(lowestFScore);
if (lowestFScore == null)
return null;
SwitchFromOpenToClosedList(lowestFScore, openNodes, closedNodes);
IEnumerable<Tile> neighbouringTile = GetNeighbouringTiles(lowestFScore);
foreach (Tile n in neighbouringTile)
{
if (IgnoreTile(n))
{
SwitchFromOpenToClosedList(n, openNodes, closedNodes);
continue;
}
if (closedNodes.Contains(n)) continue;
if (!openNodes.Contains(n))
{
openNodes.Add(n);
n.Parent = lowestFScore;
}
}
}
return RenderToGrid(endNode);
}
I have done my research and attempted several times to create my version of the infamous A* path-finding algorithm.
The algorithm I have made does seem to work though!...(unsurprisingly)
If anyone can help me it would be great, I am sure it is just a logic problem in the main part of the method:
public void PathFind(Tile startNode, Tile endNode)
{
List<Tile> openNodes = new List<Tile>() { startNode };
List<Tile> closedNodes = new List<Tile>();
Tile currentNode = startNode;
while (true)
{
foreach (Tile n in GetNeighbouringTiles(currentNode))
{
if (closedNodes.Contains(n)) continue;
if (IgnoreTile(n))
{
if (!closedNodes.Contains(n))
{
closedNodes.Add(n);
continue;
}
}
n.Parent = currentNode;
if (!openNodes.Contains(n))
openNodes.Add(n);
}
if (openNodes.Contains(currentNode))
openNodes.Remove(currentNode);
Tile lowestScoring = GetLowestScoringTile(openNodes, endNode);
if (lowestScoring == null) lowestScoring = currentNode;
if (openNodes.Contains(lowestScoring))
{
openNodes.Remove(lowestScoring);
}
foreach (Tile n in GetNeighbouringTiles(lowestScoring))
{
if (closedNodes.Contains(n)) continue;
if (IgnoreTile(n))
{
if (!closedNodes.Contains(n))
{
closedNodes.Add(n);
continue;
}
}
n.Parent = lowestScoring;
if (!openNodes.Contains(n))
openNodes.Add(n);
else
{
if (Tile.GetCost(lowestScoring, endNode) > Tile.GetCost(n, endNode))
{
n.Parent = lowestScoring;
lowestScoring = n;
}
}
}
currentNode = lowestScoring;
if (openNodes.Count == 0 || currentNode == endNode)
return;
}
}
I am expecting the method to return when there are no more nodes remaining (which tells me that there is no way of getting from a to b), or the current node is the end node (which should mean that I can just re-curse through each "Parent" attribute of the endNode to cycle through the path.
Edit1: I noticed that the first " n.Parent = currentNode;" is never reached!
Edit2: The "GetNeighbouringTiles" method was incorrect, it didn't search for moving down... The pathfinding method hits an infinite loop now...
It only ever does the former result
modified on Tuesday, January 4, 2011 1:40 PM
|
|
|
|
|
|
Thank Espen,
I was trying to do it based on the concept, I didn't want to use other code and instead build from the concept
|
|
|
|
|