-2

[Image to be cropped:] (https://i.stack.imgur.com/hzYzG.png)

[Expected Image:] (https://i.stack.imgur.com/yzuj2.png)

I have implemented manual ROI cropping into the algorithm, but it needs to be automated. Tried to use colors for ROI identification but was not successful. The route needs to be extracted for further image processing.

Any help will be deeply appreciated.

1 Answers1

1

Here is a sketch how to achieve this:

  1. Convert your image to HSV colour space and evaluate the parts with high saturation: https://stackoverflow.com/a/47343587/18667225
  2. If needed remove irrelvant noise with morphological image processing as explained here: https://stackoverflow.com/a/30380543/18667225
  3. Get the bounding box of the remaining mask and crop it as discussed here: https://stackoverflow.com/a/60869657/18667225
Markus
  • 5,976
  • 5
  • 6
  • 21