How to extract feature from multiple image?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Farhan Abdul Wahab
le 23 Déc 2016
Commenté : Image Analyst
le 24 Déc 2016
The aim of the outcome; which to display the result is similar to this:
but instead I would like to fetch the feature from other images, where only one object inside each image.
1. Read image from file - successful
2. Convert RGB to gray - successful
3. Convert Gray to Binary - successful
4. Extract the feature for each image - failed. - It supposed to return Area for each 10 images, somehow it only return 1 value.
2 commentaires
KSSV
le 23 Déc 2016
Post your code, so that we can check and find out why you are getting only one return value.
Réponse acceptée
Image Analyst
le 23 Déc 2016
Modifié(e) : Image Analyst
le 24 Déc 2016
It looks like there are two problem. You are using the loop index "i" inside another, outer loop, which also has the same loop index. Not a wise choice. And it looks like the outer i, which should be renamed to something like imageNumber is the image number but your areas are just for the current image. So put all the areas into a cell. It needs to be a cell because different areas can have different numbers of regions.
theArea{imageNumber} = [Measurements.Area]
By the way, in the MATLAB editor, type control-a control-i to fix up your indenting before you paste it here. It will make your code easier to follow.
2 commentaires
Farhan Abdul Wahab
le 24 Déc 2016
Modifié(e) : Farhan Abdul Wahab
le 24 Déc 2016
Image Analyst
le 24 Déc 2016
Because the number of areas might vary from image to image, use a cell array and braces:
theArea{imageNumber} = [Measurements.Area]
If you're going to have one blob always, like if you use bwareafilt(binaryImage, 1), then you can use a simple numerical array with parentheses:
theArea(imageNumber) = Measurements.Area;
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Convert Image Type dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
