Error using bwareafilt Expected input number 1 to be one of these types:
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
NoYeah
am 5 Dez. 2020
Beantwortet: Pranav Verma
am 11 Dez. 2020
Greeting I got the above error while using bwareafilt and don`t know what is the wrong
I want to get the biggest region of the grayscale image
so I have uploaded 512*512 size RGB which value is 0 to 255 bmp image and convert it to grayscale image of 512*512 which value is 0 or 1
clear all;
close all;
clc;
img = imread('flower.bmp');
bw=im2bw(img);
bw2=bwareafilt(bw,1,'largest',8);
after I pass my bw image to bwareaflit function it bring outs error
Error using bwareafilt
Expected input number 1 to be one of these types:
logical
Instead its type was double.
I have followed the offical instruction of bwareaflit page but it gives error
I cannot understand what is the wrong
0 Kommentare
Akzeptierte Antwort
Pranav Verma
am 11 Dez. 2020
Hi Mathew,
The bwareafilt function takes a maximum of 3 inputs as parameters, where as you have defined four.
Also instead of using im2bw, you can consider using imbinarize to convert the grayscale image to binary image. To convert the RGB image to grayscale image, you can use rgb2gray function in MATLAB.
Please refer to the documentation on bwarefilt:
Thanks
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Simultaneous and Synchronized Operations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!