0

I'm writing a script for symbol recognition using openCV. The aim is to get engineering schematics such as P&IDs and detect the different symbols within them. As of now I've successfully implemented the part of the code which gets the wanted template and then uses the matchTemplate() function to find potential matches. I'm currently taking the desired symbol, crop it in the dimensions of the potential matches and then use it with matchTemplate() to find the matches.

The problem is that I don't get the desired performance as some matches, especially concerning valves, are falsely detected. Different types of valves are being recognized as the same. For example, below my template is this and the this the output I'm getting. I'd like to know if there is a way to improve the performance without using machine learning?

This is a picture of the function I'm using for finding matches:

picture of code

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
thedoris
  • 1
  • 1
  • 2
    Please the code as text not an image. – toyota Supra Aug 09 '22 at 09:17
  • and yet another one who follows bad advice regarding `matchTemplate`. use `TM_SQDIFF`. look at https://stackoverflow.com/questions/73177065/deno-template-matching-using-opencv-gives-no-results/73178549#73178549 – Christoph Rackwitz Aug 09 '22 at 10:19
  • If your tool reports a matching score, check if that score is able to discriminate. –  Aug 09 '22 at 10:35

0 Answers0