Determining the slope between relevant 2d objects

2 ビュー (過去 30 日間)
Kimo Kalip
Kimo Kalip 2018 年 6 月 29 日
編集済み: Kimo Kalip 2018 年 7 月 3 日
Hello all, included I have my post processed image where I've done a lot of things to it, but basically got it to this post watershed state where the edges are quite segmented.
The idea here is I want to take the slope of the objects, then be able to draw some sort of conclusion from it. For example, if I were to draw a slope along the right side set of objects, would I get a regular gradual slope, or something more like a spline curve?
Main questions:
1. How do I extract the x-y coordinates from those identified objects?
2. Is it possible to draw a 'best fit line' of sorts between the right hand objects (ignoring the ones on the left?)
Thanks!
  1 件のコメント
jonas
jonas 2018 年 6 月 30 日
編集済み: jonas 2018 年 6 月 30 日
How did you identify the objects? Can you post the code or a sample code?
From the name of the file I assume you used CC=BwConncomp. The output of that function includes a field CC.PixelIdxList, where the connected pixels for each object are stored.

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

回答 (1 件)

Image Analyst
Image Analyst 2018 年 6 月 30 日
Why not take the points and use poly2mask() to create a solid binary image mask from them?
Then you can call bwperim() or bwboundaries() to get the boundary/outline coordinates for every adjacent pixel.
  2 件のコメント
Kimo Kalip
Kimo Kalip 2018 年 7 月 3 日
I'll try this out, thank you!
Kimo Kalip
Kimo Kalip 2018 年 7 月 3 日
編集済み: Kimo Kalip 2018 年 7 月 3 日
Lets say I wanted to grab four points:
(Smallest x value, corresponding y value)
(Corresponding x value, smallest y value)
(Corresponding x value, highest y value)
(Highest x value, corresponding y value)
First off, how do I extract those particular numbers from the matrix containing the image? Secondly, do you think that would draw a box around my object that I could take the area of, and then try to work from there?
Kinda going off of the image in:
Also, is the xi and yi values given in:
BW = poly2mask(xi,yi,m,n)
Are these arrays that I pass in those values that I want?

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

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by