PLofimcontourc

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - PL/Point Lists
Introduced first in SolidGeometry 3.8, Creation date: 2017-05-14, Last change: 2025-09-14

returns the centers of pixel coordinates in an image



See Also: CPLcontourc

Example Illustration

 missing image of PLofimcontourc(I,cent,pixs)

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

Output

Algorithm Steps

  1. Initialize cent to false and pixs to [1 1] unless specified in varargin.
  2. If pixs is a scalar, convert it to a two-element vector.
  3. Call CPLcontourc with the image I to get contour lines.
  4. Use centerCPL to find the center of these contour lines.
  5. Adjust the y-coordinates by flipping them and shifting by the image height.
  6. Offset the x-coordinates by -1.
  7. If cent is true, adjust the coordinates to center the image.
  8. Scale the coordinates by the pixel size pixs.
  9. 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