Image Processing Toolbox: Subtracting 2 images
Mostra commenti meno recenti
Hi everyone! I am working with an image of a cone. Attached:

As you can see, there is a lot of imperfections and I will like to remove them and leave only the black outline of the cone. My first thought was to take the same picture, but without a cone and the substract them. I attach the second image without the cone.

Nevertheless, the operation isnt working as I will expect. The results of the operation are the following, each accounting for different substractions.

In this image imperfections are still present.

And in this image I tried increasing the brightness but didnt work.
Am I thinking the method wrong? Or is there any other better method to process this images?
Thank you in advance!
Risposta accettata
Più risposte (1)
Image Analyst
il 21 Apr 2021
What I'd do is to make a template of the bright spot without the cone. Then determine the means and scale them, then subtract.
% Get the mean of each image.
mean1 = mean(refimage(mask))
mean2 = mean(testImage(mask));
% Scale test image's mean to be the same as the reference image's mean.
testImage = double(testImage) * mean1 / mean2;
% Cast it back to the same image type as refImage.
testImage = cast(testImage, 'like', refimage);
% Now subtract.
subtractionImage = imabsdiff(refImage, testImage);
Now they should subtract much closer to zero than with what you did.
Categorie
Scopri di più su Image Arithmetic in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
