Little problem with region props

here I want to separate red blue and green content from the image and I should find centroid for the red blue and green content. For this I
1) First read the image;
2)seperated its Red,Blue and Green components into other variables;
3) converted that into a bit image after finding its treshold values;
4) next I planned of using regionprops function on my bit image;
now when I used that regionprops('mybitimage','Centroid') I got this error " Field reference for multiple structure elements that is followed by more reference blocks is an error."
I couldn't figure out why I am getting that error and when will I get that error because for some images my code is working good and for some images I am getting that error.
Thanks in advance.

Answers (1)

Image Analyst
Image Analyst on 17 Jul 2013
You need to pass regionprops a binary or labeled image, not a string. Try taking the single quotes off the first argument.

1 Comment

I didnot pass a string i passed the name of the bit wise image's identifier ( variable ) without inscribing it in single quotes sometimes my program works fine and some times it shows that error and program terminates.

Sign in to comment.

Categories

Asked:

on 17 Jul 2013

Community Treasure Hunt

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

Start Hunting!