Selecting the 4-neighbours of a pixel [closed]
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . How can I select the 4-neighbours of a pixel in matlab ? Thanks. 回答1: If the the image is img and the current pixel indices are i and j , then the four neighbors will be: img(i-1,j); img(i+1,j); img(i,j-1); img(i