【发布时间】:2012-08-20 12:58:11
【问题描述】:
我一直在寻找这个问题,但我不知道(也没有找到)如何解决它。这里有谁知道如何解决这个问题?我正在使用 EMGU,但问题在于 c# 编码(我对 C# 相当陌生) - 我认为这与 out 语句有关,因为我没有经常使用它们:
Image<Gray, Byte> first_image;
if (start_at_frame_1 == true)
{
Perform_custom_routine(imput_frame, out first_image);
}
else
{
Perform_custom_routine(imput_frame, out second_image);
}
Comparison(first_image);
【问题讨论】:
-
如果
start_at_frame_1为假,则尚未为first_image分配对Comparison()的调用的值。这就是你被警告的。如何修复它取决于您想要的行为。此外,== true是一个冗余测试 - 你可以只使用if(start_at_frame_1)