A few problems here. First of all DON'T use image as the name of your image variable since "image" is the name of a built-in function.
Second, don't preallocate an all zero matrix like that. zeros() doesn't take logical type. Use false. So instead of
g = false(size(logicalImage));
Third, I don't know if you want the curvature in the x-y plane or the curvature in the intensity direction.