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 Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by