# Image Processing: Detecting certain edge features over varying contrasts

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

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)

Previously explored directions-

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

testImg1,

eachComponent = (ComponentMeasurements[{componentImg, testImg1},
}],
{{a, 0.4389, "Threshold"}, .4, .5},
{{elongation, .8, "Elongation search"}, .5, 1},
ContinuousAction -> False,
ControlPlacement -> Top,
SaveDefinitions -> True
]


And got something like this-

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,

Sathvik

• 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.... – theorist Dec 26 '18 at 21:42
• ...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! – theorist Dec 26 '18 at 21:46
• Thanks! I'll definitely look along those directions! – Sathvik Iyengar Dec 27 '18 at 22:06
• I've found CurvatureFlowFilter to be useful for edge detection in my images, so you could try that. – KraZug Dec 28 '18 at 8:20