Recognizing a screen area for finding a location on the screen

I am trying to figure out a way to get Sikuli image recognition for use in C #. I don’t want to use Sikuli itself, because its scripting language is a bit slow, and because I really don’t want to introduce a Java bridge in the middle of my .NET C # application.

So, I have a bitmap that represents an area of ​​my screen (I will call this area BUTTON1). Perhaps the screen layout has changed a bit, or the screen may have been moved to the desktop, so I cannot use the direct position. I must first find where the current position of BUTTON1 is in the real screen. (I tried to post photos of this, but I think I can’t because I'm a new user ... I hope the description makes it clear ...)

I think Sikuli uses OpenCV under covers. Since it's open source, I think I could rebuild it and figure out how to do what they do in OpenCV, instead embedding it in Emgu.CV, but my Java is not very strong.

I searched for examples to demonstrate this, but all the examples are either extremely simple (for example, how to recognize a stop sign) or very complex (for example, how to recognize faces) ... and maybe I'm just solid, but I don't seem to I can take a step in the logic of how to do this.

I am also worried that all the various image manipulations are actually intensively processed by the processor, and I really want it to be as easy as possible (in fact, I can have many buttons and fields that I try to find on the screen .. .)

So I think of this instead:

A) Convert bitmaps to byte arrays and search for brute force. (I know how to do this). And then

B) , , ( , ) .

? - , Aforge.Net Emgu.CV ? ( B ...?)

!

+5
1

, , . SIKULI, ( Edge ..). , .

http://www.codeproject.com/KB/GDI-plus/Image_Processing_Lab.aspx

, AForge.net . , - :

Bitmap ImageSearchingWithin=new Bitmap("Location of image"); //or just load from a screenshot or whatever
for (int x = 0; x < ImageSearchingWithin.Width - WidthOfImageSearchingFor; ++x)
{
    for (int y = 0; y < ImageSearchingWithin.Height - HeightOfImageSearchingFor; ++y)
    {
        Bitmap MySmallViewOfImage = ImageSearchingWithin.Clone(new Rectangle(x, y, WidthOfImageSearchingFor, HeightOfImageSearchingFor), System.Drawing.Imaging.PixelFormat.Format24bppRgb);
    }
}

, ( - , BUTTON1). , . (, - , ).

0

All Articles