33 #import "ImageDisplay+withContext.h" 40 + (void)displayLineWithContext:(CGContextRef)context :(
std::vector<
vpImagePoint>)polygon :(UIColor*)color :(
int)tickness
43 CGContextSetLineWidth(context, tickness);
44 CGContextSetStrokeColorWithColor(context, [color CGColor]);
45 for (
size_t j = 0; j < polygon.size(); j++) {
47 CGContextMoveToPoint(context, polygon[j].get_u(), polygon[j].get_v());
48 CGContextAddLineToPoint(context, polygon[(j+1)%polygon.size()].get_u(), polygon[(j+1)%polygon.size()].get_v());
50 CGContextStrokePath(context);
63 :(
double) size :(
int)tickness
81 CGContextSetLineWidth(context, tickness);
82 CGContextSetStrokeColorWithColor(context, [[UIColor redColor] CGColor]);
83 CGContextMoveToPoint(context, ipo.
get_u(), ipo.
get_v());
84 CGContextAddLineToPoint(context, ip1.
get_u(), ip1.
get_v());
85 CGContextStrokePath(context);
89 context = UIGraphicsGetCurrentContext();
90 CGContextSetLineWidth(context, tickness);
91 CGContextSetStrokeColorWithColor(context, [[UIColor greenColor] CGColor]);
92 CGContextMoveToPoint(context, ipo.
get_u(), ipo.
get_v());
93 CGContextAddLineToPoint(context, ip1.
get_u(), ip1.
get_v());
94 CGContextStrokePath(context);
98 context = UIGraphicsGetCurrentContext();
99 CGContextSetLineWidth(context, tickness);
100 CGContextSetStrokeColorWithColor(context, [[UIColor blueColor] CGColor]);
101 CGContextMoveToPoint(context, ipo.
get_u(), ipo.
get_v());
102 CGContextAddLineToPoint(context, ip1.
get_u(), ip1.
get_v());
103 CGContextStrokePath(context);
110 + (void)displayText:(NSString*)text :(
double)x :(
double)y :(
int)width :(
int)height :(UIColor*)color :(UIColor*)bgColor{
112 CGRect rect = CGRectMake(x,y,width,height);
114 NSDictionary *attributes =
116 NSForegroundColorAttributeName : color,
117 NSFontAttributeName : [UIFont boldSystemFontOfSize:50],
118 NSBackgroundColorAttributeName: bgColor
121 [text drawInRect:CGRectIntegral(rect) withAttributes:attributes];
Implementation of an homogeneous matrix and operations on such kind of matrices.
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
void track(const vpHomogeneousMatrix &cMo)
Class that defines what is a point.
Generic class defining intrinsic camera parameters.
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...