Images and description-

• The images are obtained from the frames of a video (>1000 images)

• As shown, there are contrast variations between the images

• The bubble shifts horizontally within the given cylindrical tube

enter image description here

enter image description here

enter image description here

Final objective-

To extract 2 major features for all images-

• Contact angles with the enclosing cylinder [all possible corners] (red)

• Position of the bubble’s apexes. [all possible sides] (white)

enter image description here

Previously explored directions-

    (*Where "cropped" is the second Image in description*)
     Column[{(componentImg =
         (testImg1 =
         // ImageSubtract[#, LaplacianFilter[#, 1]] &
        // ImageAdjust
       // MorphologicalBinarize[#, {a, 0.5}] &
      // DeleteSmallComponents[#, Method -> "Median"] &
     // Erosion[#, blurradius] &)
  // MorphologicalComponents[#, 0.3] &);


       eachComponent = (ComponentMeasurements[{componentImg, testImg1}, 
          "MaskedImage", #Elongation > elongation &])
     {{a, 0.4389, "Threshold"}, .4, .5},
     {{elongation, .8, "Elongation search"}, .5, 1},
     {{blurradius, 0, "Blur radius"}, 0, 5},
     TrackedSymbols :> {a, elongation, blurradius},
     ContinuousAction -> False,
     ControlPlacement -> Top,
     SaveDefinitions -> True

And got something like this-

enter image description here

But neither could this give me any info on the edge details nor could it be successfully applied for the other two images.

Any help will be greatly appreciated,

Thanks and regards,


  • $\begingroup$ It looks like you have two problems: (1) getting better edge detection; and (2) quantifying the positions of those edges. I don't have an answer, but here's a possible plan of attack. For (1): Search for posts on "EdgeDetect" and "edge detection" and see if any of the approaches there would help. Also, consider different lighting for your bubble chamber, to enhance the appearance of the edges. Perhaps colored lighting would help, in which case you might be able to distinguish the edges by both color and contrast. Continued.... $\endgroup$ – theorist Dec 26 '18 at 21:42
  • $\begingroup$ ...and for (2), search for posts with the terms "ImageValuePositions" or "PixelValuePositions". Once you've enhanced the picture to show the edges, these commands can give you the coordinates the edges span. Then you can perhaps map the coordinates onto functions, thereby quantifying their spatial positions. I don't know if any of the above will actually work but, if you don't eventually get an actual answer from this site, that might be an approach to try. Of course, if you have a Wolfram Service Contract, you could also ask Wolfram Technical Support! $\endgroup$ – theorist Dec 26 '18 at 21:46
  • $\begingroup$ Thanks! I'll definitely look along those directions! $\endgroup$ – Sathvik Ajay Dec 27 '18 at 22:06
  • $\begingroup$ I've found CurvatureFlowFilter to be useful for edge detection in my images, so you could try that. $\endgroup$ – KraZug Dec 28 '18 at 8:20

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.