Image processing and edge recognition

I would like to distinguish the phases in a multiphase flow which is quite simple using Mathematica functions with a rough approach. However, in my case it is also about recognizing the structure of a multiphase flow. At this moment, from the image as follows:

original.jpg

I use;

A=file;

2 A - CurvatureFlowFilter[A, 5] (*To obtain increased sharpness*);

ColorConvert[%, "Grayscale"];

CurvatureFlowFilter[%, 1];

Binarize[%];

ColorReplace[%, {White -> Black, Black -> White}];

FillingTransform[%];

Erosion[%, 0.1];

in output it can be seen that volume can be distinguished but shape is not as in original file.

last.jpg

I know I could use a Gauss filter to blur the background, but I feel like I should be sharpening the image and not trying for blur- the structure will be fudged in its shape.

Do you have any ideas for improving the image analysis for bubble shape ?

original.pdf (11.9 KB)

Do you have any ideas for improving the image analysis for bubble shape ?

Cezary,

I guess the basic problem is the really low resolution of your image:

ImageDimensions[img0 = First@Import["original.pdf", "EmbeddedImages"][1]]
(*   Out:   {17,256}   *)

BTW: A probably equivalent result can be achieved somewhat more simple like so:

FillingTransform@ColorNegate@Binarize[img0]

Dear Henrik,
thank you for your reply, indeed these commands work similarly. In case you can clearly see the shape in the original file I thought that despite only 33px width I was somehow able to increase the quality of the output file- especially since after filtering the image is quite sharp with a clear contour of the interface.