How to draw a line on an image in matlab?

后端 未结 6 1420
無奈伤痛
無奈伤痛 2020-12-02 23:48

I have two points lets say:

  • P(x,y) [point lies at the top of image]
  • P\'(x\',y\') [point lies at bottom of image]

Now i want to draw a l

6条回答
  •  广开言路
    2020-12-03 00:13

    Like this:

    figure;
    hold on;
    imagesc(img);
    line([x1,x2],[y1,y2],'Color','r','LineWidth',2)
    hold off
    

    Where y is the "down" direction and x is the "right" direction in the image. Change the color and width as necessary to be visible.

提交回复
热议问题