How to extract feature from multiple image?
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Farhan Abdul Wahab
el 23 de Dic. de 2016
Comentada: Image Analyst
el 24 de Dic. de 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 comentarios
KSSV
el 23 de Dic. de 2016
Post your code, so that we can check and find out why you are getting only one return value.
Respuesta aceptada
Image Analyst
el 23 de Dic. de 2016
Editada: Image Analyst
el 24 de Dic. de 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 comentarios
Farhan Abdul Wahab
el 24 de Dic. de 2016
Editada: Farhan Abdul Wahab
el 24 de Dic. de 2016
Image Analyst
el 24 de Dic. de 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;
Más respuestas (0)
Ver también
Categorías
Más información sobre Convert Image Type en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
