MATLAB Answers

How to manipulate lines in a figure using a mouse

조회 수: 1(최근 30일)
Morris Vanegas
Morris Vanegas 14 Jul 2015
Answered: Richa Gupta 16 Jul 2015
I have a line that is detecting an edge of a grayscale image in the form of two row vectors of length almost 2000. I overlay this line on the image, and want to manually adjust certain points with my mouse for a better fit. Currently, I am using ginput() to obtain the x,y position of my mouse when I click, find the corresponding index on my two vectors, define three points (a few indices before and after the point I clicked on), and am using splice() on these three points to create a new line. This, however, only creates a spike at the location where the mouse click was. I would rather it slowly smooth up from a predefined distance (or sensitivity) away from where I clicked.
In the attached image, the purple line is the edge detected. The blue asterisk is where I clicked, and the orange segment is the splice of three points: The ends of the orange line and the blue asterisk. How can I make this orange line fit more of a smooth curve?
Thanks!

  댓글 수: 0

로그인 to comment.

답변 수 (1)

Richa Gupta
Richa Gupta 16 Jul 2015
Hi Morris,
It looks like the image that you attached did not come through. Also, can you describe what your “splice” function does because I was not able to find this function in the MATLAB built-in functions list. It would be easier for the community to help if you can provide the image and the description of the 'splice' function.
Richa

  댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by