Results 1 to 18 of 18

Thread: RSPS Script Help and Questions (Not asking for handouts)

  1. #1
    Join Date
    Feb 2017
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default RSPS Script Help and Questions (Not asking for handouts)

    BEFORE I go on, I would like to say, no I am not asking you to code a script for me.
    I am simply asking for suggestions as how to make it better, and what commands to learn to use.
    Although it would be nice for a script example, for understanding easier.

    I am attempting to code a basic RSPS script, essentially to rightclick > Pick Pocket > repeat.
    I haven't got to the pickpocket part yet, so i'm just focusing on how to accurately find a color, move my mouse to it and right click.
    This is the code I have so far, with notes for myself(They're for a scrub I know).
    99% of the time it works either not at all, or incorrectly.
    I think this is due to the fact that it cant find the Color so well.

    Essentially the code is based off of the one by RJ, How to script for a RSPS - Beginner level.
    with minor edits to spelling errors, bypassing SMART, Custom color/mouse speed, and repeating infinitely.
    Also any help cleaning up the code, (more efficient structure) is greatly appreciated as well!

    Code:
    //Name program, declare SRL
    Program PickPocketGuard;
    {$i srl-6/srl.simba}
    
    //Bypass SMART
    function waitClientReady(): boolean;override;begin result:= true;end
    
    //Create Procedure/Vars
    Procedure PickPocket;
    var
      X,Y:Integer;
    begin
    
    //Searches for color
      if FindColorTolerance(X, Y, 6950925, 277, 169, 326, 218, 10) then
    
    //Move mouse to color, right click
      begin
        mouse(x, y,1,1);
        wait(500);
        ClickMouse(X, Y, mouse_Right)
      end;
    end;
    
    //Mouse speed, and repeat infinite
    Begin
      MouseSpeed := 150;
        SetupSRL;()
      PickPocket();
    repeat
      PickPocket();
      until (false)
    end.

  2. #2
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    You should look into TPointArrays

  3. #3
    Join Date
    Feb 2017
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Could you give an example code? Don't really understand them very well, haha, been looking into it for a bit, can't get it to work.

  4. #4
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by hufflepup View Post
    Could you give an example code? Don't really understand them very well, haha, been looking into it for a bit, can't get it to work.
    https://villavu.com/forum/showthread.php?t=49067

  5. #5
    Join Date
    Feb 2017
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Sweet thank you! Any other tips for me?

  6. #6
    Join Date
    Dec 2011
    Posts
    193
    Mentioned
    5 Post(s)
    Quoted
    51 Post(s)

    Default

    Quote Originally Posted by hufflepup View Post
    Sweet thank you! Any other tips for me?
    Remove the prepended "T" from any jargon.

    TPointArray -> PointArray. So it's an array of Points, a Point being a single X,Y coordinate.

    So what we can do is look for every pixel that matches our criteria, then hold those matches (Points) in an array (PointArray). Now we can work with this array, we know the Points we want are in there somewhere, but it can easily be mixed up with other stuff on screen that just so happens to match. The favoured approach from here is to split this PointArray (TPA) into meaningful relationships such as Height and Width or the Distance between Points. We call this new arrangement an ATPA, which is just an Array of a PointArray, so an array of arrays.

    The link jstemper provided above is a fantastic resource and I believe the highest repped post on the entire forums. It displays many a ways to split a TPA into these ATPA relationships, it's still all relevant today, so give it thorough reading. The pictures provided will help you visualise the ATPA's mentioned above.

    Also search the forums for ACA (Auto Color Aid) which is a tool developed here specifically made for getting the perfect mixture of color properties (color, tolerance, hue and saturation) to find what you're looking for. Doing what you've done above is okay for quick and dirty matching but isn't good enough for interaction.

    Great attitude displayed in your OP btw.

    OSRS Color Scripts: Borland_Salamanders | Borland_Iron_Ores
    Utilities & Snippets: [Color] OSBuddy Item Looting

  7. #7
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    This is an extract from @kristi who replied to my thread on banking methods.

    The same method can be adapted to find an object that you are wanting to pick pocket.

    Simba Code:
    program BankFinder;
    {$I Aerolib/Aerolib.simba}

    type
      TBank = record //create a record with the necessary fields
        Name : String; //not really necessary but can be used later on to identify the bank
        BankCol : TColEx;
        countMin, countMax : Integer;
      end;

    var
      VarrockWest : TBank;  //declare VarrockWest as a TBank

    Procedure ScriptSetup;
    begin
      with VarrockWest do
      begin
        Name := 'Varrock West';
        BankCol.Create(2379613, 2, 0.08, 3.64);{ create a TColEx,
        this automatically creates a CTS2 color and you don't have to deal with
        changing back CTS-speed and such, the parameters are (in order) : Color, Tolerance, Hue, Sat.
        However, the tolerance is a bit too low, even if it matches in ACA, remember that Runescape
        constantly changes colors, try switching worlds and grabbing colors or try to just add a few numbers,
        e.g 2 >> 7, as long as it doesn't mess up the results }

        countMin := 50; //min count of color (make sure you got the right count!)
        countMax := 100; //max count
      end;
    end;

    function TBank.Find(var p:TPoint) : Boolean; //create a general method of finding TBanks
    var
      i:Integer;
      TPA:TPointArray;
      ATPA:T2DPointArray;
      tmpCTS: integer;

    begin
      if Self.BankCol.FindAllIn(AREA_MS, TPA) then //if the bankCol TColEx is found in area MS, store the points in TPA
      begin
        ATPA := ClusterTPAEx(TPA, 5, 5); //you'll have to figure out the right bounds
        SortATPaFromMidPoint(ATPA, MSCP); //sort them from mainscreen centre

        {
          Delete TPA's in that are shorter than our countMin and larger than our countMax (I just chose 10000 as a really big number),
          there is probably a fancier way to do this, but you get the point
        }

        FilterTPAsBetween(ATPA, 0, Self.CountMin);
        FilterTPAsBetween(ATPA, Self.CountMax, 10000);
        if Length(ATPA) < 1 then Exit; //when filtering and all is done, if the array is empty then no matching points where found, so we can exit

        DebugATPA(ATPA, ''); //debug the atpa, will show a debug image with the TPA:s marked in red

        for i := 0 to High(ATPA) do
        begin
          p := ATPA[i].MidPnt;
          HumanMMouse(p, 0, 0);
          wait(randomRange(60, 120)); //I like to add a wait here so the uptext has time to appear
          if isUpText('ank') then
            Exit(True);
        end;
      end;
    end;

    var
      pnt : TPoint;
    begin
      initAl;
      //now to find it just use:
      VarrockWest.Find(pnt);
      Writeln('found point: ' + toStr(pnt));
    end.
    The commented fields explain what most of the lines do, but I will try and add a bit more info to it.

    Essentially what it does is creates a type called TBank (this can be named anything, like TNPC or TStealFromGuy).
    The type has a few variables to it:
    Name: Name of our object (not too important)
    BankCol: Color of the object that we are wanting to find (you may need to find another way to declare TColEx based on the include you are using).
    CountMin: Minimum color count the TPA must have to be considered.
    CountMax: Maximum color count the TPA must have to be considered.

    This allows us to access the information using Tbank.Variable (Tbank.Name, Tbank.BankCol etc).

    The comments can advise you on the functions better than I can. Hope this helps

  8. #8
    Join Date
    Feb 2017
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Thank you for both your replies!
    So far, many trial and errors later still can't get it to work, probly because it's an RSPS xD.
    Well, I suppose that's it, haha.

    Wasn't really doing this to gain an advantage, as much as learning a basic language,
    I think i'll just start with Java or maybe stay with Simba, and attempt to code an actual OSRS script.
    What are the advantages of Simba coding is OSRS, versus the mainstream Java based bots?

  9. #9
    Join Date
    Jun 2013
    Location
    Scranton
    Posts
    496
    Mentioned
    5 Post(s)
    Quoted
    220 Post(s)

    Default

    Quote Originally Posted by hufflepup View Post
    Thank you for both your replies!
    So far, many trial and errors later still can't get it to work, probly because it's an RSPS xD.
    Well, I suppose that's it, haha.

    Wasn't really doing this to gain an advantage, as much as learning a basic language,
    I think i'll just start with Java or maybe stay with Simba, and attempt to code an actual OSRS script.
    What are the advantages of Simba coding is OSRS, versus the mainstream Java based bots?
    The Java bot communities are commercial for the most part. Simba is free and open-source, with a friendly and knowledgeable community. I'd say one of the biggest advantages coding wise is being able to run full color scripts on the official client (with your hardware mouse).

    Which rsps btw?

  10. #10
    Join Date
    Feb 2017
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by jstemper View Post
    The Java bot communities are commercial for the most part. Simba is free and open-source, with a friendly and knowledgeable community. I'd say one of the biggest advantages coding wise is being able to run full color scripts on the official client (with your hardware mouse).

    Which rsps btw?
    That's true, I think I'll stick around simba for a while.
    And the rsps is Kratos rsps
    It's my personal favorite.

  11. #11
    Join Date
    Dec 2011
    Posts
    193
    Mentioned
    5 Post(s)
    Quoted
    51 Post(s)

    Default

    Quote Originally Posted by hufflepup View Post
    What are the advantages of Simba coding is OSRS, versus the mainstream Java based bots?
    Ooo, an audition!

    Firstly, being able to write scripts for an RSPS right? Simba can be used to automate a lot of stuff, RS just so happens to be our poison. Open source and no pay walls. We don't go down every RS update. Flexibility in how you can bot: Official client with actual mouse or Java client with its own virtual mouse. Can be used as a general scripting platform,: you can make something like a web scraper very easily. Other scripting languages might be slightly better equipped for certain tasks with their extensive libraries and such, but if you already have Simba open anyway, it's easier to new tab and type away than setup something else and find a library etc...

    By removing the ability to profit you naturally remove a lot of the toxicity that will normally ail other communities.

    -

    Now for your script, this isn't the time for giving up - its time for digging deep - this is where we learn best. The fact it's an RSPS doesn't matter, where there's color there's a way. Although, lets scale back a second and start with a very basic premise. The following image has two red objects, use what you've learned so far to locate the bigger object on the right. That's our pickpocket victim for now.


    OSRS Color Scripts: Borland_Salamanders | Borland_Iron_Ores
    Utilities & Snippets: [Color] OSBuddy Item Looting

  12. #12
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    Aerolib is a solid choice for OSRS. A lot of the leg work has been done. Object finding is a breeze.

    Community is what keeps most people who are serious about learning around. Very helpful!

  13. #13
    Join Date
    Jan 2016
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by Borland View Post
    Ooo, an audition!

    Firstly, being able to write scripts for an RSPS right? Simba can be used to automate a lot of stuff, RS just so happens to be our poison. Open source and no pay walls. We don't go down every RS update. Flexibility in how you can bot: Official client with actual mouse or Java client with its own virtual mouse. Can be used as a general scripting platform,: you can make something like a web scraper very easily. Other scripting languages might be slightly better equipped for certain tasks with their extensive libraries and such, but if you already have Simba open anyway, it's easier to new tab and type away than setup something else and find a library etc...

    By removing the ability to profit you naturally remove a lot of the toxicity that will normally ail other communities.

    -

    Now for your script, this isn't the time for giving up - its time for digging deep - this is where we learn best. The fact it's an RSPS doesn't matter, where there's color there's a way. Although, lets scale back a second and start with a very basic premise. The following image has two red objects, use what you've learned so far to locate the bigger object on the right. That's our pickpocket victim for now.

    Hi I know this thread was made a while ago but I would like some help regarding the question you raised. I've just started getting into color and I was wondering how you could distinguish between the two red figures? I've heard of FindobjTPA which could work since it considers height/width but doesnt work on simba for me. ACA itself seems kind of tricky to implement. For example, I've been trying to use it to locate a bankchest but sometimes the mouse will travel to very small points where some similar color was detected and will hover there. Obviously some kind of height/width restriction might help but not sure how to do that

    Also, if you dont mind, would you mind explaining the different types of color methods we could use? For example whens the best time to use DTMs vs using ACA color? Could I not have technically used a DTM to locate the bankchest or is that not possible/not recommended?


    Thank you!

  14. #14
    Join Date
    Jan 2016
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by Dan the man View Post
    This is an extract from @kristi who replied to my thread on banking methods.

    The same method can be adapted to find an object that you are wanting to pick pocket.

    Simba Code:
    program BankFinder;
    {$I Aerolib/Aerolib.simba}

    type
      TBank = record //create a record with the necessary fields
        Name : String; //not really necessary but can be used later on to identify the bank
        BankCol : TColEx;
        countMin, countMax : Integer;
      end;

    var
      VarrockWest : TBank;  //declare VarrockWest as a TBank

    Procedure ScriptSetup;
    begin
      with VarrockWest do
      begin
        Name := 'Varrock West';
        BankCol.Create(2379613, 2, 0.08, 3.64);{ create a TColEx,
        this automatically creates a CTS2 color and you don't have to deal with
        changing back CTS-speed and such, the parameters are (in order) : Color, Tolerance, Hue, Sat.
        However, the tolerance is a bit too low, even if it matches in ACA, remember that Runescape
        constantly changes colors, try switching worlds and grabbing colors or try to just add a few numbers,
        e.g 2 >> 7, as long as it doesn't mess up the results }

        countMin := 50; //min count of color (make sure you got the right count!)
        countMax := 100; //max count
      end;
    end;

    function TBank.Find(var p:TPoint) : Boolean; //create a general method of finding TBanks
    var
      i:Integer;
      TPA:TPointArray;
      ATPA:T2DPointArray;
      tmpCTS: integer;

    begin
      if Self.BankCol.FindAllIn(AREA_MS, TPA) then //if the bankCol TColEx is found in area MS, store the points in TPA
      begin
        ATPA := ClusterTPAEx(TPA, 5, 5); //you'll have to figure out the right bounds
        SortATPaFromMidPoint(ATPA, MSCP); //sort them from mainscreen centre

        {
          Delete TPA's in that are shorter than our countMin and larger than our countMax (I just chose 10000 as a really big number),
          there is probably a fancier way to do this, but you get the point
        }

        FilterTPAsBetween(ATPA, 0, Self.CountMin);
        FilterTPAsBetween(ATPA, Self.CountMax, 10000);
        if Length(ATPA) < 1 then Exit; //when filtering and all is done, if the array is empty then no matching points where found, so we can exit

        DebugATPA(ATPA, ''); //debug the atpa, will show a debug image with the TPA:s marked in red

        for i := 0 to High(ATPA) do
        begin
          p := ATPA[i].MidPnt;
          HumanMMouse(p, 0, 0);
          wait(randomRange(60, 120)); //I like to add a wait here so the uptext has time to appear
          if isUpText('ank') then
            Exit(True);
        end;
      end;
    end;

    var
      pnt : TPoint;
    begin
      initAl;
      //now to find it just use:
      VarrockWest.Find(pnt);
      Writeln('found point: ' + toStr(pnt));
    end.
    The commented fields explain what most of the lines do, but I will try and add a bit more info to it.

    Essentially what it does is creates a type called TBank (this can be named anything, like TNPC or TStealFromGuy).
    The type has a few variables to it:
    Name: Name of our object (not too important)
    BankCol: Color of the object that we are wanting to find (you may need to find another way to declare TColEx based on the include you are using).
    CountMin: Minimum color count the TPA must have to be considered.
    CountMax: Maximum color count the TPA must have to be considered.

    This allows us to access the information using Tbank.Variable (Tbank.Name, Tbank.BankCol etc).

    The comments can advise you on the functions better than I can. Hope this helps
    Hey Dan I was wondering if you could help me out when making a script. I asked a question above this post to Borland as well and Id be grateful to hear your answer for that as well.

    Is this example script from kristi still the best way to find colors? Can you please explain how you get countmin and countmax?

    If you can answer I would be happy to create a nicely formatted Q&A and add it as a post on one of your tutorials for other people to see as well

    Thank you!

  15. #15
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    Quote Originally Posted by Hellzonee View Post
    Hey Dan I was wondering if you could help me out when making a script. I asked a question above this post to Borland as well and Id be grateful to hear your answer for that as well.

    Is this example script from kristi still the best way to find colors? Can you please explain how you get countmin and countmax?

    If you can answer I would be happy to create a nicely formatted Q&A and add it as a post on one of your tutorials for other people to see as well

    Thank you!
    Hey mate.

    The countmin and countmax is basically just playing around. start your countmin at 0 and your count max at 1000 or something and work backwards. The line DebugATPA(ATPA, ''); will show you a picture of the clusters of TPAs (the objects) that it finds. The Countmin/Countmax is to filter out objects that we don't want to appear.

    I am sure there are a heap of ways to achieve color finding, but I have had a lot of success with the method that Kristi posted; has been my standard since he showed me.

    With ACA, make sure your CTS is set to 2, not the default 1 - makes a HUGE difference.

    With selecting your color, click a color and click mark best color to see the change. If you start to identify colors outside of your desired object, that is ok, as we will be using Countmin and Countmax to filter them out. Use that entire block above, except for:
    Simba Code:
    for i := 0 to High(ATPA) do
        begin
          p := ATPA[i].MidPnt;
          HumanMMouse(p, 0, 0);
          wait(randomRange(60, 120)); //I like to add a wait here so the uptext has time to appear
          if isUpText('ank') then
            Exit(True);
        end;
    This is good for when your script actually runs, but for getting your colors right, you only need it to work its magic with the TPAs then display it with DebugATPA.

  16. #16
    Join Date
    Dec 2011
    Posts
    193
    Mentioned
    5 Post(s)
    Quoted
    51 Post(s)

    Default

    Quote Originally Posted by Hellzonee View Post
    Hi I know this thread was made a while ago but I would like some help regarding the question you raised. I've just started getting into color and I was wondering how you could distinguish between the two red figures? I've heard of FindobjTPA which could work since it considers height/width but doesnt work on simba for me. ACA itself seems kind of tricky to implement. For example, I've been trying to use it to locate a bankchest but sometimes the mouse will travel to very small points where some similar color was detected and will hover there. Obviously some kind of height/width restriction might help but not sure how to do that

    Also, if you dont mind, would you mind explaining the different types of color methods we could use? For example whens the best time to use DTMs vs using ACA color? Could I not have technically used a DTM to locate the bankchest or is that not possible/not recommended?


    Thank you!
    Here's the code to find and hover the larger square. If you're on windows, open the image in paint and target it. Don't use windows image previewer as it distorts colors.

    Simba Code:
    program new;
    {$i AeroLib/AeroLib.Simba}

    const
      RedColor = 2366701;

    function findLargeSquare: TPointArray;
    var
      redCol: TColEx;
      redSquaresTPA: TPointArray;
      redSquaresATPA: T2DPointArray;
    begin
      redCol.Col := RedColor;                              //assign the color of our red square
      redCol.findAllIn(ToBox(1,1,382,180), redSquaresTPA); //use AeroLib function to find every pixel matching the color above

      if Length(redSquaresTPA) = 0 then                    //the above function is also a boolean so you could wrap an if then around it instead of this
      begin
        Writeln('Failed to find any red color. Try picking the color yourself and updating the const at the top.');
        TerminateScript;
      end;

      redSquaresATPA := ClusterTPA(redSquaresTPA, 1);      //split all our red pixels in a single array (TPA) into multiple arrays (ATPA) where any pixel not within 1px of another is a new element
      SortATPASize(redSquaresATPA, True);                  //re-arrange this ATPA by size, true = put the highest first.
      Result := redSquaresATPA[0];                         //return the first element in the array, we know this is the highest cause of the above.
    end;

    procedure hoverLargeSquare;
    var
      squarePnt: TPoint;
    begin
      squarePnt := MiddleTPA(findLargeSquare);             //Get the middle point of our large square
      accurateMMouse(squarePnt, 0, 0);                     //move the mouse to this point with 0 randomness
    end;

    begin
      InitAL;
      hoverLargeSquare;
    end.

    You asked how to find the countMin/Max. That's just the number of pixels we want the thing we're finding to be between. For example, if you simply find a color on screen, there may be 1 pixel way in the corner that will match and the mouse will move there if looping through. If you put a minimum count of say 10 pixels, all those small matches will be filtered out as they're below our threshold. It's different to each thing you're trying to find and you'll have to mess around to acquire them yourself. For example, you can add this to the script above, right before the last "end." and it'll tell you how many pixels the large square is. If we set this as the minimum count then we'd only match squares of this size and larger.
    Simba Code:
    Writeln(Length(findLargeSquare));

    If you look at my iron mining script, then specifically the Ore.Find function, you'll see that I filter out results below a certain number of pixels. That's because as the script drops iron ores, the color will be found beneath the player and I don't want the script constantly hovering beneath us looking for "mine iron ore" uptext as it's an easy ride to banville. So despite the color of the dropped ore also matching the iron rocks, the dropped ore falls below my minimum count requirement and is therefore safely ignored.


    As for the DTM's, they're best used with non-transformables such as items in your invent. These are flat and always appear the same way, no rotation etc.. There's nothing stopping you from using it for other purposes but it'll generally produce unreliable results. But, if something works and works reliably then it's not stupid. I used DTM's to find Ivy in my first script after having tons a trouble at the time with TPA matching to peoples clothes too often. Looking back now it was due to my ineptitude with TPA's but the DTM finding worked extremely well all the same.

    OSRS Color Scripts: Borland_Salamanders | Borland_Iron_Ores
    Utilities & Snippets: [Color] OSBuddy Item Looting

  17. #17
    Join Date
    Jan 2016
    Posts
    77
    Mentioned
    0 Post(s)
    Quoted
    44 Post(s)

    Default

    Quote Originally Posted by Dan the man View Post
    Hey mate.

    The countmin and countmax is basically just playing around. start your countmin at 0 and your count max at 1000 or something and work backwards. The line DebugATPA(ATPA, ''); will show you a picture of the clusters of TPAs (the objects) that it finds. The Countmin/Countmax is to filter out objects that we don't want to appear.

    I am sure there are a heap of ways to achieve color finding, but I have had a lot of success with the method that Kristi posted; has been my standard since he showed me.

    With ACA, make sure your CTS is set to 2, not the default 1 - makes a HUGE difference.

    With selecting your color, click a color and click mark best color to see the change. If you start to identify colors outside of your desired object, that is ok, as we will be using Countmin and Countmax to filter them out. Use that entire block above, except for:
    Simba Code:
    for i := 0 to High(ATPA) do
        begin
          p := ATPA[i].MidPnt;
          HumanMMouse(p, 0, 0);
          wait(randomRange(60, 120)); //I like to add a wait here so the uptext has time to appear
          if isUpText('ank') then
            Exit(True);
        end;
    This is good for when your script actually runs, but for getting your colors right, you only need it to work its magic with the TPAs then display it with DebugATPA.
    Hi Dan, and thanks again for the reply!

    Looking back at the example it seems to make a lot more sense now (especially with Borlands reply as well). I have one more question if you dont mind:

    Using Kristi's method I notice she uses mincount and maxcount. However if youre using the min/max count to filter out objects, then what is the point of using ATPA := ClusterTPAEx(TPA, 5, 5); ? Looking at the documentation, clustertpaEx filters out tpas based on height/width parameters but is that necessary if youre already using min/max count? Is there a different need for it?


    Thank you!

  18. #18
    Join Date
    Jan 2012
    Location
    Sydney, Australia
    Posts
    877
    Mentioned
    12 Post(s)
    Quoted
    368 Post(s)

    Default

    Quote Originally Posted by Hellzonee View Post
    Hi Dan, and thanks again for the reply!

    Looking back at the example it seems to make a lot more sense now (especially with Borlands reply as well). I have one more question if you dont mind:

    Using Kristi's method I notice she uses mincount and maxcount. However if youre using the min/max count to filter out objects, then what is the point of using ATPA := ClusterTPAEx(TPA, 5, 5); ? Looking at the documentation, clustertpaEx filters out tpas based on height/width parameters but is that necessary if youre already using min/max count? Is there a different need for it?


    Thank you!
    ClusterTPAEx basically filters TPAs so only pixels within x range of each other are grouped together. The Max/Min count is still required as you may have multiple objects that are found with all of the other prerequisites that aren't the object you are wanting to find. The Min/Max will filter for a specific value.

    For example:
    We are looking for a bank booth. We select the optimal color for the bank booth, but that color is also found in a chest on the other side of the room. Since the chest will have points that are close enough together for ClusterTPAEx to keep them after filtering, we need to use FilterTPAsBetween for both min and max filtering, as the chest will more than likely have a lower point count than our bank booth. If the chest had a point count of 100, we can eliminate that by setting CountMin to 200.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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