我正在使用c#和opencv,我想根据给定的眼睛图像生成以下类型的图像。
我成功生成了以下类型的图像,但找不到找到所需图像的方法。
private void SegmentIris()
{
//Clone the filled contour
Image<Gray, Byte> InputImageCloneOne = FilledContourForSegmentation.Clone();
Image<Gray, Byte> InputImageCloneTwo = FilledContourForSegmentation.Clone();
MCvScalar k = new MCvScalar(255, 255, 255);
//Draw the circle for mask in white
CvInvoke.cvCircle(mask, PupilCenter, OuterBoundaryRadius, IrisConstants.WhiteColor, -1, Emgu.CV.CvEnum.LINE_TYPE.CV_AA, 0);
//Create the optimised circle using pupil center and outer boundary iris -> so that circles appear proper around the iris
if (IsContourDetectionSatisfactory)
{
OptimisedIrisBoundaries = FilledContourForSegmentation.Clone();
CvInvoke.cvCircle(OptimisedIrisBoundaries, PupilCenter, OuterBoundaryRadius, IrisConstants.WhiteColor, 2, Emgu.CV.CvEnum.LINE_TYPE.CV_AA, 0);
}
else
{
OptimisedIrisBoundaries = ApproximatedPupilImage.Clone();
CvInvoke.cvCircle(OptimisedIrisBoundaries, PupilCenter, OuterBoundaryRadius, IrisConstants.WhiteColor, 2, Emgu.CV.CvEnum.LINE_TYPE.CV_AA, 0);
}
//now make the mask circle black
CvInvoke.cvNot(mask, mask);
//Subtract the input image and filled contour image over the mask created
CvInvoke.cvSub(InputImage, InputImageCloneOne, InputImageCloneTwo, mask);
//Put clonetwo to segmented image
CvInvoke.cvCopy(InputImageCloneTwo, SegmentedIrisImage, new IntPtr(0));
}