You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.2 KiB
C#

11 months ago
using HalconDotNet;
using Rs.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Rs.MotionPlat.Commom
{
public class ImageRotate
{
public static HObject Rotate(HObject sourceImg,string cameraName)
{
HObject hImage = new HObject();
switch (cameraName)
{
case "upCamera":
HOperatorSet.RotateImage(sourceImg, out hImage, SysConfigParam.GetValue<double>("UpCameraRotate"), "constant");
break;
case "downCamera":
HOperatorSet.RotateImage(sourceImg, out hImage, SysConfigParam.GetValue<double>("DownLocationCameraRotate"), "constant");
break;
}
return hImage;
}
public static HObject[] Rotates(HObject[] sourceImg, string cameraName)
{
List<HObject> hImages = new List<HObject>();
foreach (HObject img in sourceImg)
{
hImages.Add(Rotate(img, cameraName));
}
return hImages.ToArray();
}
}
}