0

In Android, I have:

1) matrix (size is 257x257, float[257][257], each element represents a parameter to the image pixel); 2) image(size is nx257, nx257, bytearray[n*257][n*257]n is float, >=1)

How can I scale matrix to image size,repeat element and like below: e.g.:

origin matrix:
1 2  
3 4  

scale double to:

Target matrix:
1 1 2 2
1 1 2 2
3 3 4 4
3 3 4 4

If n*257 is not an integer, the edge is allowed to be inaccurate. I know Python numpy how to do it,but in java/android,I haven't found a way to be efficient. Can anyone help me? Thank you!

2
  • you have to manually create a new matrix with multiplied size, and then iterate through it filling it. Commented Nov 12, 2019 at 11:22
  • If you haven't found an efficient way then what have you found? Would be interesting to know so we don't suggest something you consider inefficient. Commented Nov 12, 2019 at 12:00

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.