https://github.com/mattools/polynomialcurves
Representation of smooth curves using polynomial-based parameterisations
https://github.com/mattools/polynomialcurves
Last synced: 10 months ago
JSON representation
Representation of smooth curves using polynomial-based parameterisations
- Host: GitHub
- URL: https://github.com/mattools/polynomialcurves
- Owner: mattools
- Created: 2022-02-16T12:28:36.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-18T11:02:44.000Z (about 4 years ago)
- Last Synced: 2023-03-01T14:26:31.677Z (about 3 years ago)
- Language: MATLAB
- Size: 36.1 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Polynomial Curves
Manipulation of smooth curves with Matlab, by considering a polynomial for each coordinate.
Requires the MatGeom toolbox.
Please note that the project is no longer maintained.
## Installation
First download or clone the project.
To install the library, you simply need to add the path to the main directory of the library :
>> addPath('basePath/polynomialCurves2d');
## Quick example
The package was originally designed to simplify and smooth the display of skeletons as obtained from binary images.
Let us start by computing the skeleton of a binary image (image is provided with Matlab).
% Fit a set of curves to a binary skeleton
img = imread('circles.png');
% compute skeleton, and ensure one-pixel thickness
skel = bwmorph(img, 'skel', 'Inf');
skel = bwmorph(skel, 'shrink');
figure; imshow(skel==0)

From the skeleton image, it is possible to compute a series of polynomial curves.
The result is given as a cell array, each cell containing the data for a single curve.
% compute coeff of each individual branch
coeffs = polynomialCurveSetFit(skel, 2);
% Display segmented image
figure; imshow(~img); hold on;
% overlay curves
for i = 1:length(coeffs)
hc = drawPolynomialCurve([0 1], coeffs{i});
set(hc, 'linewidth', 2, 'color', 'g');
end
