I am getting an error Reference to non-existent field 'BoundingBox'. while using the function please help

function [bboxes,flow] = findPet(frameGray, opticFlow)
% Calculate Optical Flow
flow = estimateFlow(opticFlow,frameGray);
% Threshold Image
threshImage = ( flow.Magnitude > 4);
% Find connected components and filter regions
[~,regions] = filterRegions(threshImage);
if(size(regions) > 0)
bboxes = regions.BoundingBox;
else
bboxes = [];
end
end

3 个评论

the bounding box problem has been taken care of however it keeps showing an error when I try to use
function [classLabel, scores, batchTime] = cnnPredict(cnnModel,predImage,varargin)
[Copyrighted MATLAB code removed]
function im = cnnPreprocess(batchImages)
[...]
im = imresize(im, cnnModel.net.meta.normalization.imageSize(1:2));
im = bsxfun(@minus,im,cnnModel.net.meta.normalization.averageImage);
it shows an error in the last line as an
Reference to non-existent field 'meta'

请先登录,再进行评论。

回答(1 个)

You need to pull in the newer version of cnnPredict, which is at https://github.com/NVIDIA-developer-blog/code-samples/tree/master/MATLAB_deeplearning

2 个评论

I tried using the cnnPredict from the link But I am still getting this error
Reference to non-existent field 'dilate'.
Error in vl_simplenn (line 69)
'dilate', l.dilate, ...
Error in cnnPredict (line 26)
resTemp = vl_simplenn(cnnModel.net,
cnnPreprocess(predImage(:,:,:,1)), [], []);
Error in Untitled4 (line 22)
[~,scores] = cnnPredict(cnnModel, img,
'UseGPU',true,'display',false);
this happened previously when I tried removing the meta term as well the vl_simplenn error is whats bugging me now
Which packages did you load from where to put together this code? The ones I find on mathworks.com do not reference dilate, but I do see dilate documented for layers at https://www.vlfeat.org/matconvnet/mfiles/simplenn/vl_simplenn/

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by