This warning message indicates that there is an issue with the calculation of the square root of a negative number, which is not a valid operation. The code is trying to calculate the distance between two objects based on their actual size and their size in pixels, using the focal length of the camera. However, the calculation is resulting in a negative number for the actual area or the pixel area, which is causing the error. To fix this issue, you may want to check the input values and make sure they are valid before performing the calculation

CUsersAdminDesktoppythonProject1distancepy14 RuntimeWarning invalid value encountered in sqrt distance = focal_length npsqrtactual_area npsqrtpixel_area

原文地址: https://www.cveoy.top/t/topic/fZCB 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录