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

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -