Skip to content

mat.getRegion(rect).getData() is different than mat.getRegion(rect).getDataAsArray() #480

Description

@piercus

Scenario

const matC3 = new cv.Mat([
   [[255, 255, 255], [255, 255, 255], [255, 255, 255]],
   [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
], cv.CV_8UC3);
const region = matC3.getRegion(new cv.Rect(0, 0, 2, 2));
const buf = region.getData();
console.log(new Uint8Array(buf)[6], region.getDataAsArray()[1][0][0])

Actual

prints

255, 0

Expected

should print

0, 0

May be related to #402 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions