How to separate darkest and brightest pixel in an image with a threshold value
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi all..i just want to separate dark and bright pixels from an image with a fixed threshold value 0.5.can any one suggest me how to do this..Thanks in advance....
1 commentaire
Adam Danz
le 28 Jan 2020
Sounds like you're dealing with a grayscale image. After you read it in you should have a matrix of values between 0 and 1. Use logical operators to determine which values are above/below threshold.
Réponses (1)
Image Analyst
le 28 Jan 2020
What does "separate" mean to you?
You can create a binary image (mask) for dark pixels like this
darkPixels = grayImage < 0.5;
brightPixels = grayImage >= 0.5; % or brightPixels = ~darkPixels
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!