31 #import "ImageDisplayWithContext.h"
38 + (void)displayLineWithContext:(CGContextRef)context :(std::vector<
vpImagePoint>)polygon :(UIColor*)color :(
int)tickness
41 CGContextSetLineWidth(context, tickness);
42 CGContextSetStrokeColorWithColor(context, [color CGColor]);
43 for (
size_t j = 0; j < polygon.size(); j++) {
45 CGContextMoveToPoint(context, polygon[j].get_u(), polygon[j].get_v());
46 CGContextAddLineToPoint(context, polygon[(j+1)%polygon.size()].get_u(), polygon[(j+1)%polygon.size()].get_v());
48 CGContextStrokePath(context);
61 :(
double) size :(
int)tickness
79 CGContextSetLineWidth(context, tickness);
80 CGContextSetStrokeColorWithColor(context, [[UIColor redColor] CGColor]);
81 CGContextMoveToPoint(context, ipo.
get_u(), ipo.
get_v());
82 CGContextAddLineToPoint(context, ip1.
get_u(), ip1.
get_v());
83 CGContextStrokePath(context);
87 context = UIGraphicsGetCurrentContext();
88 CGContextSetLineWidth(context, tickness);
89 CGContextSetStrokeColorWithColor(context, [[UIColor greenColor] CGColor]);
90 CGContextMoveToPoint(context, ipo.
get_u(), ipo.
get_v());
91 CGContextAddLineToPoint(context, ip1.
get_u(), ip1.
get_v());
92 CGContextStrokePath(context);
96 context = UIGraphicsGetCurrentContext();
97 CGContextSetLineWidth(context, tickness);
98 CGContextSetStrokeColorWithColor(context, [[UIColor blueColor] CGColor]);
99 CGContextMoveToPoint(context, ipo.
get_u(), ipo.
get_v());
100 CGContextAddLineToPoint(context, ip1.
get_u(), ip1.
get_v());
101 CGContextStrokePath(context);
108 + (void)displayText:(NSString*)text :(
double)x :(
double)y :(
int)width :(
int)height :(UIColor*)color :(UIColor*)bgColor{
110 CGRect rect = CGRectMake(x,y,width,height);
112 NSDictionary *attributes =
114 NSForegroundColorAttributeName : color,
115 NSFontAttributeName : [UIFont boldSystemFontOfSize:50],
116 NSBackgroundColorAttributeName: bgColor
119 [text drawInRect:CGRectIntegral(rect) withAttributes:attributes];
Generic class defining intrinsic camera parameters.
Implementation of an homogeneous matrix and operations on such kind of matrices.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Class that defines a 3D point in the object frame and allows forward projection of a 3D point in the ...