프로젝트

일반

사용자정보

개정판 31520934

ID315209348ed6b60b9857fb2c8a660eb9f0f56636
상위 bb942cdc
하위 fc72e116

백흠경이(가) 6년 이상 전에 추가함

fixed issue #479:
- Equipment가 중복되어 인식되는 오류

차이점 보기:

DTI_PID/DTI_PID/DTI_PID.py
390 390
            loc = np.where(tmRes >= symbolThreshold)
391 391

  
392 392
            for pt in zip(*loc[::-1]):
393
                overlapArea = 0
394 393
                mpCount = 0 # Match Point Count
395
                symbolIndex = -1
396 394

  
397 395
                roi = roiItem[pt[1]:pt[1]+sh, pt[0]:pt[0]+sw]
398 396

  
......
402 400
                        continue
403 401

  
404 402
                searchedItemSp = (roiItemSp[0]+pt[0] + round(offsetDrawingArea[0]), roiItemSp[1]+pt[1] + round(offsetDrawingArea[1]))
405

  
403
                
404
                overlapArea = 0
405
                symbolIndex = -1
406 406
                for i in range(len(searchedSymbolList)):
407 407
                    '''
408 408
                    _pt = searchedSymbolList[i].getSp()
......
416 416
                            break
417 417
                    '''
418 418
                    overlapArea = contains(searchedSymbolList[i], searchedItemSp, sw, sh)
419
                    if overlapArea > ACCEPT_OVERLAY_AREA and not appDocData.isEquipmentType(searchedSymbolList[i].getType()):
420
                        symbolIndex = i
421
                        break
419
                    if overlapArea > ACCEPT_OVERLAY_AREA:
420
                        categories = [appDocData.isEquipmentType(symbolType), appDocData.isEquipmentType(searchedSymbolList[i].getType())]
421
                        if categories[0] == categories[1]:
422
                            symbolIndex = i
423
                            break
422 424
                        
423 425
                hitRate = tmRes[pt[1], pt[0]]
424 426

  
......
431 433
                        , isDetectOnOrigin, symbolRotateCount, symbolOcrOption, isContainChild
432 434
                        , originalPoint, connectionPoint, baseSymbol, additionalSymbol,isExceptDetect)
433 435
                    threadLock.release()
434
                ## 겹치는 영역이 기준값보다 클 경우
435
                else:
436
                else: ## 겹치는 영역이 기준값보다 클 경우
436 437
                    if symbolIndex != -1 and symbolIndex < len(searchedSymbolList):
437 438
                        searchedSymbol = searchedSymbolList[symbolIndex]
438 439
                        ## 현재 심볼과 검출된 심볼이 같을 경우 Match Point가 더 높은 정보로 교체
......
570 571
                
571 572
                mid = (offset[0] + pt[0] + (originalPoint[0] + connectionPoint[0][0])*0.5, offset[1] + pt[1] + (originalPoint[1] + connectionPoint[0][1])*0.5) 
572 573
                searchedItemSp = (roiItemSp[0]+pt[0]+offset[0], roiItemSp[1]+pt[1]+offset[1])
573
                print('---{}---{}---{}---'.format(eqpSize,searchedItemSp,mid))
574 574
                # check searched nozzle location
575 575
                if abs(dx) > abs(dy):
576 576
                    if dx > 0:
......
1046 1046

  
1047 1047
                ## DEBUG
1048 1048
                for item in searchedSymbolList:
1049
                    print('{}:{}-{}'.format(item.getName(), item.getSp(), item.hitRate))
1050 1049
                    _img = appDocData.imgSrc[round(item.getSp()[1]):round(item.getSp()[1]+item.getHeight()), round(item.getSp()[0]):round(item.getSp()[0]+item.getWidth())]
1051 1050
                    cv2.imwrite(os.path.join(project.getTempPath(), 'Tile', item.getName()+'.png'), _img)
1052 1051
                ## up to here

내보내기 Unified diff