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?