thank you so much for the code. very kind of you to post it. looks like you have an array bounds mismatch. in_image.size() is larger than output_image. on line 45 it will run off the end of output_image.