多边形分析程序

py2pyAnalysis的Python项目详细描述


多边形分析

我们的目标是构建一个足以分析多边形并返回一些有用信息(如角度、坡度、边、角坐标等)的模块,因此我们构建py2pyanalysis。两行代码足以分解多达15条边的多边形。有关模块的概述,请考虑此页已足够,如果您对程序背后的工作感兴趣,请访问py2py


文档

让我们来看看,

polygon_analysis(file_name,show_and_save_contour='yes',show_and_save_analysis='yes',show_sides='yes',show_angles='yes',show_slope='yes',show_name='yes',save_data_to_csv='yes',font=cv2.FONT_HERSHEY_PLAIN)
  • file_name : as clear from the name, it takes a file name, if the file is in the same directory then you can simply type name, else type the full path to the file.
  • show_and _save_contour : it allows you to see the various shapes that program detects in the image, it will also save the image file in a folder to Data/file_name_analysis/contour image. Everything that saves during the program related to this file will save in this particular folder only.
  • show_and_save_analysis : it allows you to see the numerical data on the image itself. the data includes Sides, Angles, and Slope. also, the name of an image will also be written there, The image will also save in the same directory as above.
  • Show_angles : This will show the angles on the image, changing it to NO will result to not showing angles on the image.
  • Show_slope : This will show the Slope on the image, changing it to NO will result to not showing Slope on the image.
  • font : you can change the Font if you want, Here is the list of some fonts
cv2.FONT_HERSHEY_SIMPLEXcv2.FONT_HERSHEY_PLAIN,cv2.FONT_HERSHEY_DUPLEXcv2.FONT_HERSHEY_COMPLEXcv2.FONT_HERSHEY_TRIPLEXcv2.FONT_HERSHEY_COMPLEX_SMALLcv2.FONT_HERSHEY_SCRIPT_SIMPLEXcv2.FONT_HERSHEY_SCRIPT_COMPLEX

此程序返回

return(len(sides),sides,distance,slope,angles,Name)
  • len(sides): : Number of sides in a detected Polygon.
  • Sides : Tit returns the coordinates of the shape. Side[0] is the first [x,y] set. Similarly side[0][0] & side[0][1] will give you first x and y point respectivelly.
  • Distances : It returns the distance between two points in pixels.
  • Slope : It returns back the slope values corresponds to each side.
  • Angle : It returns back an array of angles.
  • Name : It returns back the name of the shape.

如果您在任何时候忘记了后面的,请键入

importpy2pyAnalysisaspypy.help()

它将为您带来下面的代码

#https://pypi.org/project/py2pyAnalysis/#https://github.com/Pushkar-Singh-14/Polygon-Analysis#http://py2py.com/polygon-analysis-overview-and-explanation/Number_of_sides,Coordinates,Distance_in_pixels,Slopes,Angles,Names=py.polygon_analysis(file_name,show_and_save_contour='yes',show_and_save_analysis='yes',show_sides='yes',show_angles='yes',show_slope='yes',show_name='yes',save_data_to_csv='yes',font=cv2.FONT_HERSHEY_PLAIN)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java Spring freemarker多模板加载程序路径   在java插件中从控制台获取输入   java在包中创建继承类   网页抓取Java Jsoup网页抓取   java在线程内创建一个对象,而true条件具有相同的引用   java如何根据空格数拆分字符串   java新的安卓 studio更新中的配置文件“app”是什么?   java在将ArrayList写入/读取到文件时出现奇怪的问题   java Reg替换文本块第一次出现+最后一次出现   java当我单击任何RecyclerView列表项时,如何在MainActivity的EditText中显示特定的单击项?   JAVA XML删除节点仅删除第一个外观   java如何在数组中查找特定值   java SVG/矢量图形对象布尔运算(并集、交集、减法)   java在Android中创建线程需要多长时间   尝试从JBOSS联系Oracle LDAP服务器时发生java连接重置异常   java基于参数获取特定的实现实例   使用java就地修改文件内容   java MonetaryException:未加载MonetaryAmountsSingletonSpi   java接受用户的不同输入并使其触发完全相同的代码段的最短方法是什么   Spring 3.2.8应用程序中未找到java HTTP 404错误