i want to make a filter that will eliminate pixel value less than 200 and then add the values of all pixel greater than 200

3 次查看(过去 30 天)
clc
clear all
I = imread('saif1.jpg');
J = rgb2gray(I);
figure, imshow(I), figure, imshow(J);
  6 个评论
Image Analyst
Image Analyst 2020-8-28
You can change a pixel value in an image to some other value, but you cannot eliminate the pixel because matrices must remain rectangular, not have ragged edges like if you eliminate the pixel and shift all other pixels in the line or column over.

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2020-1-29
Try
mask = J > 200; % Map of where the image is 201 or greater.
theSum = sum(J(mask))

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by