1、HObject
//halcon判断图像HObject是否为空 HObject ho_Null; gen_empty_obj(&ho_Null); if (!ho_ImageResult.IsInitialized())//IsInitialized只能用来判断图像有无初始化,不能判断图像空不空或有没有 { return; } HTuple hv_n; test_equal_obj(ho_ImageResult, ho_Null, &hv_n); if (hv_n == 1)//两个Obj相等 { return; }
2、HTuple
HTuple htCh = HTuple(); HTuple hv_Length; TupleLength(htCh, &hv_Length); if (hv_Length.I() == 0) { return true; }