📄 imageforces.m
字号:
function out = imageForces( pnt,... radius_x,... radius_y,... image,... image_gradient )%% index_x -\ define the neighborhood% index_y -/ of the point (pnt) where to estimate image forces% igSize = size(image_gradient);% Should be a procedure, but I am too lazy%h_pnt = pnt + [-radius_x 0];save_h_pnt = h_pnt;h_pnt(1) = clipValue(h_pnt(1), 1, igSize(2));left = (h_pnt(1) - save_h_pnt(1)) + (-radius_x);h_pnt = pnt + [radius_x 0];save_h_pnt = h_pnt;h_pnt(1) = clipValue(h_pnt(1), 1, igSize(2));right = (h_pnt(1) - save_h_pnt(1)) + radius_x;h_pnt = pnt + [0 -radius_y];save_h_pnt = h_pnt;h_pnt(2) = clipValue(h_pnt(2), 1, igSize(1));top = (h_pnt(2) - save_h_pnt(2)) + (-radius_y);h_pnt = pnt + [0 radius_y];save_h_pnt = h_pnt;h_pnt(2) = clipValue(h_pnt(2), 1, igSize(1));bottom = (h_pnt(2) - save_h_pnt(2)) + radius_y;%%pnt_left = pnt(1) + left;pnt_right = pnt(1) + right;pnt_top = pnt(2) + top;pnt_bottom = pnt(2) + bottom;%igArea = image_gradient(pnt_top:pnt_bottom, pnt_left:pnt_right);%out = sum(sum(igArea));out = sum( image_gradient(pnt(2), pnt_left:pnt_right) );out = out + sum( image_gradient(pnt_top:pnt_bottom, pnt(1)) );out = -255*out;end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -