123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Drawing;
- namespace bbiwarg.DataSource
- {
- /**
- * Gives access to all important data in depth image coordinates.
- */
- class ImageData
- {
- private DepthImage depthImage;
- private ConfidenceImage confidenceImage;
- private ColorImage colorImage;
- private UVImage uvImage;
- public ImageData(DepthImage depthImage, ConfidenceImage confidenceImage, ColorImage colorImage, UVImage uvImage)
- {
- this.depthImage = depthImage;
- this.confidenceImage = confidenceImage;
- this.colorImage = colorImage;
- this.uvImage = uvImage;
- }
- public int getWidth()
- {
- return depthImage.getWidth();
- }
- public int getHeight()
- {
- return depthImage.getHeight();
- }
- public short getDepth(int x, int y)
- {
- return depthImage.getDepth(x, y);
- }
- public short getConfidence(int x, int y)
- {
- return confidenceImage.getConfidence(x, y);
- }
- public Color getColor(int x, int y)
- {
- float u = uvImage.getU(x, y);
- float v = uvImage.getV(x, y);
- int xInColorImage = (int) u * colorImage.getWidth();
- int yInColorImage = (int) v * colorImage.getHeight();
- return colorImage.getColor(xInColorImage, yInColorImage);
- }
- }
- }
|