Error using rgb2gray>parse_inputs , MAP must be a m x 3 array. Use im2gray for RGB and grayscale images.
Mostra commenti meno recenti
Hi!
I am trying to do skeletonization and segmentation on binarized image. However, when I used the binarized image for this functions. It gives me an error. Please see an attachment for reference.
I shall be thankful for your suggestions!
Best
Omer
Risposte (1)
Example:
IMG = imread('cameraman.tif');
size(IMG)
gr = rgb2gray(IMG);
In other words, what you are passing to rgb2gray() is not an RGB image.
If you want to save a step in testing whether an input is already grayscale or not, you can substitute im2gray() for rgb2gray(): im2gray() will return arrays unchanged if they are already grayscale.
Note: binarized images are usually datatype logical() and already 2D. If you had a particular reason to convert them to grayscale then use im2double() or im2uint8()
1 Commento
Omer Iqbal
il 12 Ott 2021
Categorie
Scopri di più su Image Segmentation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!