Runing python Surface-Matching sample code leads to different result

asked 2019-04-23 07:49:37 -0500

a822305877 gravatar image

updated 2019-04-24 04:14:13 -0500

I run the sample code of surface matching with python, but get the difference result with official website.

image description

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?image description

edit retag flag offensive close merge delete

Comments

how exactly do your results differ ?

berak gravatar imageberak ( 2019-04-24 04:08:43 -0500 )edit

Like the photo shows, the white points without faces is my result, the points with red faces is scene. but the residual is small

a822305877 gravatar imagea822305877 ( 2019-04-24 04:13:16 -0500 )edit