Runing python Surface-Matching sample code leads to different result
I run the sample code of surface matching with python, but get the difference result with official website.
here is my code:
def Match(modelname, surfacename, resultname):
N = 2
detector = cv.ppf_match_3d_PPF3DDetector(0.025, 0.05)
model = cv.ppf_match_3d.loadPLYSimple(modelname, 1)
detector.trainModel(model)
pcTest = cv.ppf_match_3d.loadPLYSimple(surfacename, 1)
results = detector.match(pcTest, 1.0 / 40.0, 0.05)
icp = cv.ppf_match_3d_ICP(100)
_, results = icp.registerModelToScene(model, pcTest, results[:N])
for i, result in enumerate(results):
print("\n-- Pose to Model Index %d: NumVotes = %d, Residual = %f\n%s\n" % (
result.modelIndex, result.numVotes, result.residual, result.pose))
if i == 0:
pct = cv.ppf_match_3d.transformPCPose(model, result.pose)
cv.ppf_match_3d.writePLY(pct, resultname)
and the model and scene I used
https://github.com/opencv/opencv_cont...
https://github.com/opencv/opencv_cont...
could any one give me some tips?
how exactly do your results differ ?
Like the photo shows, the white points without faces is my result, the points with red faces is scene. but the residual is small