Calculate GLCM feature vector for each pixel of an image
5 次查看(过去 30 天)
显示 更早的评论
Dear all,
I used graycomatrix and graycoprops functions to obtain texture feature which are single values of each feature. Now I want to calculate the feature vector of each pixel in the image based on the feature values obtained. Could anyone provide me any solution for that ?
4 个评论
Image Analyst
2017-12-16
I agree with Rik. Since you'll have only 8 entries in the GLCM, it's very doubtful it will be useful to you. Perhaps if you give us your image and existing segmentation algorithm we can suggest ways to "enhance the quality of the segmentation and eliminate if exists irrelevant features".
回答(1 个)
Image Analyst
2017-12-16
I doubt glcm stats on a per pixel basis will be a useful feature for you. Attached is an example of GLCM on the entire image. Basically you'd have to do that inside a nested for loop where you scan over every pixel. I really think it's literally a waste of time. Why don't you just post your image and tell us what you want to find, and why you think this algorithm will work for that?
3 个评论
Image Analyst
2017-12-16
kmeans is lousy for color segmentation. I'm attaching my kmeans demo for segmenting color images so you can try it for yourself and see that it's not great.
One problem with it is that you have to specify how many clusters there are in advance, and for an arbitrary photo, that's not known. So if you wanted to find grass, sky, and horses, and you say there are 3 color classes, that's fine (well actually not) if there are horses there, but what if the scene doesn't have any horses? Don't you want to know that no horses are in the scene? But you won't be able to because you're saying 3 colors and it will have to take the remaining colors and make 3 clusters out of them. So you will have some area for color class #3, but it's NOT a horse that was found!
Better is to use something else, like DEM: https://www.mathworks.com/matlabcentral/fileexchange/37197-dem--diffused-expectation-maximisation-for-image-segmentation
Or an example-based approach like discriminant analysis, done by the classify() function in the other attached demo.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!