400 028 6601

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

cv2.ellipse()怎么使用

本篇内容介绍了“cv2.ellipse()怎么使用”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

创新互联是专业的北关网站建设公司,北关接单;提供网站建设、成都网站制作,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行北关网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

OpenCV-Python是旨在解决计算机视觉问题的Python绑定库。cv2.ellipse()方法用于在任何图像上绘制椭圆。

cv2.ellipse(image, centerCoordinates, axesLength, angle, startAngle, endAngle, color [, thickness[, lineType[, shift]]])

参数:

返回值:它返回一个图像。

用于以下所有示例的图像:
cv2.ellipse()怎么使用

示例1:

# Python program to explain cv2.ellipse() method  
    
# importing cv2  
import cv2  
    
# path  
path = r'C:\Users\Rajnish\Desktop\geeksforgeeks\geeks.png'
    
# Reading an image in default mode 
image = cv2.imread(path) 
    
# Window name in which image is displayed 
window_name = 'Image'
   
center_coordinates = (120, 100) 
  
axesLength = (100, 50) 
  
angle = 0
  
startAngle = 0
  
endAngle = 360
   
# Red color in BGR 
color = (0, 0, 255) 
   
# Line thickness of 5 px 
thickness = 5
   
# Using cv2.ellipse() method 
# Draw a ellipse with red line borders of thickness of 5 px 
image = cv2.ellipse(image, center_coordinates, axesLength, 
           angle, startAngle, endAngle, color, thickness) 
   
# Displaying the image  
cv2.imshow(window_name, image)

输出:
cv2.ellipse()怎么使用

示例2:
使用-1 px的厚度和30度的旋转。

# Python program to explain cv2.ellipse() method 
    
# importing cv2 
import cv2 
    
# path 
path = r'C:\Users\Rajnish\Desktop\geeksforgeeks\geeks.png'
    
# Reading an image in default mode 
image = cv2.imread(path) 
    
# Window name in which image is displayed 
window_name = 'Image'
   
center_coordinates = (120, 100) 
  
axesLength = (100, 50) 
  
angle = 30
  
startAngle = 0
  
endAngle = 360
   
# Blue color in BGR 
color = (255, 0, 0) 
   
# Line thickness of -1 px 
thickness = -1
   
# Using cv2.ellipse() method 
# Draw a ellipse with blue line borders of thickness of -1 px 
image = cv2.ellipse(image, center_coordinates, axesLength, angle, 
                          startAngle, endAngle, color, thickness) 
   
# Displaying the image 
cv2.imshow(window_name, image)

输出:
cv2.ellipse()怎么使用

“cv2.ellipse()怎么使用”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注创新互联网站,小编将为大家输出更多高质量的实用文章!


网站栏目:cv2.ellipse()怎么使用
当前网址:http://www.bluegullmedia.com/article/jpiiph.html

其他资讯

让你的专属顾问为你服务

0.0426s