我按照biquette的回答制作了线性渐变 Linear Color Gradient in openCV 如果有人告诉我如何将此公式更改为径向渐变
,它的工作原理非常好Vec3b val;
val[0] = (y*color1[0] + (height - y)*color2[0]) / height;
val[1] = (y*color1[1] + (height - y)*color2[1]) / height;
val[2] = (y*color1[2] + (height - y)*color2[2]) / height;
提前感谢您的帮助。