Finding SSIM between images on Maix Dock

I want to find the SSIM between an initial image and the current image. Using the image.get_similarity() command it returns a struct filled with ones (indicating the images are the same).
The documentation states that it returns a similarity struct comparing 8x8 pixels, but it doesn’t work even when setting the windowing to 8x8 (0,0,8,8).
The documentation also states that this function does not work on the OpenMV cam 4, but is this also true for the camera coming with the Maix Dock (OV2640)?
Does anyone know how the image.get_similarity() function works?
See my code added below.
Thanks in advance!

import sensor, image, lcd, time

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.set_windowing((224, 224))
sensor.set_vflip(0)
sensor.set_hmirror(0)
sensor.run(1)
lcd.clear()
lcd.init()
clock = time.clock()

img_init = sensor.snapshot()
while(True):
    img = sensor.snapshot()
    fps=clock.fps()
    clock.tick()
    a = lcd.display(img, oft=(0,0))
    ssim = img.get_similarity(img_init).min()
    lcd.draw_string(0, 0, "FPS: %.0f"%(clock.fps()), lcd.RED)
    lcd.draw_string(0, 16, "SSIM: %.4f"%(ssim), lcd.RED)
a = kpu.deinit(task)

I solved this by saving the initial image on the heap by using image.copy() instead of in the frame-buffer.

import sensor, image, lcd, time

sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.set_windowing((224, 224))
sensor.set_vflip(0)
sensor.set_hmirror(0)
sensor.run(1)
lcd.clear()
lcd.init()
clock = time.clock()

img = sensor.snapshot()
img_init = img.copy()
while(True):
    img = sensor.snapshot()
    fps=clock.fps()
    clock.tick()
    a = lcd.display(img, oft=(0,0))
    ssim = img.get_similarity(img_init).mean()
    lcd.draw_string(0, 0, "FPS: %.0f"%(clock.fps()), lcd.RED)
    lcd.draw_string(0, 16, "SSIM: %.4f"%(ssim), lcd.RED)
a = kpu.deinit(task)