forked from ArtyZe/yolo_segmentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Merge.py
32 lines (27 loc) · 761 Bytes
/
Merge.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#coding=utf-8
"""
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# fileName : Merge.py
# comment : Merge the Original Picture and Ouput Picture
# version :
# author : ArtyZe
# date :
#
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"""
import cv2
def Merge(img,img1):
height,width, c = img1.shape
for c in range(c):
for i in range(0, height):
for j in range(0, width):
if(img[i,j] >90):
#here 90 is Threshold for heatmap
#print im1[i,j]
img1[i,j,1] = 100+img1[i,j,1]
cv2.imwrite("final.png",img1)
return img1
im = cv2.imread("pred.png",cv2.IMREAD_GRAYSCALE)
im1 = cv2.imread("orig.png")
Merge(im, im1)