segmenting an image into number of equal size images
이전 댓글 표시
can anybody give me an algorithm for segmenting an image into certain number of equal size image and also for calculating properties for each segmented images?
댓글 수: 3
Image Analyst
2012년 4월 1일
We should really add this to the FAQ. This "how do I divide an image into blocks/subimages" question is getting almost as common as the "how do I save a figure" questions.
M@lik Ali
2012년 7월 16일
yes i think must add this to FAQ.
Jeff Dozier
2013년 8월 9일
Check the function bestblk([M N],maxsiz). It finds dimensions <= maxsiz that are divisors of M & N. If it can't find a divisor > M/10, then it minimizes the amount of padding (and then does the same for N).
채택된 답변
추가 답변 (1개)
Aaditya Kalsi
2012년 4월 1일
0 개 추천
One way to do this is to decide on a metric to segment the image into. Also, the method I am writing is general and the resulting segments will not completely reconstruct the image, rather extract out N important segments.
Easy Algorithm:
1. Assume a 5x5 (you may choose a different size) block. Select this iteratively and move through the entire image. If you have the Image Processing Toolbox, you may do this by BLOCKPROC.
2. Calculate Variance for each block. You may do this by using VAR() on the block's elements listed out like a vector. Assuming your block is B, then B(:) will list out its elements as a vector.
3. Keep the blocks with the M highest variance values.
Variance is a good starting guess for interesting regions. This however highly depends on your application.
카테고리
도움말 센터 및 File Exchange에서 Color Segmentation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!