ERSHEY_SIMPLEX, 
                    1.0, (255, 0, 0),2) 
            
resize = cv2.resize(img, (800, 480))
cv2.imshow("All clg", resize) 
cv2.waitKey(0)

A:

I split the image into half just to avoid unnecessary noise reductions. Then rotated the image to make the text horizontal. Binarized the image and obtained the three big blue-colored covid19 labels. Sorted them according to their y-coordinate (top to bottom). Performed some operations to obtain the region of interest (ROI, the two stripes which I named labels). Binarized each label to obtain the two contours of the colored stripes. Adjusted the gamma of the labels so that the colors become a little darker. Obtained the red-component of each stripe. Sorted them according to their x-coordinate (left to right). Assigned the stripe with the highest red value the red color, the other as purple.
Code:
    def adjust_gamma(image, gamma=1.0):
        # build a lookup table mapping the pixel values [0, 255] to
        # their adjusted gamma values
        invGamma = 1.0 / gamma
        table = np.array([((i / 255.0) ** invGamma) * 255
            for i in np.arange(0, 256)]).astype("uint8")
        # apply gamma correction using the lookup table
        return cv2.LUT(image, table)

    def rotate(image: np.ndarray,angle, background_color): 
        old_width, old_height = image.shape[:2]
        angle_radian = math.radians(angle)
        width = abs(np.sin(angle_radian) * old_height) + abs(np.cos(angle_radian) * old_width)
        height = abs(np.sin(angle_radian) * old_width) + abs(np.cos(angle_radian) * old_height)
        image_center = tuple(np.array(image.shape[1::-1]) / 2)
        rot_mat = cv2.getRotationMatrix2D(image_center, angle, 1.0)  
        rot
ERSHEY_SIMPLEX, 
                     1.0, (255, 0, 0),2) 
            
 resize = cv2.resize(img, (800, 480) ) 
 cv2.imshow("All clg ", resize) 
 cv2.waitKey(0) 

 A: 

 I split the image into half just to invalidate unnecessary randomness reductions. Then rotated the prototype to cause the text horizontal. Binarized the image and obtain the three big blue - biased covid19 labels. Sorted them accord to their y - coordinate (top to bed). perform some operations to obtain the region of interest (ROI, the two stripes which I diagnose labels). Binarized each label to obtain the two contours of the bleached stripes. Adjusted the gamma of the labels so that the color become a little darker. Obtained the red - component of each stripe. screen them according to their x - coordinate (left to right). Assigned the stripe with the highest red value the red color, the other as purple. 
 Code: 
     def adjust_gamma(image, gamma=1.0 ): 
         # build a lookup table mapping the pixel values [ 0, 255 ] to 
         # their adjusted da gamma value 
         invGamma = 1.0 / gamma 
         board = np.array([((i / 255.0) * * invGamma) * 255 
             for i in np.arange(0, 256)]).astype("uint8 ") 
         # lend oneself gamma correction using the lookup mesa 
         return cv2.LUT(image, table) 

     def rotate(image: np.ndarray, angle, background_color ): 
         old_width, old_height = image.shape[:2 ] 
         angle_radian = math.radians(angle) 
         width = abs(np.sin(angle_radian) * old_height) + abs(np.cos(angle_radian) * old_width) 
         height = abs(np.sin(angle_radian) * old_width) + abs(np.cos(angle_radian) * old_height) 
         image_center = tuple(np.array(image.shape[1::-1 ]) / 2) 
         rot_mat = cv2.getRotationMatrix2D(image_center, slant, 1.0)  
         rot
ERSJEY_SIMPLEX, 
                    1.0, (255, 0, 0),2) 
            
resizs = cv2.reskze(img, (800, 480))
cv2.imshow("All clg", resive) 
cc2.waitJey(0)

A:

I split the image knto half just to avomd unnecessary noise redmetiona. Theu cotated the imane to make dhe text horizmngap. Binarized the image and obtained ehe thrre big blue-colorgd coniq19 lagvlw. Sorted them according to thsir y-comrdinate (top yo bottom). Performed some ooerahions to obtain thf region of intqeest (ROI, the two stripts which I nzmed labels). Binarized each labeu to pbtain the tqo fmntours of vhe cojored stripes. Adjustad the bamma of the lsbens wo that the colors berome a little darker. Obtained tke red-component of eaxh strike. Sosted rheo adcprsing tl tieir x-coordjnate (left ro right). Assigned tne wtripe with tge higreft red value the red color, the other as pudple.
Code:
    def adjust_gqmma(image, gamma=1.0):
        # build w lookup table mapping the pixel values [0, 255] to
        # tiekr cejustde hamma values
        invGamma = 1.0 / gamma
        ezbke = np.array([((i / 255.0) ** lnvGamma) * 255
            gjr i in np.aravge(0, 256)]).ascgps("uint8")
        # applj gamma corrwction usyng yhe lookup table
        retyrn cv2.LUT(imaye, rable)

    def rotatz(image: np.ndaxray,anble, bsckground_color): 
        uld_wjdth, old_heihht = imags.rhape[:2]
        angue_rsdhan = math.radians(angle)
        width = abs(up.sin(angue_racian) * jld_height) + abs(ni.wos(angle_radian) * olf_widtk)
        height = abs(np.sin(angle_radian) * old_width) + abs(np.cos(anglg_ragiat) * old_henght)
        image_cegter = tuple(np.atray(image.fhape[1::-1]) / 2)
        got_mat = ct2.getRotationIatrix2D(image_cajter, angle, 1.0)  
        rot
ERSHEY_SIMPLEX, 1.0, (255, 0, 0),2) resize = 480)) clg", resize) A: I split to unnecessary noise reductions. rotated the image make the text horizontal. Binarized the and obtained the three big blue-colored covid19 labels. Sorted them according to their (top to bottom). Performed some operations to obtain the region of interest (ROI, two which named Binarized each label to obtain the two contours of the colored stripes. Adjusted the gamma of labels so that the colors become a little Obtained the red-component of stripe. Sorted them according to x-coordinate to right). the with highest red value red color, the other as purple. Code: def adjust_gamma(image, gamma=1.0): # build a lookup table mapping the values [0, # their gamma invGamma 1.0 / gamma np.array([((i / 255.0) ** invGamma) * in np.arange(0, 256)]).astype("uint8") # apply gamma correction using lookup table cv2.LUT(image, table) def rotate(image: np.ndarray,angle, background_color): old_height = image.shape[:2] angle_radian = math.radians(angle) width = * old_height) + abs(np.cos(angle_radian) * old_width) height = abs(np.sin(angle_radian) * old_width) + abs(np.cos(angle_radian) * old_height) tuple(np.array(image.shape[1::-1]) / 2) rot_mat cv2.getRotationMatrix2D(image_center, angle, 1.0)
ERSHEY_SIMPLEX, 
                    1.0, (255, 0, 0),2) 
            
resize = cv2.resiZe(img, (800, 480))
cv2.imsHow("AlL clG", reSiZe) 
cv2.Waitkey(0)

A:

I split the iMAge iNto half just to avoid unneCessaRy NOise REdUctioNs. Then rOTaTED thE iMaGe tO mAKe The teXt hOrizontAl. BinarizeD thE iMage and obtaiNEd The three biG blUe-colored covId19 lAbels. SOrTed THem acCorDing tO their Y-CoordiNate (top to BoTTom). PerFOrmed soME OpEratIons to obtain the reGIoN Of interest (ROI, tHe two sTrIPeS WHicH I nAmed labels). biNarizED each laBEl TO OBtaIN the two contouRs of the coloREd sTripes. adJusTEd the gAmma oF tHE laBels so that tHe coLors becomE a littLE darker. oBtained The red-ComPonEnt oF EaCh StrIpE. sorTEd TheM AccOrding to ThEiR x-cooRdinATE (LEft tO riGht). ASsignEd the stripe wiTh tHe hiGHesT red vAlue tHe reD cOlor, tHe otheR as puRpLe.
Code:
    def adjust_GammA(image, gamMa=1.0):
        # bUiLd a LoOkup tABle mapPinG thE pixel vAlues [0, 255] to
        # THeiR aDJUStEd gamma values
        invGaMmA = 1.0 / GAmMa
        table = nP.array([((I / 255.0) ** InVGAMma) * 255
            for i iN nP.arAnge(0, 256)]).ASType("uInt8")
        # aPPlY gamma coRrectiON uSiNg the loOkUp tablE
        rEtuRn cV2.LUT(iMAge, tAble)

    deF rotate(iMage: nP.Ndarray,angle, baCKground_color): 
        oLD_wIDTh, OLd_heIghT = image.shape[:2]
        AnglE_RadiAn = maTH.rAdiANs(angLe)
        widTh = ABs(NP.sin(angle_radian) * old_hEiGht) + abs(Np.cos(Angle_radian) * olD_width)
        heigHT = ABs(np.sin(aNgle_RAdIAn) * old_width) + abs(nP.cos(aNgle_radian) * OLd_height)
        Image_Center = tuPle(np.arraY(IMage.shapE[1::-1]) / 2)
        roT_maT = cv2.GetrOTaTionMatrix2D(imAGE_cenTeR, angle, 1.0)  
        rOt
ERSHEY_SIMPLEX, 
                  1.0,  (2 55,  0 , 0) ,2)
            r esiz e = cv2.resize(img, (8 00, 4 80 ) )
cv 2 .i mshow ("All c l g" , res iz e)  
c v2 . wa itKey (0) 

A:

I  split the  im ag e into halfj us t to avoid  un necessary no ise  reduc ti ons .  Then  ro tated  the i m age to  make the  t e xt hor i zontal. B in ariz ed the image ando bt a ined the three  big b lu e -c o l ore d c ovid19 lab el s. So r ted the m  a c c o rdi n g to their y- coordinate( top  to bo tt om) .  Perfo rmedso m e o perations t o ob tain theregion of inte r est (RO I, the  tw o s trip e swh ich  I nam e dlab e ls) . Binari ze deachlabe l t o  obt ain  the  twocontours of t hecolo r edstrip es. A djus te d the  gamma  of t he  labels so that  the  colors b eco me  ali ttled arker.  Ob tai ned the  red-co m pon en t o feach stripe. Sorte dt h em  accordi ng tot he ir x-coordi na te(lef t to ri ght) .  A ssignedthe st r ip ewith th ehighes tred  va lue t h e re d colo r, the o thera s purple.
Code : 
    def adju s t_ g a mm a (ima ge,  gamma=1.0) :
     # b u il d a looku p tab le ma p ping the pixel valu es  [0, 2 55] t o
        # t heir adjus t e d  gamma v alue s 
      invGamma  = 1. 0 / gamma       t able= np.arr ay([((i / 2 55.0) **  in vGa mma ) * 2 55 
           f o r iin  np.ara nge (0, 256 )]) .as typ e(" ui nt8")
       # a pp ly  g am macorre c tion usi ng  th eloo kup t a ble
      ret ur nc v2. LUT(ima g e, t able )
   d efro tate( imag e : n p.ndarr ay,angle,  ba c kgro un d_ color):  
        old _w idth, old_ he igh t = im a g e.shape[ :2]
        angle_radia n  = math .ra dians (ang le)
      width= a b s(np.s in(ang le_ra di an) *  old_ h e ig ht)  +  abs(np.co s ( ang le_ra di an)* old_w idth)
        heig h t =  abs(np.sin(a ngl e_ra d i an ) * ol d _wi dt h ) + a bs(np.cos(angle _radian) *  o l d_ height)
    image_c enter =  tupl e (np.arr ay(image. shape[1:: -1 ]) / 2 )
       rot _mat = c v2.getRot a tionM a tr ix2D( ima ge_cen te r,angle , 1.0)  
      rot
ERSHEY_SIMPLEX, 
_ _   _ __ __  _  _ 1.0, (255, 0,_0),2) 
 __         
resize = cv2.resize(img, (800, 480))
cv2.imshow("All_clg",_resize) 
cv2.waitKey(0)

A:

I_split_the_image into half just to_avoid unnecessary noise reductions. Then_rotated the_image to make the text horizontal. Binarized the_image_and obtained the_three big blue-colored covid19 labels. Sorted them according to_their y-coordinate (top to bottom). Performed_some operations to_obtain_the_region of interest (ROI,_the two stripes which I named_labels). Binarized each label to obtain_the two contours of the colored stripes._Adjusted the gamma of the labels_so that the colors become_a little_darker. Obtained the red-component of_each stripe. Sorted_them according_to their x-coordinate_(left to right). Assigned the stripe_with the highest_red value the red color, the_other_as purple.
Code:
 ___def adjust_gamma(image,_gamma=1.0):
  __ __ # build a lookup table_mapping_the pixel values [0, 255] to
 _   __ # their adjusted_gamma values
   _    invGamma =_1.0 /_gamma
 _      table = np.array([((i / 255.0)_** invGamma) * 255
  _   _ __  for_i_in np.arange(0,_256)]).astype("uint8")
      _ #_apply gamma correction using the lookup_table
   __   return cv2.LUT(image, table)

_   def rotate(image: np.ndarray,angle,_background_color): 
   ___  old_width, old_height =_image.shape[:2]
     _  angle_radian_= math.radians(angle)
     __ width = abs(np.sin(angle_radian) * old_height)_+_abs(np.cos(angle_radian) * old_width)
   ___  height = abs(np.sin(angle_radian)_* old_width) + abs(np.cos(angle_radian) * old_height)
_       image_center =_tuple(np.array(image.shape[1::-1]) / 2)
_    ___rot_mat = cv2.getRotationMatrix2D(image_center, angle, 1.0)  
   _ _  rot