フィルターのクリア

image analysis of specified area in the image

1 回表示 (過去 30 日間)
Jialin Men
Jialin Men 2022 年 6 月 22 日
コメント済み: Jialin Men 2022 年 6 月 22 日
Hallo everyone,
I have a question about image analysis. I have this following picture.
I only would like to know the specified part(the part surrounded by the green line) which i want to investigate.
Picture size is 64*48.
How i could know that part position and take all that matrix value from that area out?
Thanks so much in advance
JL

採用された回答

Image Analyst
Image Analyst 2022 年 6 月 22 日
That picture has more resolution than 64x48.
To get a mask for the green encircled regions in your starting image, you can do
[rows, columns, numberOfColorChannels] = size(rgbImage)
[r, g, b] = imsplit(rgbImage);
greenMask = r == 0 & g == 255 & b == 0;
% Fill to make solid
greenMask = imfill(greenMask, 'holes');
% Get mean values inside mask
meanR = mean(r(greenMask))
meanG = mean(g(greenMask))
meanB = mean(b(greenMask))
% Get mean values outside mask
meanRout = mean(r(~greenMask))
meanGout = mean(g(~greenMask))
meanBout = mean(b(~greenMask))
We don't know what to do next because what you said you want to do is so vague. Like exactly what does " take all that matrix value from that area out" mean? Do you want to crop the bounding box out to a new image? Do you want the mean R, G, and B in the regions? Do you want to mask the original image, blackening inside the green outlines? Do you want to measure areas or perimeters? Something else? I have no idea.
Please read
and clarify your request.
  1 件のコメント
Jialin Men
Jialin Men 2022 年 6 月 22 日
Thanks so much for your reply.
Matrix value that i use is not RGB value. I did EDX analysis, get values from it, and the values form is also 64*48.
As you see, similar like this picture. i just want to get all the values which inside of the red lines. therefore i need to know its positions(x,y) and then i could take values from it.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by