フィルターのクリア

how to find the pixel value of an image ?

1 回表示 (過去 30 日間)
Sivakumaran Chandrasekaran
Sivakumaran Chandrasekaran 2012 年 8 月 24 日
コメント済み: Image Analyst 2017 年 10 月 8 日
How to find the following
2) pixel within 5 units (out of 255) of pixel ; 3) pixel within 10 units (out of 255) of pixel ; 4) pixel within 25 units (out of 255) of pixel ; 5) pixel within 50 units (out of 255) of pixel .
I used the code a=imread('cameraman.tif');[r c]=size(a). Then accessed each and every row and column values. Is that right.
  1 件のコメント
Image Analyst
Image Analyst 2012 年 8 月 24 日
No, that's not right.

サインインしてコメントする。

回答 (1 件)

Image Analyst
Image Analyst 2012 年 8 月 24 日
% Specify the pixel value that you want to find intensities around.
targetValue = 173; % Or whatever you want.
% Specify how much intensity around that value do you want to find.
tolerance = 95; % or 10 or 25 or 50 or whatever.
% Get the low and high of that intensity range.
lowValue = uint8(targetValue - tolerance);
highValue = uint8(targetValue + tolerance);
% Get a binary image (like a map) of where are the pixels in range.
pixelsInRange = (grayImage >= lowValue) & (grayImage <= highValue);
  2 件のコメント
sathish kumar rb
sathish kumar rb 2017 年 10 月 8 日
編集済み: Image Analyst 2017 年 10 月 8 日
Where do I read the image in above code?
Is grayImage the image?
Image Analyst
Image Analyst 2017 年 10 月 8 日
grayImage is the image. Usually you get it from reading in some image file with imread():
grayImage = imread(fullFileName);

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Segmentation and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by