Azzera filtri
Azzera filtri

Assigning pixels a negative value

2 visualizzazioni (ultimi 30 giorni)
med-sweng
med-sweng il 15 Feb 2014
Commentato: Image Analyst il 16 Feb 2014
Using some criterion, there are some pixels in the image which I'm not interested in. So, I would like to neglect them. I just want to ask if the approach I have followed is acceptable. I have assigned such pixels a negative value. Would that be acceptable? And, what does it mean when a pixel has a negative value? Will it have some representation on the image?
Thanks.

Risposte (2)

Image Analyst
Image Analyst il 15 Feb 2014
That's not how it's done by the vast majority of people. Almost always you create a separate binary (logical) mask that defines what part of the image is to be processed or not processed. See my Image Segmentation Tutorial BlobsDemo for an example.
  1 Commento
Image Analyst
Image Analyst il 16 Feb 2014
Regarding your edit - not sure what's changed or stayed the same. What you say can work but the question is how do you ignore the negative pixels? If you threshold them, like
if grayImage < 0
then you're essentially thresholding them. You can do it on a pixel-by-pixel basis with nested for loops but it's more efficient to just do it in one line to create a binary image, which is why virtually everyone does it that way.
I don't know what you mean by "some representation on the image". Of course the pixels are there , and you can see them if you use [] in imshow(grayImage, []), so I don't really understand what this question is asking.

Accedi per commentare.


Azzi Abdelmalek
Azzi Abdelmalek il 15 Feb 2014
Modificato: Azzi Abdelmalek il 15 Feb 2014
The pixels are not rejected, they just have the same color

Categorie

Scopri di più su Image Processing Toolbox in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by