Syntax
PL=PLofimcontourc(I,[cent,pixs])
Input Parameter
I : | | Image |
cent : | | true= image origin is in center; default is false |
pixs : | | size of a pixel; default is [1 1] |
Output Parameter
PL : | | Coordinate list of contour centers |
Examples
I=imageofVLprojection(VL,[100 100],[0 -100 0],[0 100 0],4);
PLofimcontourc(I,true,1/4)
Copyright 2017-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth
Algorithm (Workflow)
This function, PLofimcontourc
, processes an image to return the centers of pixel coordinates in the form of a coordinate list of contour centers. It is part of the SG-Library and was developed by Tim Lueth.
Input Parameters
- I: The input image to be processed.
- cent: A boolean indicating if the image origin is at the center. Default is
false
.
- pixs: The size of a pixel, defaulting to
[1 1]
. If a scalar is provided, it is expanded to a two-element vector.
Output
- PL: A list of coordinates representing the centers of contours in the image.
Algorithm Steps
- Initialize
cent
to false
and pixs
to [1 1]
unless specified in varargin
.
- If
pixs
is a scalar, convert it to a two-element vector.
- Call
CPLcontourc
with the image I
to get contour lines.
- Use
centerCPL
to find the center of these contour lines.
- Adjust the y-coordinates by flipping them and shifting by the image height.
- Offset the x-coordinates by -1.
- If
cent
is true, adjust the coordinates to center the image.
- Scale the coordinates by the pixel size
pixs
.
- If no output is requested, display the image and plot the contour centers using
SGfigure
and PLplot
.
Algorithm explaination created using ChatGPT on 2025-08-19 01:25. (Please note: No guarantee for the correctness of this explanation)
Last html export of this page out of FM database by TL: 2025-09-21