Skip to content

Commit

Permalink
Fix coordinate for img comb
Browse files Browse the repository at this point in the history
  • Loading branch information
SUMMERLOVE7 authored Dec 10, 2022
1 parent 993730f commit 717ec90
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/jamoComb6.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@ 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: #첫번째 종성이 ㄱ, ㅂ일때 -> 가능한 경우는 ㄳ, ㅄ
if(0 < k+1 < 10): strk="0"+str(k+1)
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)
Expand All @@ -58,15 +58,15 @@ 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)
elif k == 3: #첫번째 종성이 ㄴ일때 -> 가능한 경우는 ㄵ, ㄶ
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)
Expand All @@ -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)
Expand Down

0 comments on commit 717ec90

Please sign in to comment.