blob: 82f0e6aa0a5939fdff0ec164eea227e9fe9b94e5 [file]
#-------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
#-------------------------------------------------------------
input_linearized = read($in_file);
input = read($in_file_second);
value =$value;
rows_linear = nrow(input_linearized);
cols_linear = ncol(input_linearized);
img = matrix(input_linearized, rows=rows_linear, cols=cols_linear);
img_two=matrix(input, rows=nrow(input), cols=ncol(input));
img_out = img_sample_pairing_linearized(img,img_two,value)
write(img_out, $x_out_file);
img_out_batched= matrix(0, rows=rows_linear, cols=cols_linear);
for(i in 1:rows_linear) {
image_i = matrix(img[i,], rows=1, cols= cols_linear);
img_out = img_sample_pairing(image_i,img_two,value);
img_out_batched[i,] = matrix(img_out, rows=1, cols=cols_linear);
}
write(img_out_batched,$x_out_reshape_file);