title: When applying the Canny function, can you apply the mask first?
body: <p>I have been learning about the Canny Edge Detection function, the Hough Transform and masking to select a particular set of edges in an image.</p>
  
  <p>I was just wondering - I've seen people apply those two functions first and the mask second. Would applying the mask first improve performance?</p>
  
  <p>Surely if you only apply the Canny function and Hough transform on the masked region that would be faster than applying them to the entire region and then picking the masked region. But perhaps I am misunderstanding. </p>
  
  <p>I am not sure if it's relevant, but I am using Python and the OpenCV library. I am aware that its functions cannot operate on a subset of the image. But I'd like to understand why that is the case.</p>