int height = bmp.Height; int width = bmp.Width; Bitmap newBitMap = new Bitmap(width, height); Color pixel; for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { pixel = bmp.GetPixel(x, y); int r, g, b, result; result = 0; r = pixel.R; g = pixel.G; b = pixel.B;另,你如果想去模拟点击别人的按扭,可以用勾子,或自己搜windows句柄
验证码把,你需要的是YoLo3 / SSD
用视觉库,比如OpenCV,visionPro,halcon等,用其定位工具。
有个老库,AForge.Net http://www.aforgenet.com 可以直接NuGet添加引用 几行代码就行,一个原图,一个按钮小图,返回的就有坐标AForge.Imaging.ExhaustiveTemplateMatching 类// create template matching algorithm's instance // use zero similarity to make sure algorithm will provide anything ExhaustiveTemplateMatching tm = new ExhaustiveTemplateMatching( 0 ); // compare two images TemplateMatch[] matchings = tm.ProcessImage( image1, image2 ); // check similarity level if ( matchings[0].Similarity > 0.95f ) { // do something with quite similar images }
int width = bmp.Width;
Bitmap newBitMap = new Bitmap(width, height);
Color pixel;
for (int x = 0; x < width; x++)
{
for (int y = 0; y < height; y++)
{
pixel = bmp.GetPixel(x, y);
int r, g, b, result;
result = 0;
r = pixel.R;
g = pixel.G;
b = pixel.B;另,你如果想去模拟点击别人的按扭,可以用勾子,或自己搜windows句柄
几行代码就行,一个原图,一个按钮小图,返回的就有坐标AForge.Imaging.ExhaustiveTemplateMatching 类// create template matching algorithm's instance
// use zero similarity to make sure algorithm will provide anything
ExhaustiveTemplateMatching tm = new ExhaustiveTemplateMatching( 0 );
// compare two images
TemplateMatch[] matchings = tm.ProcessImage( image1, image2 );
// check similarity level
if ( matchings[0].Similarity > 0.95f )
{
// do something with quite similar images
}
GetPixel性能极差,这个一定要用unsafe代码,lockbit什么的,性能提高上百倍