Original question: Original question
I have an image I1 of size height x width = (1500,500)
resized to (500,300)
.
I1 contains bounding boxes characterized by their coordinates (Top, Left, Bottom, Right)
.
How can rescale the coordinates of the bounding boxes when The size of I1 is changed? are these formulas correct?
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;