1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Emgu.CV;
- using Emgu.CV.Structure;
- using bbiwarg.Detectors.Fingers;
- using System.Diagnostics;
- using bbiwarg.Utility;
- namespace bbiwarg.Images
- {
- class EdgeImage
- {
- public Image<Gray, Byte> Image { get; private set; }
- public EdgeImage(DepthImage depthImage)
- {
- // no more scaling to [0, 255]?
- Image = depthImage.Image.Canny(100, 75, 3);
- }
- public EdgeImage(Image<Gray, Byte> edgeImage)
- {
- Image = edgeImage;
- }
- public bool isEdgeAt(Point point)
- {
- return isEdgeAt(point.X, point.Y);
- }
- public bool isEdgeAt(int x, int y)
- {
- return (Image.Data[y, x, 0] > 0);
- }
- public void removeFingerEdges(Finger finger)
- {
- Point[] polygon = finger.getPolygon();
- Image.FillConvexPoly(polygon, new Gray(0));
- }
- public EdgeImage copy()
- {
- return new EdgeImage(Image.Copy());
- }
- }
- }
|