How to get the mean value of the area around certain coordinates of an image?

조회 수: 5 (최근 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
KSSV
KSSV 2017년 4월 28일
An exampl eimage with the mesh which you are talking would help to understand.
ferran parera
ferran parera 2017년 4월 28일
Hi, I attach the image and the mat file where the x y coordinates of each point can be found as matrix.
The area to do the average arround each point could be x-15 to x+15. And y-15 to y+15.
If you need any other infromation just ask me.
Thanks for your help.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
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 CenterFile 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!

Translated by