Info
この質問は閉じられています。 編集または回答するには再度開いてください。
help me in calculating
1 回表示 (過去 30 日間)
古いコメントを表示
i convert rgb image to binary image,the rgb image is of agriculture crops either side with midlle path,i convert that rgb to binary image by making path as white and remaing trees as black, it gives a image of size 435*1200 means the matrix is also of same size.now i have to scan each row and find the pixel column number whose value is 1 and add the column numbers to find the mean distance in between them.
this has to be performed for all the 435 rows.
please help me by answering this and if possible give me a code.
2 件のコメント
darova
2020 年 1 月 23 日
It's hard to tell something without any data or example? Can you provide something?
回答 (2 件)
KALYAN ACHARJYA
2020 年 1 月 23 日
編集済み: KALYAN ACHARJYA
2020 年 1 月 23 日
now i have to scan each row and find the pixel column number whose value is 1 and add the column numbers to find the mean distance in between them.
Let say bw is the binary image
[r c]=find(bw==1);
Do with loop or other way to get the mean of individual row
2 件のコメント
KALYAN ACHARJYA
2020 年 1 月 23 日
編集済み: KALYAN ACHARJYA
2020 年 1 月 23 日
for i=1:length(r)
[r,c]=find(bw(i,:)==1);
col_mean(i)=mean(c);
end
col_mean are the corresponding mean data of cloumns in respective rows. I have no clue what exactly you are trying to do.
Image Analyst
2020 年 1 月 23 日
You need to take your binary image (which unfortunately you forgot to attach) and rotate it using the radon transform and imrotate() like in the attached example.
Then, once you have the crop rows aligned with the image edges, you"
- Invert the binary image (to get space instead of plants) and
- Call imclearborder() to remove any space not fully visible in the image, then
- Scan across the rows (or columns) getting the width of the spaces on each row (or column) using regionprops()
- After all rows have been scanned, compute the mean spacing.
3 件のコメント
Image Analyst
2020 年 1 月 24 日
I thought you had an already segmented photo of an overhead view. Why is this needed? Why some complicated vision system when simply using a tape measure will do the job much more simply?
You should look into the camera calibration capability of the Computer Vision Toolbox - it can do that.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!