C#nedir?com Homepage
Forum Home Forum Home > C# / .NET > Visual C#
  New Posts New Posts RSS Feed - Aforge.net ile objenin rengine göre mouse imlecini
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Aforge.net ile objenin rengine göre mouse imlecini

 Post Reply Post Reply
   

Author
Message
mrvturan96 View Drop Down
Newbie
Newbie


Joined: 29 Ocak 2018
Location: Bursa
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote mrvturan96 Quote  Post ReplyReply Direct Link To This Post Topic: Aforge.net ile objenin rengine göre mouse imlecini
    Posted: 29 Ocak 2018 at 20:41

Merhaba,

Webcamden aldığım görüntüdeki objenin hareket ettiği yönlerde Mouse imlecini de hareket ettirmek istiyorum. Aforge.net kütüphanesini kullanarak obje takibi yapabiliyorum. Fakat Mouse kontrolünü sağlayamadım. Bunu nasıl yapabilirim?

public void nesnebul(Bitmap image)

{ BlobCounter blobCounter = new BlobCounter();

blobCounter.MinWidth = 5;

blobCounter.MinHeight = 5;

blobCounter.FilterBlobs = true;

blobCounter.ObjectsOrder = ObjectsOrder.Size;

BitmapData objectsData = image.LockBits(new Rectangle(0, 0, image.Width, image.Height), ImageLockMode.ReadOnly, image.PixelFormat);

Grayscale grayscaleFilter = new Grayscale(0.2125, 0.7154, 0.0721);

UnmanagedImage grayImage = grayscaleFilter.Apply(new UnmanagedImage(objectsData));

image.UnlockBits(objectsData); blobCounter.ProcessImage(image);

Rectangle[] rects = blobCounter.GetObjectsRectangles();

Blob[] blobs = blobCounter.GetObjectsInformation();

islemBox.Image = image; foreach (Rectangle recs in rects)

{ if (rects.Length > 0)

{ Rectangle objectRect = rects[0];

Graphics g = kaynakBox.CreateGraphics();

using (Pen pen = new Pen(Color.FromArgb(250, 0, 0), 2))

{

g.DrawRectangle(pen, objectRect);

}

int objectX = objectRect.X + (objectRect.Width / 2);

int objectY = objectRect.Y + (objectRect.Height / 2);

this.Cursor = new Cursor(Cursor.Current.Handle);

Cursor.Position = new Point(Cursor.Position.X - 50, Cursor.Position.Y - 50);

int xX = cu.posX(kaynakBox.Width, objectRect.X, objectRect.Width);

int yY = cu.posY(kaynakBox.Height, objectRect.Y, objectRect.Height);


Back to Top
 Post Reply Post Reply
  Share Topic   
   


Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.