From 717ec90bed6d3f09edd68793f30d321613632f60 Mon Sep 17 00:00:00 2001 From: "MinJi.CH" <81309465+SUMMERLOVE7@users.noreply.github.com> Date: Sat, 10 Dec 2022 14:10:45 +0900 Subject: [PATCH] Fix coordinate for img comb --- src/jamoComb6.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/jamoComb6.py b/src/jamoComb6.py index ede1bef..967c10c 100644 --- a/src/jamoComb6.py +++ b/src/jamoComb6.py @@ -31,17 +31,17 @@ def jamoComb6(): src4 = cv2.imread('./crop/'+str(k)+'.png') #첫번째종성 rows, cols, channels = src2.shape #로고파 일 픽셀값 저장 - roi = src1[50:rows+50,50:cols+50] #로고파일 픽셀값을 관심영역(ROI)으로 저장함. + #roi = src1[50:rows+50,50:cols+50] #로고파일 픽셀값을 관심영역(ROI)으로 저장함. gray = cv2.cvtColor(src2, cv2.COLOR_BGR2GRAY) #로고파일의 색상을 그레이로 변경 - src1[15:rows+15, 80:cols+80] = src2 + src1[20:rows+20, 60:cols+60] = src2 #cv2.imshow('jaem', src1) width, height = src3.shape[:2] - src1[70:width+70,70:70+height] = src3 + src1[75:width+75,50:50+height] = src3 #cv2.imshow('moem', src1) width, height = src4.shape[:2] - src1[115:width+115, 40:40+height] = src4 + src1[110:width+110, 20:20+height] = src4 #cv2.imshow('jong1', src1) if k == 1: #첫번째 종성이 ㄱ, ㅂ일때 -> 가능한 경우는 ㄳ, ㅄ @@ -49,7 +49,7 @@ def jamoComb6(): else: strk=str(k+1) src5 = cv2.imread('./crop/10.png') #두번째종성 ㅅ width, height = src5.shape[:2] - src1[115:width+115, 100:100+height] = src5 + src1[110:width+110, 80:80+height] = src5 #cv2.imshow('jong2', src1) #cv2.imwrite(path+'/letter'+stri+'_'+strj+'_'+strk+'_1.png', src1) cv2.imwrite(path+'/letter'+str(i).zfill(3)+"_"+ str(j-19).zfill(4)+"_"+str(k+1).zfill(3)+"_"+str(1).zfill(3) + ".png", src1) @@ -58,7 +58,7 @@ def jamoComb6(): else: strk=str(k+1) src5 = cv2.imread('./crop/10.png') #두번째종성 ㅅ width, height = src5.shape[:2] - src1[115:width+115, 100:100+height] = src5 + src1[110:width+110, 80:80+height] = src5 #cv2.imshow('jong2', src1) #cv2.imwrite(path+'/letter'+stri+'_'+strj+'_'+strk+'_1.png', src1) cv2.imwrite(path+'/letter'+str(i).zfill(3)+"_"+ str(j-19).zfill(4) +"_"+str(k).zfill(3)+"_"+str(1).zfill(3)+ ".png", src1) @@ -66,7 +66,7 @@ def jamoComb6(): for l in [13,19]:#두번째 종성 ㅈ,ㅎ src5 = cv2.imread('./crop/'+str(l)+'.png') #두번째종성 width, height = src5.shape[:2] - src1[115:width+115, 100:100+height] = src5 + src1[110:width+110, 80:80+height] = src5 #cv2.imshow('jong2', src1) if l == 13: cv2.imwrite(path+'/letter'+str(i).zfill(3)+"_"+ str(j-19).zfill(4)+"_"+str(k).zfill(3)+"_"+str(1).zfill(3) + ".png", src1) @@ -78,7 +78,7 @@ def jamoComb6(): for l in [1,7,8,10,17,18,19]: src5 = cv2.imread('./crop/'+str(l)+'.png') #두번째종성 width, height = src5.shape[:2] - src1[115:width+115, 100:100+height] = src5 + src1[110:width+110, 80:80+height] = src5 #cv2.imshow('jong2', src1) if l==1: cv2.imwrite(path+'/letter'+str(i).zfill(3)+"_"+ str(j-19).zfill(4)+"_"+str(k).zfill(3)+"_"+str(1).zfill(3) + ".png", src1)