How to extract feature from multiple image?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Farhan Abdul Wahab
am 23 Dez. 2016
Kommentiert: Image Analyst
am 24 Dez. 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 Kommentare
KSSV
am 23 Dez. 2016
Post your code, so that we can check and find out why you are getting only one return value.
Akzeptierte Antwort
Image Analyst
am 23 Dez. 2016
Bearbeitet: Image Analyst
am 24 Dez. 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 Kommentare
Farhan Abdul Wahab
am 24 Dez. 2016
Bearbeitet: Farhan Abdul Wahab
am 24 Dez. 2016
Image Analyst
am 24 Dez. 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;
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Convert Image Type finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
