필터 지우기
필터 지우기

Find mid position value

조회 수: 3 (최근 30일)
Sajid Rahim
Sajid Rahim 2017년 9월 20일
답변: KSSV 2017년 9월 21일
Plz help me
How i find the mid position in x y values.
this is my code
clear all;
[filename pathname]=uigetfile('*.jpg;*.png;*.tif;*.tiff;*.gif;*.bmp;');
inputimage=imread([pathname filename]);
I=inputimage;
% I = imread('5.png') ;
I = rgb2gray(I) ;
[y,x] = find(I) ;
figure
imshow(I)
hold on
plot(x,y,'.b')
% x
% y
% z=(y+x)/2
% plot(z,'.r')
plot(x(1),y(1),'*y')
plot(x(end),y(end),'*y')
%
line([x(1),0],[y(1), 0])
line([x(end),0],[y(end), 0])
figure(1);line([0 1],[0 1]);
  댓글 수: 2
Rik
Rik 2017년 9월 20일
What do you mean with midpoint? There are several options of what you could mean.
Also, use the {}Code button for proper markup of your code. It vastly increases the readability of your question, increasing the chance that someone is going to read it.
KSSV
KSSV 2017년 9월 20일
You need to find the coordinates of full blue line and then find the mid point....this is the second time you posed the same question. Attach your original image with only blue line.

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

채택된 답변

KSSV
KSSV 2017년 9월 21일
Let 2.png be your image.
I = imread('2.png') ;
I = rgb2gray(I) ;
[y,x] = find(I) ;
% Mid position
mpx = mean(x) ;
mpy = mean(y) ;
imshow(I) ;
hold on
plot(mpx,mpy,'*b')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by