function veins = miura_max_curvature(img, fvr, sigma)
winsize = ceil(4*sigma);
[X,Y] = meshgrid(-winsize:winsize, -winsize:winsize);
the above function is called in the main script
function [region, edges] = lee_region(img, mask_h, mask_w)
[img_h, img_w] = size(img);
if mod(img_h,2) == 0
half_img_h = img_h/2 + 1;
else
half_img_h = ceil(img_h/2);
end
mask = zeros(mask_h,mask_w);
mask(1:mask_h/2,:) = -1;
mask(mask_h/2 + 1:end,:) = 1;
img_filt = imfilter(img, mask,'replicate');
img_filt_up = img_filt(1:floor(img_h/2),:);
[~, y_up] = max(img_filt_up);
img_filt_lo = img_filt(half_img_h:end,:);
[~,y_lo] = min(img_filt_lo);
region = zeros(size(img));
for i=1:img_w
region(y_up(i):y_lo(i)+size(img_filt_lo,1), i) = 1;
end
edges = zeros(2,img_w);
edges(1,:) = y_up;
edges(2,:) = round(y_lo + size(img_filt_lo,1));
the above function is called in the main function
img = im2double(imread('veinvein.jpg'));
img = imresize(img,0.5);
fvr = lee_region(img,4,20);
sigma = 3;
v_max_curvature = miura_max_curvature(img,fvr,sigma);
md = median(v_max_curvature(v_max_curvature>0));
v_max_curvature_bin = v_max_curvature > md;
overlay_max_curvature = zeros([size(img) 3]);
overlay_max_curvature(:,:,1) = img;
overlay_max_curvature(:,:,2) = img + 0.4*v_max_curvature_bin;
overlay_max_curvature(:,:,3) = img;
above code is the main script
Error in miura_max_curvature (line 27)
winsize = ceil(4*sigma);
how to solve the following error
Unable to perform assignment because the size of the left side is 44-by-483 and the size of the right side is 44-by-161-by-3.