title: How to blur red color in image with python opencv so that its not clearly visible?
body: <p>I want to blur red color in image (&quot;1.png&quot; is attached) so that its not clearly visible. I tried below code where I can change red color to black color but how can I blur it? Please help.</p>
  <pre><code>import cv2
  import numpy as np
  
  frame = cv2.imread(&quot;1.png&quot;)
  
  hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
  # define range of red color in HSV
  lower = np.array([0,50,50])
  upper = np.array([10,255,255])
  
  # define range of blue color in HSV
  # lower = np.array([38, 86, 0])
  # upper = np.array([121, 255, 255])
  
  # define range of pink color in HSV
  # http://www.workwithcolor.com/pink-color-hue-range-01.htm
  # lower = np.array([158, 127, 0])
  # upper = np.array([179, 255, 255])
  
  # Threshold the HSV image to get only red colors
  mask = cv2.inRange(hsv, lower, upper)
  color_only = cv2.bitwise_and(frame, frame, mask = mask)
  
  # convert mask to 3-channel image to perform subtract
  mask = cv2.cvtColor(mask, cv2.COLOR_GRAY2BGR)
  res = cv2.subtract(frame, mask) #negative values become 0 -&gt; black
  cv2.imshow(&quot;frame&quot;, frame)
  # cv2.imshow(&quot;mask&quot;, mask)
  # cv2.imshow(&quot;color_only&quot;, color_only)
  cv2.imshow(&quot;res&quot;, res)
  cv2.waitKey()
  cv2.destroyAllWindows()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/MyOJi.png" rel="nofollow noreferrer">1.png</a></p>