原始问题:原始问题
我有一个大小height x width = (1500,500)
调整为(500,300)
.
I1包含以其坐标为特征的边界框(Top, Left, Bottom, Right)
。
当I1的大小改变时,如何重新调整边界框的坐标?这些公式正确吗?
double newTop = Math.Ceiling((top) * (double)pictureBox1.Height / (double)image1.Height);
double newLeft = Math.Ceiling((left) * (double)pictureBox1.Width / (double)image1.Width);
double newBottom = Math.Ceiling((bottom + 1) * (double)pictureBox1.Height / (double)image1.Height) - 1;
double newRight = Math.Ceiling((right + 1) * (double)pictureBox1.Width / (double)image1.Width) - 1;