例图 Mat src = imread("1.jpg"); Mat bgra; cvtColor(src, bgra, COLOR_BGR2BGRA); for (size_t i = 0; i < src