フィルターのクリア

how to use the regionprops max(area)?

2 ビュー (過去 30 日間)
tsai kai shung
tsai kai shung 2017 年 10 月 30 日
if true
clear all;
clc;
img = imread('40.jpg');
tic
I = rgb2hsv(img);
channel1Min = 0.956; channel1Max = 0.006;
channel2Min = 0.594; channel2Max = 0.886;
channel3Min = 0.529; channel3Max = 0.780;
sliderBW = (I(:,:,1) >= channel1Min ) | (I(:,:,1) <= channel1Max) &(I(:,:,2) >= channel2Min ) & (I(:,:,2) <= channel2Max) & (I(:,:,3) >= channel3Min ) & (I(:,:,3) <= channel3Max);
BW = sliderBW;
bw3 = areaimg(BW);
%bw3 = ratioimg(bw3);
imshow(bw3);
S = regionprops(bw3,'BoundingBox','Area');
BW_2 = imcrop(img,[S.BoundingBox(1,:)]);
imshow(BW_2);
end
i want to crop the max(area) image but show the error:
Expected one output from a curly brace or dot indexing expression, but there were 5 results.
Error in numbertestok (line 22) BW_2 = imcrop(img,[S.BoundingBox(1,:)]);
how to use the max area as i want to extract the image

回答 (0 件)

カテゴリ

Help Center および File Exchange图像 についてさらに検索

Community Treasure Hunt

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

Start Hunting!