questions about the Landmark::ProfileInfo

questions about the Landmark::ProfileInfo

below is the code patches I wrote to get the landmark data: // Init Face analyzer PXCSmartPtr faceAnalyzer; sts=session->CreateImpl(cmdl.m_iuid, PXCFaceAnalysis::CUID, (void**)&faceAnalyzer); //create landmark instance and set profile PXCFaceAnalysis::Landmark *landmark = faceAnalyzer->DynamicCast(); PXCFaceAnalysis::Landmark::ProfileInfo lInfo; lInfo.labels = PXCFaceAnalysis::Landmark::LABEL_7POINTS; landmark->SetProfile(&lInfo); PXCFaceAnalysis::Landmark::LandmarkData data; faceRender->SetLandmarkData(landmark, fid); I changed the lankmark profile's label to LABEL_7POINTS but the result is only 6 landmark point, the nose tip is not set. I'm so confused and could anyone tell me how to use the Landmark::ProfileInfo to get nose tip landmark? Thanks a lot!

2 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

The ProfileInfo structure with QueryProfile/SetProfile functions is widely used technique with consistent behavior across many Perceptual Computing SDK interfaces.
The structure ProfileInfo may contain other fields besides parameters of your interest.
Recommended approach is to first obtain valid profile structure by calling QueryProfile prior to SetProfile:


for (int i=0; ; i++) {

    PXCFaceAnalysis::Landmark::ProfileInfo pinfo;

    pxcStatus sts = landmark->QueryProfile(i, &pinfo);

    if (sts < PXC_STATUS_NO_ERROR) return false; // ‘i’ looped over all available configurations

    // .. check if pinfo contains suitable parameters

    // .. change some parameters as needed

    pinfo.labels = PXCFaceAnalysis::Landmark::LABEL_7POINTS

    sts = landmark->SetProfile(&pinfo);

    if (sts >= PXC_STATUS_NO_ERROR) break;

}


or try first configuration (QueryProfile with index=0) without looping

    PXCFaceAnalysis::Landmark::ProfileInfo pinfo;

    sts = landmark->QueryProfile(0, &pinfo);

    pinfo.labels = PXCFaceAnalysis::Landmark::LABEL_7POINTS;

    sts = landmark->SetProfile(&pinfo);


or at least initialize ProfileInfo structure with zero (otherwise it may contain garbage values)

    PXCFaceAnalysis::Landmark::ProfileInfo pinfo;

    memset(&pinfo, 0, sizeof(pinfo));

    pinfo.labels = PXCFaceAnalysis::Landmark::LABEL_7POINTS;

    sts = landmark->SetProfile(&pinfo);


I should admit that latest method (with memset) doesn’t work on landmark module from Beta1 release because of implementation bug, but first two methods should work fine. Beta2 release will work correctly on all three methods.

BTW, easiest way to change landmark configuration in landmark_detection sample application is to override the following virtual function:


    virtual void OnFaceLandmarkSetup(PXCFaceAnalysis::Landmark::ProfileInfo *finfo)

    {

        finfo->labels = PXCFaceAnalysis::Landmark::LABEL_7POINTS;

    }

Faça login para deixar um comentário.