How to extract feature from multiple image?
조회 수: 4 (최근 30일)
이전 댓글 표시
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
KSSV
2016년 12월 23일
Post your code, so that we can check and find out why you are getting only one return value.
채택된 답변
Image Analyst
2016년 12월 23일
편집: Image Analyst
2016년 12월 24일
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
Image Analyst
2016년 12월 24일
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;
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
