Is there any method to set a constant number of contour points for different images?

Viewed 129

Iam working on a project where I need a constant set of contour / land mark points. My input image is different types of clothes. And using x,y points i need to find out whether it is elbow points or shoulder points.. Can anyone suggest a method for this? Because I checked using contour detection , model classification of clothes. In contour iam getting different set of contour points for different clothes. For example, If I can findout contour[0] is elbow point ,then contour1 is shoulder point, I can do my algorithm very easily..I will attach some examples of my input with its points

Input example 1

[[[ 20 155]] [[ 88 239]] [[134 215]] [[146 327]] [[135 452]] [[361 451]] [[367 207]] [[418 233]] [[475 176]] [[472 160]] [[382 80]] [[301 55]] [[283 79]] [[255 86]] [[219 77]] [[201 51]] [[169 73]] [[120 83]]]

Input example 2

[[[352 36]] [[268 7]] [[259 25]] [[221 33]] [[185 24]] [[176 8]] [[ 91 35]] [[ 65 57]] [[ 13 170]] [[ 64 204]] [[100 201]] [[108 303]] [[ 84 471]] [[139 492]] [[273 493]] [[330 484]] [[354 467]] [[335 297]] [[341 193]] [[374 208]] [[425 174]] [[373 58]]]

In first image contour count is 18 and in second contour count is 22 and for both starting point of contour is different. Is there any way to findout the position of dress with its points?

#####################################UPDATE2#################################

Annotations I created for training using https://imglab.in/#

Annotated Image

Test result, enter image description here

1 Answers

The dlib's shape predictor should work for you. Train it for your images and it will give you a constant-size, ordered set of points.

For how to train it, Have a look at this Pyimagesearch tutorial.

Related