fix swapped canvas width and height

This commit is contained in:
Meizar 2025-07-29 06:49:00 +07:00
parent 0609cdb4cd
commit 7bd0a9fe66

View file

@ -101,7 +101,7 @@ public class ImageGenerator
var globalRoI = GenerateGlobalRoI(requestBody.CropOffset, requestBody.CropSize, canvasRect.Width,
canvasRect.Height);
Mat canvas = new Mat(globalRoI.Width, globalRoI.Height, a1Mat.Type());
Mat canvas = new Mat(globalRoI.Height, globalRoI.Width, a1Mat.Type());
Parallel.ForEach(matrix, item =>
{
@ -193,8 +193,8 @@ public class ImageGenerator
private Rect GenerateInitialRectCanvas(Mat reference, int rowCount, int colCount)
{
int width = reference.Rows * rowCount;
int height = reference.Cols * colCount;
int width = reference.Width * colCount;
int height = reference.Height * rowCount;
return new Rect(0, 0, width, height);
}