12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- 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;
- namespace bbiwarg.Images
- {
- class EdgeImage
- {
- public Image<Gray, Byte> Image {get; private set;}
- public EdgeImage(DepthImage depthImage) {
- 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());
- }
- }
- }
|