Reference to non-existent field 'BoundingBox'. Error in findVehicle (line 10) bboxes = regions.BoundingBox; can anyone explain?

조회 수: 3 (최근 30일)
function [bboxes,flow]= findVehicle(frameGray, opticFlow)
% Calculate optical flow
flow = estimateFlow(opticFlow,frameGray);
% Threshold Image
threshImage = ( flow.Magnitude > 4);
%Find Connected components and filter regions
[BW_out,regions] = filterRegions(threshImage);
if(size(regions) > 0)
bboxes = regions.BoundingBox;
else
bboxes = [];
end
end

채택된 답변

Walter Roberson
Walter Roberson 2017년 4월 27일
Please show the output of
which -all filterRegions
filterRegions does not appear to be part of any toolbox. It appears to be only part of one particular MATLAB demo https://www.mathworks.com/matlabcentral/fileexchange/57116-deep-learning-for-computer-vision-demo-code?focused=6805483&tab=function
  댓글 수: 2
Abdullah Lafir
Abdullah Lafir 2017년 4월 28일
편집: Abdullah Lafir 2017년 4월 28일
function [BW_out,properties] = filterRegions(BW_in)
BW_out = BW_in;
% Fill holes in regions.
BW_out = imfill(BW_out, 'holes');
% Filter image based on image properties.
BW_out = bwpropfilt(BW_out, 'Area', [5000 + eps(5000), Inf]);
% Get properties.
properties = regionprops(BW_out, {'Area', 'Eccentricity', 'EquivDiameter', 'EulerNumber', 'MajorAxisLength', 'MinorAxisLength', 'Orientation', 'Perimeter'})
I am trying to replicate the same code which is provided in the above link to see how it works, but unfortunately i keep on getting this error
Walter Roberson
Walter Roberson 2017년 4월 28일
properties = regionprops(BW_out, {'Area', 'Eccentricity', 'EquivDiameter', 'EulerNumber', 'MajorAxisLength', 'MinorAxisLength', 'Orientation', 'Perimeter', 'BoundingBox'})

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

추가 답변 (0개)

제품

Community Treasure Hunt

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

Start Hunting!

Translated by