I am trying to extract the data of the closed curve from a black and white image.
But the coordinates of the curve I extraced are wrong, as seen in my result .
For example, the x-coordinate of my result ranges from -150 to 0, which is different from the true range, i.e., -6 to 6.
I found some very useful discussions here about extracting data from images.
However, when I tried to apply the techniques discussed to extract data from a black and white image, the results were incorrect.
Here is my naive try. Where did I go wrong?
It seems I didn't find a correct transformation?
Any suggestions? Thank you.
imgImport = Import["https://i.sstatic.net/c0KCa.png"];
img = ImageTake[imgImport, {55, 286}, {125, 469}]
cor = ImageValuePositions[img, {0., 0., 0.}];
{o, x, y} = {{6.56169201921564`,
22.11360816415005`}, {28.934949660676992`,
5.2325141690732515`}, {6.679185088841892`, 6.554693779835269`}};
trans = FindGeometricTransform[{o, y}, {{-6, -14}, {-6, 16}}][[2]];
ListPlot[trans /@ cor]
img
withListPlot
? $\endgroup$img
withListPlot
:) $\endgroup$-150
to0
, which is different from the true range, i.e.,-6
to6
. $\endgroup$