How to manipulate lines in a figure using a mouse
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Richa Gupta
2015년 7월 16일
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
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!