CPL=CPLcontourc([Inputparameter])
Inputparameter : | exactly the parameter same as contourc |
CPL : | Closed polygon list |
figure; axis off; text(0.5,0.5,'This is a Test', 'FontSize',36)
I=getframe(gcf); I=flipud(I.cdata(:,:,1));
CPLcontourc(I,1);
This function, CPLcontourc
, is designed to convert the output of MATLAB's contourc
command into a Closed Polygon List (CPL) format. It is part of the SG-Library and was created by Tim Lueth in 2017.
contourc
function. It typically includes a matrix of data and optional contour levels.contourc
function with the input parameters. The first parameter is converted to a double precision format using double(varargin{1})
, and any additional parameters are passed as they are.contourc
is stored in the variable C
.CPLofcontourc
is then called with C
and a boolean true
to convert the contour matrix into a Closed Polygon List (CPL).nargout==0
), the function will automatically plot the CPL using the following steps:
SGfigure
to create a new figure.view(0,90)
.axis on
and grid on
.title(titleofcaller)
.CPLplot(CPL,'r.-')
, which uses red color and marks the points with dots.The example provided in the code demonstrates how to use the function:
figure; axis off; text(0.5,0.5,'This is a Test', 'FontSize',36) I=getframe(gcf); I=flipud(I.cdata(:,:,1)); CPLcontourc(I,1);
This example creates a figure with text, captures the frame, processes the image data, and then calls CPLcontourc
to generate and plot the contours.