필터 지우기
필터 지우기

Finding coordinates of a rectangle in a picture

조회 수: 14 (최근 30일)
Alice
Alice 2016년 10월 3일
답변: Mihaela Duta 2016년 10월 11일
I'm running an eyetracking experiment. I display an image using the Screen function from psychtoolbox and I want to know the coordinates of some of the items displayed in the picture. Is there a way of drawing a rectangle on the positions you want to find the location of? Or is there another way of doing it? Thanks.

답변 (3개)

KSSV
KSSV 2016년 10월 3일
You can draw rectangle using imrect.
doc imrect.
You can interactively pick the coordinates from the plot/ figure using ginput().
doc ginput.
  댓글 수: 6
Alice
Alice 2016년 10월 4일
What do the x and y coordinates that you get from ginput relate to? Are they pixels, or are they just coordinates on an arbitrary scale?
KSSV
KSSV 2016년 10월 4일
They are the coordinates/ locations where you have clicked.

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


Ann G
Ann G 2016년 10월 3일
You can use the ginput and save the coordinates x,y by choosing the items.
[x,y]=ginput;
save x
save y

Mihaela Duta
Mihaela Duta 2016년 10월 11일
편집: Mihaela Duta 2016년 10월 11일
I would suggest to use an image processing package to identify the areas of interest in your picture. You can use Adobe Photoshop if you have it, but gimp is an excellent free alternative (https://www.gimp.org/).
I am not sure whether you want to use these regions of interest when displaying the picture during the experiment, or for data processing. If you want to highlight regions of interest during the stimuli presentation, you can do that using the FrameRect function from Psychtoolbox.

카테고리

Help CenterFile Exchange에서 Image display and manipulation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by