MATLAB コードを C コードに変換するための MathWorks ガイドに従っています。最初のステップは入力することです
%#codegen
Cコードに変換したいすべての関数の後、しかしそうすると、以下のコードで次のプロンプトが表示されます。
function lanes=find_lanes(B,h, stats)
% Find the regions that look like lanes
%#codegen
lanes = {};
l=0;
for k = 1:length(B)
metric = stats(k).MajorAxisLength/stats(k).MinorAxisLength;
%testlane(k);
%end
%function testlane(k)
coder.inline('never');
if metric > 5 & all(B{k}(:,1)>100)
l=l+1;
lanes(l,:)=B(k);
else
delete(h(k))
end
end
end
中括弧の周り:
コード生成は、"varargin" および "varargout" のセル操作のみをサポートします
別のプロンプトは言う
コード生成は、インデックス作成による可変の「レーン」サイズの増加をサポートしていません
レーンが2回目に言及された場所。
関数の入力引数は次のとおりです。
B - Is the output of the bwboundaries Image Processing toolbox function. It is a P-by-1 cell array, where P is the number of objects and holes. Each cell in the cell array contains a Q-by-2 matrix. Each row in the matrix contains the row and column coordinates of a boundary pixel. Q is the number of boundary pixels for the corresponding region.
h - plots the boundaries of the objects with a green outline while being a matrix of size 1 X length(B), holding the values of the boundaries like so like so:
h(K)=plot(boundary(:,2), boundary(:,1), 'g', 'LineWidth', 2);//boundary(:,1) - Y coordinate, boundary(:,2) - X coordinate.
stats - 19x1 struct array acquired using the regionprops function from the Image Processing toolbox with fields: MajorAxisLength and MinorAxisLength (of the object)
このエラーを解決するために、ご意見をお寄せいただければ幸いです。前もって感謝します!