-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Bug in Android put/get for non-continuous Mat #19502
Copy link
Copy link
Closed
Milestone
Description
System information (version)
- OpenCV => latest
- Operating System / Platform => Android
- Compiler => Android NDK
Detailed description
Steps to reproduce
Following code reproduces the issue:
Mat test = new Mat(new int[]{ 5, 5, 5 }, CvType.CV_16S);
short[] data = new short[125];
for (int i = 0; i < data.length; i++ ) {
data[i] = (short)i;
}
test.put(new int[] {0, 0, 0}, data);
Mat subMat = test.submat(new Range[]{new Range(1,4), new Range(1,4), new Range(1,4)});
Mat subMatClone = subMat.clone();
short[] out1 = new short[27];
subMat.get(new int[] { 0, 0, 0 }, out1);
Log.i("INCORRECT", Arrays.toString(out1));
short[] out2 = new short[27];
subMatClone.get(new int[] { 0, 0, 0 }, out2);
Log.i("CORRECT", Arrays.toString(out2));
Issue submission checklist
- [o] I report the issue, it's not a question
- [o] I checked the problem with documentation, FAQ, open issues,
forum.opencv.org, Stack Overflow, etc and have not found solution - [o] I updated to latest OpenCV version and the issue is still there
- [o] There is reproducer code and related data files: videos, images, onnx, etc
Full disclosure: this bug was originally introduced in a PR from myself. The iOS implementation works - will prepare a PR to bring the Android implementation in line with the iOS implementation
Reactions are currently unavailable