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

1 visualización (últimos 30 días)
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 comentarios
pratyush ghosh
pratyush ghosh el 13 de Jul. de 2020
Editada: Walter Roberson el 13 de Jul. de 2020
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'

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 13 de Jul. de 2020
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 comentarios
pratyush ghosh
pratyush ghosh el 14 de Jul. de 2020
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
Walter Roberson
Walter Roberson el 17 de Jul. de 2020
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/

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by