我想将尺寸为 500x500x3 的 RGB 图像填充到 512x512x3。我知道我需要在每个边框上添加 6 个像素,但我不知道如何添加。我已阅读 numpy.pad 函数文档,但无法理解如何使用它。代码片段将不胜感激。
python opencv numpy python-imaging-library
numpy ×1
opencv ×1
python ×1
python-imaging-library ×1