How to separate darkest and brightest pixel in an image with a threshold value

2 vues (au cours des 30 derniers jours)
Sabari G
Sabari G le 28 Jan 2020
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
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.

Connectez-vous pour commenter.

Réponses (1)

Image Analyst
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
Make sure you run through my Image Segmentation Tutorial.

Community Treasure Hunt

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

Start Hunting!

Translated by