Detect trapezoids rather than (general) polygons

Hi all,

I need my model to segment pavement slabs into trapezoids in images like this:

I then hope to use the trapezoid coordinates to perform perspective correction on the image. The next step would be to identify specific slabs with their vein patterns.

I was also hoping to convince my model to segment all the slabs, given the regular pavement pattern.

I am thankful for all your suggestions!

Hi @metagic - thanks for posting!

I recommend:

  1. Labeling instance segmentation models with only ~4 points on each polygon.
  2. Expand the polygon just outside of the cracks (as that is the most noticeable feature and will improve detections).
  3. Run the model with a higher overlap threshold (will allow more objects to overlap).
  4. Use the perspective correction block in Workflows to take care of the trickiness there.

Thank you Jacob. I have removed all annotations that were not quadrilateral - still I get squiggly contours. This is with a YOLOv11 accurate instance model.

Given the poor image quality, the results are still encouraging, but I need the slabs to be rectangular (after perspective correction) for the feature matching stage.

Let’s try a different approach:

Suppose I had orthofotos with the pavement axis aligned to the image border, and the slabs were strictly annotated with the Bounding Box Tool, would I be sure to get rectangular segments?

Are there other more promising approaches?

Thank you for your help!

Hi @metagic ,

With inference 0.38.0 you will have extra parameter returned as result of dynamic_zones block

You can use that block to simplify your contours to contain only 4 vertices.

Hope this will help,
Grzegorz