Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6996243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T20:07:52+00:00 2026-05-27T20:07:52+00:00

this is a pretty rough area (fuzzy logic image comparison) that is way above

  • 0

this is a pretty rough area (fuzzy logic image comparison) that is way
above my pay grade, so to speak.

I’m trying to write a program that will detect carrots (and other veggies) onscreen from a game and return matching x,y coordinates for each found match.

The intent is to track each time the vegetable grows (5 times) and eventually automate the watering/harvesting of the vegetables (once you see the screenshots this will make more sense).

I tried using the image compare code located at
http://sites.google.com/site/serinolorenzo/blackmask

it actually works flawlessly when searching this screenshot (and desktop grabs)
http://imageshack.us/photo/my-images/24/mac8.png/

for instances this image…
http://imageshack.us/photo/my-images/249/carrotplant.png/

It does find and return multiple “Carrot Seeds” menu coordinates.

However when I get down to detecting the veggies (the meat and potatoes of what the compare needs to detect) it fails to find a match.

I’ve tried various “carrot” screenshot, most recently…
http://imageshack.us/photo/my-images/829/carrotlight1t.png/

to the image
http://imageshack.us/photo/my-images/408/macnolight1.png/

(I had to turn in game lighting off when I got here, to ensure colors stayed the same regardless of game time).

I thought (by going over the source code for the image compare) that black would be ignored, so I’m not sure exactly what’s going on, but it just will not find a match now, even if I set the thresholds lower.

Are there any (well documented) libraries that exist to do this, as coding it from scratch is just something I can’t do at the moment.

Barring that (and if whomever is reading this has the time) can you see where I’m going wrong?

The code I’m using to do the testing is…

    public void tester()
    {
        Bitmap screenshot;
        screenshot = new Bitmap(@"c:\MyMercurial\ATITDVeggieMacro\ATITDVeggieMacro\Images\macnolight1.bmp");

        Bitmap searchFor;
        searchFor = new Bitmap(@"c:\MyMercurial\ATITDVeggieMacro\ATITDVeggieMacro\Images\wholecarrot.bmp");
        int ac1;
        int ac2;

        ArrayList test = BlackMask.Search(screenshot,searchFor,
            0,10,75,5,80,20,100,true,out ac1,out ac2);

        statusUpdate = ac1.ToString()+"good,"+ ac2.ToString()+" bad/ X=";
    }

(I just update the file paths when I want to change images).

(Bonus question, how to I use relative paths to tell it to just go up two directories and then down into the Images folder, I can’t at all remember the relative path shortcuts)

Thanks for any help guys, this ones got me slamming my forehead.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T20:07:53+00:00Added an answer on May 27, 2026 at 8:07 pm

    For intelligent image processing in .NET, you could look into using AForge.NET. There’s also OpenCV, but then are no .NET bindings that I know of off hand (they appear to have some for Java though…). Once you figure out which library, I’m sure you can find additional articles via Google on their usage (besides their standard examples)

    I’ve never played ATITD, however, if you figured out the various specs of how it was developed, that could shed some light into how you might approach this problem in an entirely different direction. For example, if their Client app links to the MS C runtime DLL, it might have been developed in C/C++ (or maybe with some other lang whose framework runs on a C/C++ core). You could end up just manipulating the memory of the program if you found out how it stores the copy of the game state in the Client memory (assuming it’s just not some video feed, a la OnLive). If you figure out which rendering framework they use, OpenGL, DX, etc, you may be able to do the image capture more efficiently (and possibly without as much artifacts, like the grass and such, that you have to mask out yourself) via DLL hooks/proxies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this pretty much is the thing. When in tinymce I press anything that is
This is pretty weird. I have my Profiler open and it obviously shows that
This is pretty trivial, but I noticed on SO that instead of an offset
We're working in a legacy code base that's got a pretty rough data model.
I'm having a pretty rough time trying to make use of interprolog I have
Ok, so I have an XML file that pretty much looks like this: <Templates>
Recently I stumbled across this pretty slick JS library called nodeJS that acts like
This pretty much has me defeated. On XP and earlier versions of Windows you
I find this pretty confusing. When you want to rotate a view, it's going
I'm stuck with this pretty silly thing; I got a textfile like this; Hello::140.0::Bye

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.