Код: Выделить всё
public enum RotationDegree
{
_0,
_90,
_180,
_270
}
Код: Выделить всё
using Mat imgSrc = Mat.FromImageData(image);
using PaddleRotationDetector detector = new(RotationDetectionModel.FromDirectory("PP-OCRv5_server_det"));
RotationResult rot = detector.Run(imgSrc);
switch(rot.Rotation) {
case RotationDegree._0:
case RotationDegree._90:
case RotationDegree._180:
case RotationDegree._270:
// Never occurs
break;
default:
throw new Exception("Invalid enum value"); // 2991 for test image
}
Тестовое изображение:
Ожидаемое поведение
Поворот должен иметь значение RotationDegree._270 (целое число 3)
Подробнее здесь: https://stackoverflow.com/questions/798 ... -detection
Мобильная версия