Active Figure Zoom for Selecting Points

버전 1.1.0.0 (8.29 KB) 작성자: Tristan Ursell
Select points at a user-specified zoom level that moves around the image as you click.
다운로드 수: 1.5K
업데이트 날짜: 2013/11/8

라이선스 보기

Tristan Ursell
November 2013
Active zoom for polyline selection.

[X,Y]=getline_zoom(Im1);
[X,Y]=getline_zoom(Im1,'plot');
[X,Y]=getline_zoom(Im1,'loop_path');
[X,Y]=getline_zoom(Im1,'stationary');
[X,Y]=getline_zoom(Im1,'interp',res);
[X,Y]=getline_zoom(Im1,'interp',res,'method',mt1);

Have you ever wanted to carefully select points from an image but could not get close enough to see where you wanted to select? Have you ever wanted to create a smooth, evenly spaced set of parametric contour points from a minimum of user-selected points? Then this function is for you -- it allows the user to select points from an image at a user specified zoom level that moves along with the points selected in a centered frame of reference. The resulting contour can then be interpolated to constant arc-length resolution, smoothed, and even closed into a loop.

Im1 is the input image (matrix) from which points will be selected.

The optional parameter 'interp' creates evenly spaced X Y points with the resolution 'res', where res = 1, will space the X,Y points one pixel apart in arc length. The secondary option 'method' selects between a 'linear' and 'spline' interpolation, the latter being a differentially smooth curve. The default method is 'linear'.

The optional parameter 'loop_path' will loop the path so that the last point is the same as the first point. If the method is 'spline', then the looped path will also be smoothed such that the derivatives match at the beginning and ending points.

The optional parameter 'stationary' will keep the zoom and image position fixed, but all other options will be active.

Hold 'shift' or 'control' and then click to end polyline selection.

This script requires the 'ginput' function.

This script will generate its own figure handle.

SEE ALSO: getpts, getline, getrect, zoom

Credit to John D'Errico for writing the useful 'interparc' function included within this function.

Example:

Im1=imread('rice.png');

[X0,Y0] = getline_zoom(Im1,'plot');
[X1,Y1] = getline_zoom(Im1,'plot','interp',0.5,'method','spline');
[X2,Y2] = getline_zoom(Im1,'plot','interp',0.5,'method','spline','loop_path');

인용 양식

Tristan Ursell (2024). Active Figure Zoom for Selecting Points (https://www.mathworks.com/matlabcentral/fileexchange/38959-active-figure-zoom-for-selecting-points), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2012a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Visual Exploration에 대해 자세히 알아보기
도움

받음: interparc

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.1.0.0

added smoothing, looping, fixed resolution, and other improvements.

1.0.0.0