how to compute min for image with black border?
Show older comments
Hi, I have an image with black border in 2000 * 2000.after using min function the output is 0 or 1.that The minimum is related to border of the image that is black.how to compute min or max other than black border? my code is here.by this code output min is NaN.
img=imread('image.tif');
figure(1),imshow(img),title('original');
[M,N]=size(img);
for i=1:M
for j=1:N
if img(i,j)<1
img(i,j)=NaN;
end
end
end
minofimg=min(min(img));
Accepted Answer
More Answers (0)
Categories
Find more on Image Filtering and Enhancement in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
