How to get the mean value of the area around certain coordinates of an image?
2 次查看(过去 30 天)
显示 更早的评论
Hi, I am writing a code to analize all the frames of a video. I have already split the video on its frames. To simplify my question lets take a single grey scale image.
I have an image. I have a mesh of points (with their coordinates). The mesh is a regular square mesh. I would like to get the average value in the area around each of these points. And if it is posible to have these mean values in a matrix.
How do you recomend me to do it?
Thank you in advance.
2 个评论
采纳的回答
Image Analyst
2017-4-28
Use imfilter() or conv2():
kernel = ones(31); % center plus 15 to all sides.
averageImage = conv2(grayImage, kernel, 'same');
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing and Computer Vision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!