how to assign a range of pixel for pixel intensity

4 ビュー (過去 30 日間)
suzwani ismail
suzwani ismail 2018 年 6 月 1 日
I have a 578x50 image. I want to process a range of pixel intensities let say pixel 386 until 409 for column and pixel 2 until 49 for row. When I assign that range of pixels like this:
for c = 386:409
for r = 2:49
central_pixel(r,c) = I(r,c);
centralPixel = double(central_pixel);
if centralPixel(r,c) >= 0
central_pixel(r,c) = I(r,c);
centralPixel = double(centralPixel);
else
centralPixel = NaN;
end
end
end
the output of c = 409 and r = 49 in workspace. While the output of centralPixel display pixel intensity for 386th until 409th pixel while 0 for 1st until 385th pixel. How can I fix this? I just want to display only pixel intensity of 386th until 409th pixel for column and 2nd until 49th pixel for row. Please help. Thanks in advance

回答 (0 件)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by