I have pictures of the evolution of a splashing droplet, and I would like to get the contour. It´s not difficult for early times (first figure) but I could not find the way for the later times. Any suggestion?

a) For the first (easy job) image I wrote the following code (I use Manipulate to tune Posp, but here I just put the result). These are the pictures at t=40 (left) and t=43 (right), t in arbitrary units:

im40 = Import["https://i.stack.imgur.com/LSYxT.jpg"];
im43 = Import["https://i.stack.imgur.com/7fUMH.jpg"];

center = {238., 176.38};
size = {640, 480};

Filtro2[Posr_] := ColorNegate[Binarize[ColorSeparate[ImageSubtract[im43, im40]][[1]], Posr]]

GetPosition[cd_, Posr_] := Position[ImageData[Thinning[    DeleteSmallComponents[ContourDetect[DeleteSmallComponents[Filtro2[Posr], 30], cd]]]], 1];

cdp = 0.8; Posp = 0.007842;
 GraphicsRow[{Show[im40],Show[im40,ListPlot[Transpose[{GetPosition[cdp, Posp][[All, 2]], size[[2]] - GetPosition[cdp, Posp][[All, 1]]}], Joined -> False,    PlotStyle -> {Green, PointSize[Tiny]}],Graphics[{Red, Point[center]}]], Show[Filtro2[Posp]]}]

Result for early times

b) I am not able to do the same with late figures... Here two figures at two different (close) times (t=120 and 125)

  • $\begingroup$ Thanks Vitaliy, I will improve my entrance right now. $\endgroup$ – Juan Manuel Gomba May 2 '18 at 23:11
  • $\begingroup$ I think the question is now clearer, Vitaliy. $\endgroup$ – Juan Manuel Gomba May 3 '18 at 13:58
  • 1
    $\begingroup$ Have you tried to use an image without any droplet as the background image, instead of subtracting different time steps from each other? Might give you slightly cleaner results to further process $\endgroup$ – Lukas Lang May 3 '18 at 14:25
  • $\begingroup$ Thanks, Mathe172. I tried. In fact I also use Manipulate to select the image I subtract. And things for late times are not easy to handle. This happens because what we see as the contour is a shadow. And as the liquid gets thinner, the shadow gets reduced. $\endgroup$ – Juan Manuel Gomba May 3 '18 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.