Why my image displayed on axis small ?

anyone know what happen to this axis?
here i attach my source code .
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%mouth detection%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MouthDetect = vision.CascadeObjectDetector('Mouth','MergeThreshold',100); %eyes detect library
% mouth detection
BBM = step(MouthDetect,j);
%colour detected mouth in image by red
%crop mouth
[x1,y1,z1] = size(BBM)
m = imcrop(j,BBM(x1,:,:))
%show mouth
axes(handles.axes6)
imshow(m);
handles.ImgData6 = m;
guidata(hObject,handles);

2 Comments

Your code seems a bit overly complicated. The output of step() is going to be a something-by-4 array of bounding box information, one box per row. It is not going to be 3D, so no need to be concerned about the z coordinates. Getting size() of BBM and indexing at the size is not actually wrong, but because it is not common, it would leave people second-guessing about whether you had some special reason for doing things that way, whether there was something subtle about the output of the detector that you knew but they did not. To avoid all that, it would make more sense to simply access
m = imcrop(j, BBM(end,:));
It might make even more sense to look to see which the largest entry is in BBM, in case of accidental matching on small objects:
[~, maxidx] = max(BBM(:,3).*BBM(:,4)); %maximum area
m = imcrop(j, BBM(idx,:));
lia mjd
lia mjd on 27 Mar 2019
Edited: lia mjd on 27 Mar 2019
Hi! thankyou for helping me. problem solved!

Sign in to comment.

Answers (0)

Asked:

on 26 Mar 2019

Edited:

on 27 Mar 2019

Community Treasure Hunt

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

Start Hunting!