Ask Your Question
0

Hand Drawing Shape OpenCV/Canvas (HELP!)

asked 2018-03-26 03:30:53 -0600

daianne000 gravatar image

Hello guys!

I am a student and all the help I can have are really appreciated! <3 My first target is to create a canvas, wherein I can draw shape manually. (Pentagon, hexagon, square, arrow, etc) I don’t want to draw the shape as solid one but I want to do it manually. Easy right? I can just use the canvas with that. But my problem lies here, After or during (I am not sure yet if which is better) drawing, (for example I am going to draw pentagon, ang my drawing is a bit squimsy, or to pointy something like that), I want to make the drawing smooth making it like I’ve drawn a solid shape. (meaning correcting the hand drawn shape/detecting what shape is that and recreating a good shape unlike the squimsy drawing) How can I do that? What I’ve conclude is this: ( but this is after drawing all the shape, but i’m not sure how to detect if the drawing is finished yet)

  1. get the shape (know what kind of shape is that, i know OpenCV can do that)
  2. get the height/radius/width (all requirements to be considered in the shape)
  3. then redraw the shape (getting the max height as the basis of the size if the shape)

Is this good? But I am not sure on how to use OpenCV on web. As well as I want to re-shape the drawing during the drawing. Not after. And when I do this the web needs to be refreshed everytime right? Do you have any points/idea/suggestion on how could I do this?

Thank you and I hope you could help me with this. Lovelots!

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2018-03-26 07:08:40 -0600

Well let me conclude

  1. Yes your approach seems valid and will probably work.
  2. For using OpenCV on the web, you will need to use the javascript interface, which is pretty new. There is not that many functionality wrapped so you might hit some bumps there.
  3. And you will always have to wait to reshape until a user stopped drawing, else you will have an endless moving shape.
edit flag offensive delete link more

Comments

Thank you for your comment. How should i know if the user has stop drawing? mouseUp? I want to something like this. If I do the ways I described, do you think it's fast? Or slow? I am bothered if this approach is a bit slow.

daianne000 gravatar imagedaianne000 ( 2018-03-26 21:29:07 -0600 )edit

I would indeed ask feedback from the mouse 😉

StevenPuttemans gravatar imageStevenPuttemans ( 2018-03-27 00:51:44 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-03-26 03:30:53 -0600

Seen: 291 times

Last updated: Mar 26 '18