Update app.py
Browse files
app.py
CHANGED
|
@@ -419,7 +419,7 @@ def allLevelsofColor(BlackmaskDetected,img,levelonly, invertedmask,color,finalCo
|
|
| 419 |
(firstLevel[:, :, 1] == 0) &
|
| 420 |
(firstLevel[:, :, 2] == 0)
|
| 421 |
)
|
| 422 |
-
|
| 423 |
# set those pixels to white
|
| 424 |
firstLevel[black_pixels] = [255, 255, 255]
|
| 425 |
firstLevel1=cv2.bitwise_and(levelonly,firstLevel)
|
|
@@ -429,9 +429,10 @@ def allLevelsofColor(BlackmaskDetected,img,levelonly, invertedmask,color,finalCo
|
|
| 429 |
|
| 430 |
if othercolor.all()!=color.all():
|
| 431 |
|
| 432 |
-
masked0=DetectColor(
|
| 433 |
pil_image0=Image.fromarray(masked0)
|
| 434 |
extrema0 = pil_image0.convert("L").getextrema()
|
|
|
|
| 435 |
if extrema != (0, 0): # if image is not black --> has a colored mask within
|
| 436 |
ColoredContour0, Coloredhierarchy0 = cv2.findContours(masked0, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
|
| 437 |
for cnt in ColoredContour0:
|
|
|
|
| 419 |
(firstLevel[:, :, 1] == 0) &
|
| 420 |
(firstLevel[:, :, 2] == 0)
|
| 421 |
)
|
| 422 |
+
print('xcvbn')
|
| 423 |
# set those pixels to white
|
| 424 |
firstLevel[black_pixels] = [255, 255, 255]
|
| 425 |
firstLevel1=cv2.bitwise_and(levelonly,firstLevel)
|
|
|
|
| 429 |
|
| 430 |
if othercolor.all()!=color.all():
|
| 431 |
|
| 432 |
+
masked0=DetectColor(firstLevel,othercolor)[0]
|
| 433 |
pil_image0=Image.fromarray(masked0)
|
| 434 |
extrema0 = pil_image0.convert("L").getextrema()
|
| 435 |
+
print('jknjfnskjvsjgs')
|
| 436 |
if extrema != (0, 0): # if image is not black --> has a colored mask within
|
| 437 |
ColoredContour0, Coloredhierarchy0 = cv2.findContours(masked0, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
|
| 438 |
for cnt in ColoredContour0:
|