Replacing value in satellite image.

1 vue (au cours des 30 derniers jours)
Le Ngo Huy Phan
Le Ngo Huy Phan le 14 Sep 2020
Commenté : Image Analyst le 14 Sep 2020
Dear,
I have a Satellite image 10980x10980. Some value in this image are 9.3886e+36. I want to replace these pixel with value NaN to compute mean of this Image.
I tried to use img(img==9.3886e+36)=NaN but somehow it is not working at all. I try this with a small matrix 2x8 then it is work but with my image it is not replace anything at all. Can anyone help me to solve this?
Best regards,

Réponse acceptée

Image Analyst
Image Analyst le 14 Sep 2020
Use ismembertol():
badPixels = ismembertol(img, 9.3886e+36, 1e36);
img(badPixels) = nan;
  6 commentaires
Le Ngo Huy Phan
Le Ngo Huy Phan le 14 Sep 2020
Ah yes, thank you. I still wonder why the img(img>=1000)=NaN not working. So strange tho
Image Analyst
Image Analyst le 14 Sep 2020
That would work too. Just look:
img = randi(2000, 8, 6)
img(img>=1000)=NaN
img =
1946 347 1314 745 539 1333
1298 782 1256 397 846 1079
1601 1663 584 980 1096 1397
908 1607 864 679 1886 1334
865 121 31 1904 836 357
1651 799 1969 1841 1967 257
167 1054 335 106 603 1999
267 834 213 1476 1403 343
img =
NaN 347 NaN 745 539 NaN
NaN 782 NaN 397 846 NaN
NaN NaN 584 980 NaN NaN
908 NaN 864 679 NaN NaN
865 121 31 NaN 836 357
NaN 799 NaN NaN NaN 257
167 NaN 335 106 603 NaN
267 834 213 NaN NaN 343

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Image Segmentation and Analysis dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by