Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要获取像素邻居才能获得一系列边界点,所以我的计划是:-
如何在 MATLAB 中获取像素邻居?
你总是可以定义一个位移矢量
d = [ 1 0; -1 0; 1 1; 0 1; -1 1; 1 -1; 0 -1; -1 -1];
那么 location 的邻居loc =[i j]是
loc =[i j]
neighbors = d+repmat(loc,[8 1]);
希望对你有用...