Someone Teach Me How To Do Density Checks?
I want to learn the technique and use it so I can distinguish between ore in rocks vs ore on ground.
<3 Thank Youuuu!
Someone Teach Me How To Do Density Checks?
I want to learn the technique and use it so I can distinguish between ore in rocks vs ore on ground.
<3 Thank Youuuu!
gettpabounds(tpa);
length(tpa) / (x2-x1)*(y2-y1)
How about that?
I made a new script, check it out!.
Yeah, zeph used it in the old autocolor:
SCAR Code:TB := GetTPABounds(CPts);
Count := Length(CPts);
try
ColourDensity := Length(CPts) / ((TB.x2 - TB.x1) * (TB.y2 - TB.y1) * 1.0);
except end;
if (Count > 350) and (ColourDensity > 0.08) then
Break;
Markus is right! As always![]()
How would I know what to make the x1 x2 y2 y1.
How would I find density of a rock, and then ore?
Thanks.
1.SCAR Code:FindColors(TPA, rockcolor, ...);
ATPA := SplitTPA(TPA, 5);
For I := 0 To High(ATPA) Do
Begin
TB := GetTPABounds(ATPA[I]);
Density := (Length(ATPA[I]) / ((TB.x2 - TB.x1) * (TB.y2 - TB.y1) * 1.0));
If Not InRange(Density, RockDensityMin, RockDensityMax) Then
Exit;
End;
2. Answered in first question, you need to loop it. Come on MSN and I can help you better.
EDIT: I'm a![]()
Last edited by Naum; 03-20-2010 at 07:05 PM.
I've never even heard of density before but here is what I would do...
SCAR Code:FindColorsTolerance(TPA, color, MSX1, MSY1, MSX2, MSY2, tol);
TPAToATPA(TPA, 25);
for i:=0 to High(ATPA) do
begin
B := GetTPABounds(ATPA[i]);
D := GetArrayLength(ATPA[i]) / (B.x2 - B.x1)*(B.y2 - B.y1);
// other stuff...mabye record the point with the best density??
end;
http://villavu.com/forum/showthread.php?t=13764 <--- you guys are 2.5 years late(obviously the suggested methods above are better... they weren't there yet, but you can see how you can use it in object finding)
Oh, and I think using a convex hull rather then a square around your points would be way more usefull![]()
Last edited by Killerdou; 03-20-2010 at 10:45 PM.
Infractions, reputation, reflection, the dark side of scripting, they are.
There are currently 1 users browsing this thread. (0 members and 1 guests)