Home > Enterprise >  Highlight the edges of part of picture in Python from 4 tuples with 2 values in each
Highlight the edges of part of picture in Python from 4 tuples with 2 values in each

Time:12-16

I am trying to highlight the barcode given in the picture. I am using DBR to decode the barcodes and DBR spits out the localization point in a list with 4 tuples inside and 2 values inside each tuple as shown below.

Localization Points: [(108, 136), (200, 136), (204, 154), (107, 154)]

This is how the picture looks like currently.

enter image description here

I want to be able to highlight the barcode based on the localization points given by DBR library. I found a very useful stackoverflow solution but it requires only 4 values instead of a tuple. If I manually put these values taken from the tuple then it will work like this.

enter image description here

Obviously I don't want to hardcode it. I used this image with highlight

  • Related