Message Boards Message Boards

1
|
1532 Views
|
0 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Error between outer boundary and the one by Fourier technician of an image?

Posted 2 years ago

I took an image from a computer by referring to a video of a mathematician on YouTube and found the outer edge based on the original image below.

img = Import[...]

img = Binarize[img~ColorConvert~"Grayscale"~ImageResize~500~Blur~3];


pts = DeleteDuplicates@
   Cases[Normal@
      ListContourPlot[Reverse@ImageData[img], 
       Contours -> {0.5}], _Line, -1][[1, 1]];

center = Mean@MinMax[pts] & /@ Transpose@pts;

pts = # - center & /@ pts[[;; ;; 20]];

potholePlot = ListPlot[pts, AspectRatio -> Automatic]


SetAttributes[toPt, Listable]
toPt[z_] := ComplexExpand[{Re@z, Im@z}] // Chop;

cf = Compile[{{z, _Complex, 1}}, 
   Module[{n = Length@z}, 
    1/n*Table[Sum[z[[k]]*Exp[-I*i*k*2 Pi/n], {k, 1, n}], {i, -m, m}]]];

z = pts[[All, 1]] + I*pts[[All, 2]];

m = 50;

cn = cf[z];

{f[t_], g[t_]} = 
  Sum[cn[[j]]*Exp[I*(j - m - 1)*t], {j, 1, 2 m + 1}] // toPt;


ParametricPlot[{f[t], g[t]}, {t, 0, 2 Pi}, AspectRatio -> Automatic]

The picture is the original image of the pothole.

enter image description here

I'm curious how to find the error between the exterior of the original pothole image and the exterior of the image obtained by Fourier technician, how can I get it? Even if I look for reference materials, I don't have the data I want.

I wonder if there's a way to find an error by overlapping the edges.

Please. Thank you.

POSTED BY: Arim Gwon
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract