Index exceeds the number of array elements (0).

조회 수: 5 (최근 30일)
Mohamed Kammoun
Mohamed Kammoun 2022년 6월 25일
댓글: Cris LaPierre 2022년 6월 30일
I keep getting this error:
Index exceeds the number of array elements (0).
Error in S5_HoughTransform (line 58)
X = [lines(i).point1(1);lines(i).point2(1)];

답변 (1개)

Cris LaPierre
Cris LaPierre 2022년 6월 25일
You are trying to index a variable that has no elements.
a = []
a = []
a(1)
Index exceeds the number of array elements. Index must not exceed 0.
  댓글 수: 2
Mohamed Kammoun
Mohamed Kammoun 2022년 6월 30일
thank you very much for your answer.
i think my problem is in:
lines=houghlines(g,theta,rho,peaks);
for some reason it returns the value of 0.
Cris LaPierre
Cris LaPierre 2022년 6월 30일
Could be. It may be because no edges were found in your image, so g is empty.

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

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by