I'm having trouble cropping out the pink line on the image. Ideally, I want to crop it the entire pink stretch, it's okay if the blue is included.
What I did
import cv2
import numpy as np
from PIL import Image, ImageFilter
#convertes image to hsv and applies blur
img = cv2.imread("1501.jpg")
hsv = cv2.cvtColor(img, cv2.COLOR_RGB2RGB)
fin = cv2.GaussianBlur(hsv,(25,25),cv2.BORDER_DEFAULT)
#divided the image in half to see the target
na = np.array(fin)
orig = na.copy()
m = orig.shape[0]
n = orig.shape[1]/2
M = int(m)
N = int(n)
tiles = [orig[x:x+M,y:y+N] for x in range(0,orig.shape[0]) for y in range(0,orig.shape[1],N)]
variable = tiles[0]
Image.fromarray(variable).save('variable.jpg')
#extracts color from the target
hsv_lower = (300,2.2,71)
hsv_upper = (326,41,32.5)
mask = cv2.inRange(variable, hsv_lower, hsv_upper)
What to do next I'm not sure what to do next, and am unsure if I'm even capturing the pink line in the first place. Python3 solutions are preferred.