Hi,
I want to convert the below lines written in python to c++,
# find the contours in the thresholded image, then sort the contours
# by their area, keeping only the largest one
(_,cnts, _) = cv2.findContours(closed.copy(), cv2.RETR_EXTERNAL,
cv2.CHAIN_APPROX_SIMPLE)
c = sorted(cnts, key = cv2.contourArea, reverse = True)[0]
the full code is available over here,
http://www.pyimagesearch.com/2014/11/24/detecting-barcodes-images-python-opencv/
can anybody help me how i could write it in c++ mainly the sorting part.
Thanks in advance.
↧