I am trying to calculate the sum of intensities present in my agarose gel:
I want to compare the intensity of the total white band on the top with that of the one on the bottom. The idea is to binarize the image at a certain threshold and use that matrix (the 1's) to determine the gray scale value at that same index in the original picture. However in order to properly binarize I want to substract the background. As seen over here there is a kind of gradient present. Do you guys have any ideas how to properly identify the background and substract it from the original image.
I now try to cut the image in two parts beforehand (top part and bottom part) then I can neglect the background in a certain way. I use the following code to identify the bands with image
topintens = Import["Image_1"]; topintens = MedianFilter[topintens, 1]; imt = Binarize[TopHatTransform[topintens, 4.09], 0.013]; imtfil = DeleteSmallComponents[imt, 7]
However I then end up with not so smooth bands, I want to apply dilation/erosion in order to make neat bands however this does not work out for me yet:
So tips are welcome