|
You last visited: Today at 20:24
Advertisement
Pixel Bot - Image Detection with confidence value?!
Discussion on Pixel Bot - Image Detection with confidence value?! within the .NET Languages forum part of the Coders Den category.
10/12/2021, 13:16
|
#1
|
elite*gold: 0
Join Date: Oct 2014
Posts: 605
Received Thanks: 369
|
Pixel Bot - Image Detection with confidence value?!
Greetings, i am currently working on a free fishing bot for new world.
It's my first ever pixel/image detecting bot. I am currently using  to detect for images inside another image(screen area).
However, this only works if colors match perfectly, no clue what exactly the "exact match" bool changes, i did not notices anything, but i think thats more about image sizes.
For python, i've seen  which allows you to search with a confidence value, so it would still detect similar matches.
My question is: Is there some good library like PyAutoGui for C# as well? I'd like to stick to C#, but i cannot find something for my needs & i am not that advanced that i could write it myself.
I've tried to convert the images to 1 bit images so they are only black and white, but still, then for some color variations, it will convert other pixels to Black/White than on the source image, which makes it mismatch again.
Thanks for any help in advance. Have a great day!
//EDIT:
I found  but this would kinda force me to save the images somewhere, i'd like to use the image from Properties.Resources instead. Any way to accomplish it with this?
|
|
|
10/25/2021, 04:10
|
#2
|
elite*gold: 4
Join Date: Apr 2019
Posts: 241
Received Thanks: 52
|
Hello sir. I have my own fishing bot and i selling on epvp. You can see it from here:
I can say C# is very bad and slow for image processing technology. You should use Python with PyAutoGui library. It's very good
|
|
|
10/25/2021, 22:26
|
#3
|
elite*gold: 0
Join Date: Oct 2014
Posts: 605
Received Thanks: 369
|
Quote:
Originally Posted by Vitokonuk
Hello sir. I have my own fishing bot and i selling on epvp. You can see it from here:
I can say C# is very bad and slow for image processing technology. You should use Python with PyAutoGui library. It's very good 
|
ah no already got it working, just using imagesearchdll.dll from autoit, works pretty well
|
|
|
10/27/2021, 04:50
|
#4
|
elite*gold: 0
Join Date: Nov 2018
Posts: 178
Received Thanks: 48
|
Quote:
Originally Posted by saixo
ah no already got it working, just using imagesearchdll.dll from autoit, works pretty well
|
If you are looking for a native solution, I can tell you how to do this without external libraries.
|
|
|
10/27/2021, 21:12
|
#5
|
elite*gold: 338
Join Date: May 2009
Posts: 417
Received Thanks: 13
|
Quote:
Originally Posted by tehpwnerer69
If you are looking for a native solution, I can tell you how to do this without external libraries.
|
Would be interested.
Currently writing a bot for personal use.
|
|
|
10/28/2021, 03:04
|
#6
|
elite*gold: 0
Join Date: Nov 2018
Posts: 178
Received Thanks: 48
|
Quote:
Originally Posted by Xemus™
Would be interested.
Currently writing a bot for personal use.
|
Hit me up with a PM
I'll give you the run down
|
|
|
11/01/2021, 11:56
|
#7
|
elite*gold: 100
Join Date: Mar 2006
Posts: 1,826
Received Thanks: 430
|
Quote:
Originally Posted by saixo
Greetings, i am currently working on a free fishing bot for new world.
It's my first ever pixel/image detecting bot. I am currently using  to detect for images inside another image(screen area).
However, this only works if colors match perfectly, no clue what exactly the "exact match" bool changes, i did not notices anything, but i think thats more about image sizes.
For python, i've seen  which allows you to search with a confidence value, so it would still detect similar matches.
My question is: Is there some good library like PyAutoGui for C# as well? I'd like to stick to C#, but i cannot find something for my needs & i am not that advanced that i could write it myself.
I've tried to convert the images to 1 bit images so they are only black and white, but still, then for some color variations, it will convert other pixels to Black/White than on the source image, which makes it mismatch again.
Thanks for any help in advance. Have a great day!
//EDIT:
I found  but this would kinda force me to save the images somewhere, i'd like to use the image from Properties.Resources instead. Any way to accomplish it with this?
|
This is the easiest way to implement it.
Less codes and stuff.
|
|
|
12/21/2022, 20:48
|
#8
|
elite*gold: 50
Join Date: Dec 2015
Posts: 30
Received Thanks: 27
|
Code:
public static Rectangle SearchBitmap(Bitmap bitmap1, Bitmap bitmap2, double tolerance)
{
if (bitmap1.Width > bitmap2.Width || bitmap1.Height > bitmap2.Height)
{
Bitmap aux = bitmap2;
bitmap2 = bitmap1;
bitmap1 = aux;
}
if (bitmap1.Height > bitmap2.Height)
{
return Rectangle.Empty;
}
return SearchBitmapStepTwo(bitmap1, bitmap2, tolerance);
}
private static Rectangle SearchBitmapStepTwo(Bitmap smallBmp, Bitmap bigBmp, double tolerance)
{
BitmapData smallData =
smallBmp.LockBits(new Rectangle(0, 0, smallBmp.Width, smallBmp.Height),
System.Drawing.Imaging.ImageLockMode.ReadOnly,
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
BitmapData bigData =
bigBmp.LockBits(new Rectangle(0, 0, bigBmp.Width, bigBmp.Height),
System.Drawing.Imaging.ImageLockMode.ReadOnly,
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
int smallStride = smallData.Stride;
int bigStride = bigData.Stride;
int bigWidth = bigBmp.Width;
int bigHeight = bigBmp.Height - smallBmp.Height + 1;
int smallWidth = smallBmp.Width * 3;
int smallHeight = smallBmp.Height;
Rectangle location = Rectangle.Empty;
int margin = Convert.ToInt32(255.0 * tolerance);
unsafe
{
byte* pSmall = (byte*)(void*)smallData.Scan0;
byte* pBig = (byte*)(void*)bigData.Scan0;
int smallOffset = smallStride - smallBmp.Width * 3;
int bigOffset = bigStride - bigBmp.Width * 3;
bool matchFound = true;
for (int y = 0; y < bigHeight; y++)
{
for (int x = 0; x < bigWidth; x++)
{
byte* pBigBackup = pBig;
byte* pSmallBackup = pSmall;
//Look for the small picture.
for (int i = 0; i < smallHeight; i++)
{
int j = 0;
matchFound = true;
for (j = 0; j < smallWidth; j++)
{
//With tolerance: pSmall value should be between margins.
int inf = pBig[0] - margin;
int sup = pBig[0] + margin;
if (sup < pSmall[0] || inf > pSmall[0])
{
matchFound = false;
break;
}
pBig++;
pSmall++;
}
if (!matchFound) break;
//We restore the pointers.
pSmall = pSmallBackup;
pBig = pBigBackup;
//Next rows of the small and big pictures.
pSmall += smallStride * (1 + i);
pBig += bigStride * (1 + i);
}
//If match found, we return.
if (matchFound)
{
location.X = x;
location.Y = y;
location.Width = smallBmp.Width;
location.Height = smallBmp.Height;
break;
}
//If no match found, we restore the pointers and continue.
else
{
pBig = pBigBackup;
pSmall = pSmallBackup;
pBig += 3;
}
}
if (matchFound) break;
pBig += bigOffset;
}
}
if (bigData != null)
bigBmp.UnlockBits(bigData);
if (smallData != null)
smallBmp.UnlockBits(smallData);
return location;
}
Use this you can ad an tolerance.
|
|
|
Similar Threads
|
All paladium pixel bot+ website service+palavia pixel bot crack (no break,no update)
10/30/2013 - DarkOrbit - 18 Replies
Hello today :
All palladium bot :
Byfuso98:https://mega.co.nz/#!5p00SAjD!UxUiASLcU9 Qu6V11S1Ub3nUaMUA20x9XWQwHlgAv7cE (official link)
Check: ONLINE
ByPrdlyAndel:
https://mega.co.nz/#!scc03RBR!U1pj1DTh1HsBR-HO-BT 9R35qcRlcExXtEyf_NoabdHI
|
[DEMO] SkyBot (Pixel/Image Detection)
09/14/2010 - 12Sky2 Hacks, Bots, Cheats & Exploits - 25 Replies
http://i896.photobucket.com/albums/ac170/skybotgam ing/header.jpg
SkyBot has come a long way since it was known as AFK Guy. For those who don't know, SkyBot is not a trainer or a collection of hacks. It is strictly a grinding automation system.
What it lacks in the hack department it makes up for greatly in the botting department.
Advantages:
Doesn't use memory addresses.
Cannot be patched away.
Cannot be internally detected.
|
All times are GMT +1. The time now is 20:24.
|
|