rotation - Emgu CV draw rotated rectangle -
rotation - Emgu CV draw rotated rectangle -
i'm looking few days solution draw rectangle on image frame. i'm using cvinvoke.cvrectangle
method draw rectangle on image because need antialiased rect. problem when need rotate given shape given angle. can't find solution. have tryed draw rectangle on separate frame rotate hole frame , apply new image on top of base of operations frame. in solution there problem antialiasing. it's not working. i'm working on simple application should allow draw few kinds of shape, resize them , rotation given angle. thought how achive this?
you should read opencv documentation.
there rotatedrectangle
class can utilize task. can specify angle rectangle rotated.
here sample code (taken docs) drawing rotated rectangle:
mat image(200, 200, cv_8uc3, scalar(0)); rotatedrect rrect = rotatedrect(point2f(100,100), size2f(100,50), 30); point2f vertices[4]; rrect.points(vertices); (int = 0; < 4; i++) line(image, vertices[i], vertices[(i+1)%4], scalar(0,255,0)); rect brect = rrect.boundingrect(); rectangle(image, brect, scalar(255,0,0)); imshow("rectangles", image); waitkey(0);
here result:
rotation draw shape emgucv angle
Comments
Post a Comment