Filtering a ROI using Simulink

Hi,
I need to filter an ROI that contains an object using median filter and convert it to binary image for Blob Analysis. I created the ROI using Autothreshold block and I tried with following code using MATLAB Function block:
function BW2 = filtroi(I,roi)
coder.extrinsic('strel');
coder.extrinsic('roifilt2')
coder.extrinsic('fspecial')
coder.extrinsic('im2bw');
BW2 = false(size(I));
k = fspecial('average'); %I could not find median-filter kernel
if isempty(find(roi)) == true
I2 = I;
else
I2 = roifilt2(k,I,roi);
end
BW2 = im2bw(I2);
but the visualization (to Video Display block) doesn't show the resulting bw image. Some suggest?

댓글 수: 3

Bruno Pop-Stefanov
Bruno Pop-Stefanov 2014년 1월 17일
Would you mind attaching your model file to the question? Thank you.
Marco
Marco 2014년 1월 20일
편집: Marco 2014년 1월 20일
sorry I'm late. Thanks for reply; this is the model
the problem is that ROI is nonzero-regions of BW image. PS: inside MATLAB fcn block there is above code as far as I2 creation.
vcmorini
vcmorini 2017년 2월 22일
Hi, I have specific regions in my image which I want to analyse, using simulink.
How can I make a ROI of this?
Have some example which I can see?
Thks!!

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

질문:

2014년 1월 17일

댓글:

2017년 2월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by