Scoreboard for Edge Detector

Hello everyone!
I have to develop a uvm test environment for an edge detector.
Algorithm of my edge detector consist in the calculation of the gradient of an image.

My input transaction is formed by 3 fields that are 3 input 8-bit rgb (red,green e blue) on which the edge detector performs this algorithm.
(Red,green and blue originate from a txt file that contains a matrix of pixels 1366x768)

class rgb_inputs extends uvm_sequence_item;
  rand logic[7:0] red;
  rand logic[7:0] green;
  rand logic[7:0] blue;

The algorithm is

I = red + green + blue;
for i=1:size(I,1)-2
for j=1:size(I,2)-2
%Sobel mask for x-direction:
%Sobel mask for y-direction:
%The gradient of the image

Therefore Dut,to process one output needs to work on previous transaction.
My problem is in the implementation of scoreboard.
I used the approach with which I compose the scoreboard with comparator and predictor but while in a standard situation the predictor produces the output according to a single input transaction Here I need it keeps the memory even of the previous transaction (because I(i,j) depends from red(i,j),green(i,j) and blue(i,j) and I(i+1,j) from red(i+1,j) etc…).

My idea was to allocate an array in the predictor for saving the entire matrix of input pixels and
then process the outputs.
I can do it?
If there is a way to do it, then how do you sync the corresponding outputs of the DUT with the corresponding outputs of the predictor?