필터 지우기
필터 지우기

Problem with vision.BlobAnalysis with shapeInserter

조회 수: 2 (최근 30일)
Akira Chan
Akira Chan 2015년 7월 14일
댓글: Akira Chan 2015년 7월 20일
Hello everyone,
As stated in the title, I have a problem when trying to use vision.BlobAnalysis. The code below is my setting for my blob Analysis.
blob = vision.BlobAnalysis('CentroidOutputPort', false, 'AreaOutputPort',...
false,'BoundingBoxOutputPort', true,'MinimumBlobAreaSource', 'Property',...
'MinimumBlobArea', 15000);
shapeInserter = vision.ShapeInserter('BorderColor','White');
Let's say that my pre-processed frame is complete1,
bb = step(blob, complete1);
This codes here works perfectly fine however, the problem comes when I tried to put the CentroidOutputPort and AreaOutputPort from the 'false' condition to the 'true condition', the following error occurs:
"Error using ShapeInserter/step The Points input must be an M-by-4 matrix. Each row specifies a different rectangle and is of the form [x y width height]."
"Error in ComputerVisionTest (line 73) result = step(shapeInserter, frame, bb);"
Someone please help me understand what should I change in my shapeInserter to not get this error message? My goal here is to determine the area of object detected by the program as well as knowing the area of each object on screen.
In case someone ask, the shapeInserter is the parameters of the bounding box which marks object based on the blob Analysis.
Thank you.
Regards, Akira

채택된 답변

Walter Roberson
Walter Roberson 2015년 7월 15일
When those are true you need
[area, centroid, bb] = step(blob, complete1);
  댓글 수: 2
Akira Chan
Akira Chan 2015년 7월 15일
Ohhh thanks you, sir!! I go try it right now.
Akira Chan
Akira Chan 2015년 7월 20일
Thank you, it works!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Tracking and Motion Estimation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by