I am trying to do image processing using NumPy and scipy . I have a template image corresponding to the background, and I want to find out all the places where it appears in the input image and set the corresponding array positions in the output file to 1, otherwise set them to 0. How can I do this?
You can use scipy.ndimage.correlate to correlate your template with the image. Then find the bright spots that your matches will give you. Example:
import scipy.ndimage from numpy import mean, std # a, b contain image and template in numpy arrays correlation = scipy.ndimage.correlate(a, b) matches = (correlation-mean(correlation)) > 5*std(correlation) # tune depending on level of noise
Source: https://habr.com/ru/post/889545/More articles:search for subscriptions in lists with display / selection in math - listWhy can't I save model instances after editing them? - djangoPHP: memory_get_peak_usage (false) when should I use true? - phphttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/889542/wcf-data-contracts-with-base-class-and-derived-classes-what-are-the-consequences-of-changes-to-the-base-class&usg=ALkJrhhxHIyHeEDcUtMubtaOXZqxybOpugConfused by using hostname in WSDL file on C # web service - c #Get form name from iframe using AutoIt - htmlAbsolute positioning - cssWhy does haproxy path_beg only work if I donβt visit the site by default? - apacheGetting command line input while listening for connections in Python - pythonNotification from IntentService - NullPointerException on getting context - androidAll Articles