Assigning pixels a negative value

1 次查看(过去 30 天)
med-sweng
med-sweng 2014-2-15
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.

回答(2 个)

Image Analyst
Image Analyst 2014-2-15
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 个评论
Image Analyst
Image Analyst 2014-2-16
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.

请先登录,再进行评论。


Azzi Abdelmalek
Azzi Abdelmalek 2014-2-15
编辑:Azzi Abdelmalek 2014-2-15
The pixels are not rejected, they just have the same color

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by