[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
New to Octave
From: |
Primictus |
Subject: |
New to Octave |
Date: |
Sun, 24 May 2020 06:19:10 -0500 (CDT) |
I started using Octave yesterday as I saw a blog post here
<https://jasmcole.com/2014/11/01/stereographic-lampshades/> in which
someone uses inverse stereographic projection in MatLab to create a 3d mesh
that can be solidified in blender and 3d printed.
However, I am struggling to figure out how to convert the code to work in
Octave.
*P = imread (pattern3-e1414855483861.png)
P = 1 - im2bw(P); % Cut Black parts
Nmin = min(size(P));
% Crop into square, then circle
P = P(1:Nmin, 1:Nmin);
[xg, yg] = meshgrid(1:Nmin, 1:Nmin);
P((xg - Nmin/2).^2 + (yg - Nmin/2).^2 > 0.99*0.25*Nmin^2) = 0;
% Create a small border
P = padarray(P, [1 1], 0);
CC = bwconncomp(P);
for n = 1:CC.NumObjects
% Create new image for each hole
newP = zeros(size(P));
newP(CC.PixelIdxList{1,n}(:)) = 1;
% Smooth image slightly
newP = filter2(fspecial('average',3),newP);
% Get contour around hole
C = contourc(newP,[1 1]);
end*
I am getting a syntax error near line 7
--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
- New to Octave,
Primictus <=