In MATLAB’s Image Processing Toolbox there’s the improfile function that returns the intensity profile of an image from underneath a line defined by two points.
Is there a writing equivalent of this function? That is, I would like to pass two points (to specify a line) and a vector of pixel values to replace a bunch of pixels underneath the line.
I’ve done basically what Ghaul suggested, but replaced
imline()with manually finding underlying pixels. The advantage is that a figure is not shown which brings some speed benefits (~0.5s in my tests);