C#问题急求解
public class AlignmentWrapper
{
private IFaceAlignmentor alignmentor;
private PointF[][] points;
public AlignmentWrapper(FaceAlignmentType type)
{
this.alignmentor = FaceAlignmentorFactory.Create(type);
this.Type = type;
}
以上是微软facesdk里的demo代码,但是运行后会产生NullReferenceException was handle的错误,但是基本上相似的代码段如下:
public class DetectorWrapper
{
private FaceRect[] faces;
private IFaceDetector detector;
public DetectorWrapper(FaceDetectionType type)
{
this.detector = FaceDetectorFactory.Create(type);
this.Type = type;
}
却并不会有异常,分步调试detector中也的确有东西,但之前的alignment却为空,请问这是为什么。