0

I have a binary image with two regions of interest from which I've derived the centroids. I can plot a line between the two centers easily with line([x1 y1] [x2 y2]) but would like to actually draw this line on an existing image, move on and do further analysis with this line included. There has to be an easy way to do this..?

Thanks

user3470496
  • 141
  • 7
  • 33
  • 2
    Possible duplicate of [How do I create an image matrix with a line drawn in it in MATLAB?](http://stackoverflow.com/questions/1940833/how-do-i-create-an-image-matrix-with-a-line-drawn-in-it-in-matlab) – beaker Jan 19 '16 at 19:19
  • yup, that post solved it, my bad, thanks – user3470496 Jan 21 '16 at 21:14

1 Answers1

0

If you are opening the image in a MATLAB figure and drawing the line, you can save the image (File->Save As...) to a file in a number of different formats like .bmp, .png, etc.

gariepy
  • 3,576
  • 6
  • 21
  • 34
  • 1
    The better (and programmatic) way to do this is to use `print`. (i.e. `print(gcf, 'output.png', '-dpng', '-r300')` – Suever Jan 19 '16 at 19:21