Page 969 - 3-3
P. 969

if neiList is plate:
                                            #plate 가 이웃 리스트와 같으면
                                                flag=False
                                                # 더 이상 비교x
                                        if flag==True:
                                        #True 로 유지되고 있으면
                                            plateList.append(neiList)
                                            #plateList 에 이웃 추가
                                            currentList=neiList
                                            # 이웃을 현재 리스트로 설정


                                    if len(plateList)>=4:break
                                    # 길이가 4  개 이상이면 더 이상 비교x
                                if len(plateList)>=4:
                                 # 길이가 4  개 이상이면 더 이상 비교x
                                    if plateList[0][0]+plateList[0][2]-plateList[3][0]<plateList[0][2]*5.5:
                                    # 과학지의 알고리즘대로 비교한다
                                        break
                                        # 맞다면 더 이상 비교 x


                            if len(plateList)<4:
                             # 추출한 번호판의 길이가 4         보다 적다면
                                print("Don't find plate!")
                                continue
                                # 다시 시도
                                          for i in plateList:
                            # 추출한 번호판을 에i        1 개씩 넣는다
                                startPos=(i[0],i[1])
                                # 사각형의 왼쪽 위 꼭짓점 지정
                                endPos=(i[0]+i[2],i[1]+i[3])
                                # 사각형의 오른쪽 아래 꼭짓점 지정


                            roFlag=True
                            # 어느 방향으로 각도를 계산할지 정하는 플래그
                            dx=plateList[0][0]-plateList[3][0]
                            #x 증가량
                            dy=abs(plateList[0][1]-plateList[3][1])
                            #y 증가량
                            if plateList[0][1]<plateList[3][1]:roFlag=False
                            #y 축을 비교하여 어느 방향으로 각도를 구할지 계산
                            inCl=dy/dx
                            # 기울기를 계산한다
                            atan=math.atan(inCl)
                            # 아크 탄젠트를 이용하여 각도를 구한다
                            atan=math.degrees(atan)


                                                         - 969 -
   964   965   966   967   968   969   970   971   972   973   974