Problem using minboundquad function to create a minimum bounding quadrilateral for a given pointset

조회 수: 2 (최근 30일)
I had modified one line in the minboundquad.m function to remove the collinear edges in the pointset.
from
edges = convhull(x,y);
to
edges = convhull(x,y,'Simplify',true);
The main code is
load points2.txt
x = points2(:,1);
y = points2(:,2);
[qx,qy] = minboundquad(x,y)
Result I got is below.
This is the output
There is some error I could not find out. Can someone help me solve this?

채택된 답변

Gowtham HariHara
Gowtham HariHara 2021년 5월 26일
Modifying the line in minboundquad.m from
if ( A_i < quadarea)
to
if (( A_i < quadarea)&& all(abs([qxi qyi]) < 1e15))
resolves the issue.
Thanks to @Michael Sapper for this suggestion(found in comment section of this toolbox)

추가 답변 (1개)

Shiva Kalyan Diwakaruni
Shiva Kalyan Diwakaruni 2021년 5월 26일
Hi,
I did not seem to find any error while reproducing and I got the below result after changing minboundquad.m
from
edges = convhull(x,y);
to
edges = convhull(x,y,'Simplify',true);
I got the Warning: Matrix is close to singular or badly scaled. Results may be inaccurate.
Can You explain what your error was?
  댓글 수: 2
Gowtham HariHara
Gowtham HariHara 2021년 5월 26일
편집: Gowtham HariHara 2021년 5월 26일
@Shiva Kalyan Diwakaruni Thank you for your time.
There is no quadrilateral formed. Outcome of this function should be four vertices of a quadrilateral.
Gowtham HariHara
Gowtham HariHara 2021년 5월 26일
@Shiva Kalyan Diwakaruni Do you want to see the expected outcome of this function ?
This function worked for one of the less complex pointset. If you would like to see the result for a working pointset, I can show a screenshot.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Dijkstra algorithm에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by