Thanks @SrikanthS, I also had the problem of the wrong headers being included when building my OpenCV dependent library and had this inv_scale_x > 0 in function 'cv::resize'
even though my arguments were fine. Evidently it was due to the arguments getting corrupted when calling the resize function. In my case I was in Ubuntu Linux had 2 versions of OpenCV installed - one which I compiled from source, 4.10, and another which was installed from the Ubuntu package manager, 4.2. Rebuilding with the correct include path (i.e. g++ $SRC -I/path/to/correct/include/opencv2
) fixed it.