Unable to resolve the name vision.BlobAnalysis

3 Ansichten (letzte 30 Tage)
Dinu Th.
Dinu Th. am 17 Apr. 2020
Beantwortet: Maadhav Akula am 22 Apr. 2020
Hello, I was trying to replicate a matab tutorial to learn image processing. I used the same codes that was given in the tutorial. But in blob analysis it gives me as error as ''Unable to resolve the name vision.BlobAnalysis''. Can anyone expalain what I am doing wrong? I am still learning the basics. Thank you.
AuMat = imread('pic.png');
save pic.mat picMat;
%LOAD SAMPLE
load pic.mat
subplot(1,3,1)
imshow('pic.png')
%Threshold image
%Convert RGB image to chosen color space
I = rgb2hsv(picMat);
% Define thresholds for channel 1 based on histogram settings
channel1Min = 0.931;
channel1Max = 0.047;
% Define thresholds for channel 2 based on histogram settings
channel2Min = 0.735;
channel2Max = 1.000;
% Define thresholds for channel 3 based on histogram settings
channel3Min = 0.000;
channel3Max = 1.000;
% Create mask based on chosen histogram thresholds
sliderBW = ( (I(:,:,1) >= channel1Min) | (I(:,:,1) <= channel1Max) ) & ...
(I(:,:,2) >= channel2Min ) & (I(:,:,2) <= channel2Max) & ...
(I(:,:,3) >= channel3Min ) & (I(:,:,3) <= channel3Max);
BW = sliderBW;
subplot(1,3,2)
imshow(BW)
%remove disturbances
diskElem=strel('disk',2);
Ibwopen = imopen(BW,diskElem);
subplot(1,3,3)
imshow(Ibwopen)
%blob analysis
hBlobAnalysis= vision.BlobAnalysis('MinimumBlobArea',200,'MaximumBlobArea',5000);
[objArea,objCentroid,bboxOut]= step(hBlobAnalysis,Ibwopen);

Antworten (1)

Maadhav Akula
Maadhav Akula am 22 Apr. 2020
Hi,
Can you possibly check whether Computer Vision Toolbox is installed or not by using the following command:
ver vision
Alternatively you can also check whether your account has License for Computer Vision Toolbox or not by checking the License Centre:

Community Treasure Hunt

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

Start Hunting!

Translated by