Image Processing Toolbox: Subtracting 2 images
古いコメントを表示
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!
採用された回答
その他の回答 (1 件)
Image Analyst
2021 年 4 月 21 日
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.
1 件のコメント
Urbano Alfonso Medina Martinez
2021 年 4 月 21 日
カテゴリ
ヘルプ センター および File Exchange で Image Arithmetic についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
