Log in

View Full Version : Camera Overlay


jon_bui
09-02-2015, 20:35
Anyone know where I can find tutorials for the Microsoft HD camera? My team is trying put an overlay on our driver station image, but we haven't had any luck. We used the Java examples, but we don't know how to change the shapes in the example or the thickness of the lines.

notmattlythgoe
10-02-2015, 14:17
Try something like this:


Rect square = new Rect();
square.left = (int)tote.BoundingRectLeft;
square.top = (int)tote.BoundingRectTop;
square.height = (int)(tote.BoundingRectBottom - tote.BoundingRectTop);
square.width = (int)(tote.BoundingRectRight - tote.BoundingRectLeft);

Rect dot = new Rect();
dot.left = (int)((tote.BoundingRectRight + tote.BoundingRectLeft) / 2);
dot.top = (int)((tote.BoundingRectTop + tote.BoundingRectBottom) / 2);
dot.height = 5;
dot.width = 5;

NIVision.imaqDrawShapeOnImage(destinationImage, sourceImage, square, DrawMode.DRAW_VALUE, ShapeMode.SHAPE_RECT, 1);
NIVision.imaqDrawShapeOnImage(destinationImage, sourceImage, dot, DrawMode.PAINT_VALUE, ShapeMode.SHAPE_OVAL, 5);


The last parameter in each of the NIVision method calls is the thickness.