Used wrong image for calculation, should use gray