필터 지우기
필터 지우기

How to plot a point 300 pixels to the right in an image?

조회 수: 2 (최근 30일)
Sean
Sean 2015년 2월 23일
편집: Sean 2015년 2월 23일
So I've a variable created called 'J' which is situated at a certain point in the image, how do I plot it 300 pixels to the right of the point its situated? it seems to be moving along the wrong axis when Im trying to move it rightwards.

답변 (1개)

Image Analyst
Image Analyst 2015년 2월 23일
What is J? I'll assume it's a 1 by 2 array with the x (column) coordinate, followed by the y (row) coordinate. Then to plot 300 columns to the right, do
plot(J(1)+300, J(2), 'r*', 'MarkerSize', 20, 'LineWidth', 2);
Make sure you're not making the very common mistake of mixing up x,y with row, column - that's almost certainly what you're doing. Remember images take indexes of (row, column) which is (y, x) while plot() takes (x,y) which is (column, row). Make sure you get it straight - like I said, this is a very common error.
  댓글 수: 7
Sean
Sean 2015년 2월 23일
편집: Sean 2015년 2월 23일
I've used the command
J=mean(fit);
to create the midpoint for the blue line, however when I go to plot it, it is situated at the very beginning of the blue line, therefore I was trying to move 'J' to the very centre of the picture by adding 512 to it. Is there a better way to create the midpoint for the blue line (sfit)? since I don't know its x coorrdinate ?
Sean
Sean 2015년 2월 23일
편집: Sean 2015년 2월 23일
For example, See J plotted as the blue star. I'm looking to get the centre of the line or midpoint. Thanks also for the help!

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Fit Postprocessing에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by