How do I get the values of the surrounding pixels when I choose a particular pixel in an image?

조회 수: 7 (최근 30일)
I'm trying to estimate the possible points of intersection between two lines (arrays) in an image. Is there any function to return the values of the surrounding pixels for a particular value of the array?

채택된 답변

Image Analyst
Image Analyst 2016년 11월 2일
Assuming it's a gray scale image, and that the row and column is not on the edge of the image:
surroundingWindow = grayImage(row-1:row+1, col-1:col+1);
If it's color:
surroundingWindow = rgbImage(row-1:row+1, col-1:col+1, :);
  댓글 수: 6

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

추가 답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by