variance of the vertical projection
Show older comments
hello I need a code to calculate the variance of the vertical projection of an image please help me
Answers (2)
Walter Roberson
on 14 Jan 2013
vertproject = any(grayimage);
vertprojectvar = var(vertproject);
I don't see any value in this. Perhaps you mean something different by "vertical projection" than what is usually meant here.
5 Comments
Image Analyst
on 14 Jan 2013
I often use projections when you want to find things in an image, like grid lines (say, in the Color Checker chart), or find edges of your ROI (say your sample is in some kind of frame or mounting bracket and you need to locate exactly where your sample lies).
Walter Roberson
on 14 Jan 2013
Edited: Walter Roberson
on 14 Jan 2013
Right, but I can't think of any value in var() of this projection.
Image Analyst
on 15 Jan 2013
Actually I have used that to determine how "splotchy" a scene is. I take horizontal and vertical projections and then look at the standard deviation of the profile. A perfectly uniform image would give 0 (flat profile) and the more splotchy the image is, the higher the standard deviation will be. You can't get that from just a histogram. There are other measures of splotchiness that are also used, like the mean of an edge filtered version of the image (say a DOG filter) - things like that.
Walter Roberson
on 15 Jan 2013
However variance is not sensitive to order, so how can you tell the difference between (say) solid-black left-half with solid-white right-half, compared to the much more "splotchy" near randomization of the order of the same columns ?
Image Analyst
on 15 Jan 2013
True. One measurement is not enough to tell the story and be robust enough for all possible image appearances so we need multiple measurements. Another measurement that is made is to fit the profile to linear and quadratic curves and look at the mean absolute difference and the RMS difference between the fit and the actual profile.
Image Analyst
on 14 Jan 2013
Try this:
verticalProjection = sum(grayImage, 1); % Could use mean also.
theVariance = var(verticalProjection);
If that's not what you mean, then explain better.
1 Comment
Walter Roberson
on 14 Jan 2013
I have also seen max() used.
Categories
Find more on Object Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!