0

I am trying to crop the image , but within that process the edges of that images seems to come in the zig-zag pattern , is there a way i can smooth this ?

I have the coordinates value of each point in zig zag line, is there a way we can solve this mathematically rather than using opencv ?

Image with zigzag edges

[[256, 265], [128, 278], [128, 278], [41, 286], [49, 384], [49, 384], [53, 425], [119, 419], [115, 413], [110, 408], [128, 406], [128, 406], [256, 395], [256, 395], [292, 391], [292, 384], [292, 384], [294, 309], [294, 309], [293, 309], [294, 262], [256, 265], [256, 265]]

Aman RAJ
  • 87
  • 1
  • 5
  • there are many different ways to do this. You can use ```blur``` function and if you need binary image - use ```inRange``` again. You can ```erode``` or ```dilate``` it. Or you can try to find the contour (can be tuned so there won't be the edges) of the blob and represent the contour as binary image – crackanddie May 03 '23 at 11:41
  • yeah as a starting i tried gaussian blur, along with erode and dilate but that does not seems to work – Aman RAJ May 03 '23 at 12:08
  • I think there are many similar questions. Check the [following post](https://stackoverflow.com/questions/41138000/fit-quadrilateral-tetragon-to-a-blob) for example. – Rotem May 03 '23 at 16:46
  • all of them are using opencv only which does not give more accurate results which need lot of trial and error , i would prefer using some mathematical to solve it as i have all the point on the zig zag line, i saw scipy interpolate but could not make anything out of it – Aman RAJ May 05 '23 at 08:56

0 Answers0