Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void reconstruct(List<Mat> blocks) {
- int a = original.rows() / 8;
- int b = original.cols() / 8;
- Mat[][] blockArray = new Mat[b][a];
- for (int x = 0; x < a; x++) {
- for (int z = 0; z < b; z++) {
- int y = b * x;
- blockArray[x][z] = blocks.get(y + z);
- }
- }
- Mat result = new Mat(b * 8, a * 8, original.type());
- for (int y = 0; y < b; y++) {
- for (int x = 0; x < a; x++) {
- for (int m = 0; m < 8; m++) {
- for (int n = 0; n < 8; n++) {
- double[] values = blockArray[y][x].get(m, n);
- result.put(y * 8 + m, x + 8 * m, values);
- }
- }
- }
- }
- showResult(result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement