help with image threshold using bioformats
古いコメントを表示
Hi folks,
I am reading non-standard image files (not jpeg, png etc) into matlab, then using matlab to threshold these images based on RGB values.
However, all I've managed to do is to display the same image but in false colour...
Can you please help identify my error?
Thanks
data1 = bfopen(fullfile(sourcePathName, file1));
series1 = data1{1, 1};
series1_plane1 = series1{1, 1};
series1_plane2 = series1{2, 1};
series1_plane3 = series1{3, 1};
img1(:,:,1) = uint8(series1_plane1);
img1(:,:,2) = uint8(series1_plane2);
img1(:,:,3) = uint8(series1_plane3);
R = img1(:,:,1);
G = img1(:,:,2);
B = img1(:,:,3);
allR_Low = R>=148;
allR_High = R<=208;
allG_Low = G>=157;
allG_High = G<=255;
allB_Low = B>=193;
allB_High = B<=255;
allMask1 = img1;
allMask = allR_Low & allR_High & allG_Low & allG_High & allB_Low & allB_High;
allMask1(repmat(~allMask,[1 1 1])) = 0;
imshow(img1);
imshow(allMask1);


採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Red についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!