Finding 'Zoomed' coordinates in an image

조회 수: 2 (최근 30일)
Harshil Patel
Harshil Patel 2016년 2월 29일
편집: Harshil Patel 2016년 3월 1일
Hello,
I have a BW image as shown below on which some points are marked.
I want to write a code to zoom into the image so that the image and these points look like the one shown below:
After zooming, the coordinates of these points would have changed in the displayed image.
My question is, how to find these final coordinates after zooming?
Thanking You, Harshil

답변 (1개)

Image Analyst
Image Analyst 2016년 2월 29일
When you plotted the magenta + symbols with plot, you used plot(x,y,'m+'). The position of the symbols on your screen change but the x and y do not. So if you plotted a blue circle at the same x and y, plot(x, y, 'bo'), it would show up at the very same location as the magenta plus signs.
See attached demo for zooming and scrolling via a scroll panel.
  댓글 수: 3
Image Analyst
Image Analyst 2016년 2월 29일
I guess you'd crop out the image from the bounding box of the salient points, and then run SURF again on the cropped image to get the new coordinates in the new cropped image.
Harshil Patel
Harshil Patel 2016년 3월 1일
편집: Harshil Patel 2016년 3월 1일
Thank you! This worked partially! So what I did was following:
1. Found SURF points for the initial image (call it Image A).
2. Made a bounding box around the object.
3. Cropped the image with the bounding box as the boundary (using imcrop). Due to this, the size of the image drops from 1280 x 720 to 700 x 500 or something.
4. Resized the image to 1280 x 720 using imresize (call this Image B).
5. Run SURF again on Image B. Points obtained are as follows:
As you can see, the POINTS (I am not talking about coordinates) I obtain from Image B are not the same points as the ones in Image A.
It should seem like I am zooming along the principal axis; size of the image should not change, the POINTS should not change, just the COORDINATES of those points should change.
Harshil

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

카테고리

Help CenterFile Exchange에서 Data Exploration에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by