Results 1 to 7 of 7

Thread: Someone Teach Me How To Do Density Checks?

  1. #1
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default Someone Teach Me How To Do Density Checks?

    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!

  2. #2
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    gettpabounds(tpa);

    length(tpa) / (x2-x1)*(y2-y1)

    How about that?
    I made a new script, check it out!.

  3. #3
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by Markus View Post
    gettpabounds(tpa);

    length(tpa) / (x2-x1)*(y2-y1)

    How about that?
    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

  4. #4
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    How would I know what to make the x1 x2 y2 y1.
    How would I find density of a rock, and then ore?
    Thanks.

  5. #5
    Join Date
    Mar 2007
    Posts
    4,810
    Mentioned
    3 Post(s)
    Quoted
    3 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    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.

  6. #6
    Join Date
    Sep 2008
    Location
    Chicago
    Posts
    224
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    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;

  7. #7
    Join Date
    Nov 2006
    Posts
    1,103
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •