为您找到相关结果19,541个
关于C++的强制类型转换浅析_C 语言_脚本之家
1 double slope = static_cast<double>(j) / i; 当static_cast需要把一个较大的算术类型赋值给较小的类型时,static_cast非常有用。此时,强制类型转换告诉程序的读者和编译器:我们知道并且不在乎潜在的精度损失。一般来说,如果编译器发现一个的算术类型试图赋值给较小的类型,就会给出警告信息;但是当我们执行了...
www.jb51.net/article/1233...htm 2024-10-27
Android开发实现的几何图形工具类GeometryUtil完整实例_Android_脚本...
* The slope of line which cross the pMiddle. * @return */ publicstaticPointF[] getIntersectionPoints(PointF pMiddle,floatradius, Double lineK) { PointF[] points =newPointF[2]; floatradian, xOffset =0, yOffset =0; if(lineK !=null) { ...
www.jb51.net/article/1277...htm 2024-10-28
python+opencv实现车道线检测_python_脚本之家
slope = [(y2 - y1) / (x2 - x1) for line in after_lines for x1, x2, y1, y2 in line] # 获得斜率数组 while len(after_lines) > 0: mean = np.mean(slope) # 计算平均斜率 diff = [abs(s - mean) for s in slope] # 每条线斜率与平均斜率的差距 idx = np.argmax(diff) # ...
www.jb51.net/article/2059...htm 2024-10-30
C++ opencv实现车道线识别_C 语言_脚本之家
slopes.push_back(slope); selected_lines.push_back(i); } } // Split the lines into right and left lines img_center = static_cast<double>((img_edges.cols / 2)); while (j < selected_lines.size()) { ini = cv::Point(selected_lines[j][0], selected_lines[j][1]); fini = cv:...
www.jb51.net/article/2059...htm 2024-10-29
.dcm格式文件软件读取及python处理详解_python_脚本之家
dcm.image = dcm.pixel_array * dcm.RescaleSlope + dcm.RescaleIntercept slices = [] slices.append(dcm) img = slices[int(len(slices) / 2)].image.copy() ret, img = cv2.threshold(img, 90, 3071, cv2.THRESH_BINARY) img = numpy.uint8(img) im2, contours, _ = cv2.findContours(img, ...
www.jb51.net/article/1786...htm 2024-11-4
Python利用3D引擎制作一个3D迷宫游戏_python_脚本之家
5: # walk up slope self.y = ray.world_point[1] return else: self.grounded = False # if not on ground and not on way up in jump, fall self.y -= min(self.air_time, ray.distance-.05) * time.dt * 100 self.air_time += time.dt * .25 * self.gravity def input(self, key)...
www.jb51.net/article/2718...htm 2024-11-2