I have python script and I try to rewrite it using pythonnet in .net. This But i confuse how to convert this line in python to .net?
contours = sorted(contours, key = cv2.contourArea, reverse = True)[:10]
CodePudding user response:
using System.Linq;
var sorted = contours
.OrderByDescending(c => c.ContourArea)
.Take(10);