简体   繁体   English

将 python 中的 stored()[:10] function 转换为 .net 语法 (pytho.net)

[英]convert stored()[:10] function in python to .net syntax (pythonnet)

I have python script and I try to rewrite it using pytho.net in .net. This But i confuse how to convert this line in python to .net?我有 python 脚本,我尝试在 .net 中使用 pytho.net 重写它。但是我很困惑如何将 python 中的这一行转换为 .net?

contours = sorted(contours, key = cv2.contourArea, reverse = True)[:10]

using System.Linq;使用 System.Linq;

var sorted = contours
  .OrderByDescending(c => c.ContourArea)
  .Take(10);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM