So I got some kind of cross section picture in jpg format I want to work with. For better understanding I just drew a picture, hopefully symbolising well enough kinda how the real pictures will look like:
At the top of the picture is material A, at the bottom material B.
Goal: I want to get the Pixels of the boundary line between both materials.
My way so far:
- I already know how to read pictures with package called
EBImage
- I also know, that this will result in a matrix with a color value for every pixel.
- I thought it would be better to convert the jpeg into a binary picture with only black and white colors.
- I thought filling up the black part below (Material B) and reducing the noise would be nice, so I could use column sums (a sum of 1's) to find the row number where material A touches material B, which should be my searched boundary line (right?).
Problems:
- I don't find filters which fill up the black parts intelligently, in the real pictures, there will be much more noise, which will complicate things even further...
- I am not sure if all this is even necessary, and there is a more efficient way to reach my goal of finding the boundary line
Thank you very much for every tip in advance!