Skip to content

reg:Mapper::grid creates internal Mat of type == input Mat, but always assigns <double> #270

@rkhamilton

Description

@rkhamilton

The example files for the mapper always convert the input images to CV_64FC3. It's fine that this is a required input type, but there is no type checking in the MapperGradProj (and others?) calculate() method. You can execute this code:

    MapperGradProj mapper;
    MapperPyramid mappPyr(mapper);
    Ptr<Map> mapPtr;
    mappPyr.calculate(img1, img2, mapPtr);

and it will have an unhandled exception in mapper:grid() if img1 and img2 are CV_8UC3. Grid creates two internal Mats of fhe same type as the input (e.g. CV_8UC3). However, it later assigns values of type double or type Vec3d to that new Mat. This throws an unhandled error.

I suggest that grid() should either create internal variable that are always of type CV_64FC?. I also suggest that mapper:: calculate() should perform a check that inputs to the overall mapper calculate function are of the expected type.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions