the usage of util3d::mergeTextures()

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

the usage of util3d::mergeTextures()

Letiantian
This post was updated on .
When my c++ program executes to the line of "util3d::mergeTextures()", errors occur as follows:
fullMsg = "[FATAL] (2020-07-29 17:43:04) util3d_surface.cpp:1573::rtabmap::util3d::mergeTextures() Condition (!image.empty()) not met!"

The usage of "util3d::mergeTextures()" is in the following:
cv::Mat textures = rtabmap::util3d::mergeTextures(
                        *textureMesh,
                        std::map<int, cv::Mat>(),
                        std::map<int, rtabmap::CameraModel>(),
                        mRM.getMemory(),
                        0,
                        textureSize,
                        textureCount, // to get contrast values based on all images in multiband mode
                        vertexToPixels,
                        doGainCompensation,
                        10.0f,
                        true,
                        doBlending,
                        0,
                        0,
                        10, // low-high brightness/contrast balance
                        false, // exposure fusion
                        0,     // state
                        255,     // blank value (0=black), 255
                        &gains,
                        &blendingGains,
                        &contrastValues);
where
pcl::TextureMeshPtr textureMesh = rtabmap::util3d::createTextureMesh(
                triangles,
                cameraPoses,
                cameraModels,
                cameraDepths,
                optimizedMaxTextureDistance,
                0.0f,
                0.0f,
                200,
                std::vector<float>(),
                0,
                &vertexToPixels);
I do not know why.Are there any other values, such as "rtabmap::ParametersMap parameters;
        parameters.insert(rtabmap::ParametersPair(rtabmap::Parameters::kVisEstimationType(), std::string("0")))",   that should be set?Could you please give me some suggestions?Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: the usage of util3d::mergeTextures()

matlabbe
Administrator
Without the full code and database example, it is difficult to see the problem. The part "mRM.getMemory()" is used to get rgb images for the corresponding frames added to mesh.

You may debug by comparing with this tool https://github.com/introlab/rtabmap/blob/master/tools/Export/main.cpp, also using this function.