It is not 100% clear if you're looking for a solution to automatically correct any offset between both planes or do it manually.
If there is no angular deviation between both planes, i.e. they are parallel, the easiest way to solve your problem is to apply an offset to the z-coordinates of your object model.
I would apply this offset correction after creating the object model by performing a lateral translation:
hom_mat3d_identity(HomMat3D)
hom_mat3d_translate(HomMat3D, 0, 0, 42, HomMat3DTranslate)
affine_trans_object_model_3d(ObjectModel3D, HomMat3DTranslate, ObjectModel3DAffineTrans)
The automatic approach would include using the procedure register_object_model_3d_pair()
. To take advantage of this you need to seperate the points of both planes you want to fit. You could do this by taking advantage of the procedure select_points_object_model_3d()
where you would like so select a volume of space by limiting the z range to e.g. +- 1 unit.