This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

*/

석촌호수 루미나리에 축제

석촌호수에서 10/28부터 23년 1월 31일까지 석촌호수의 가을과 겨울 그리고 루미나리에 빛 축제가 열린다.

시작하기 하루 전인데 테스트인지 일부 조명이 들어와 있다.







조명이 안들와 있는 것이  많았다. 주말에 다시 한번.


더보기 

 - 석촌호수

 - 루미나리에


러버덕 뒷태

석촌호수 동호에서 러버덕의 뒷태를 보았다. ^^


석촌호수 다리 중간에서 바라본 러버덕

러버덕 다른 사진

초대형 러버덕(Rubber Duck)

잠실 석촌호수 동호에 초대형 고무 오리가 떴다. 

9월 30일 




러버덕 다른 사진

#Rubber Duck, #러버덕, #석촌호수, #롯데월드

석촌호수에서 본 롯데타워

주말 늦은 밤에 석촌호수에서 바라본 롯데타워 태풍이 올라오기 전이라 밤 하늘이 맑다.
호수에 비친 롯데타워도 볼만하다.
 

하늘

골목사이에 비친 하늘

Python으로 QR Code Reader 만들기

개발 환경

  • Windows 10
  • VisualStudio Code
  • Python : 3.7.9

QR Code를 읽을 수 있는 프로그램을 찾다가 아래 참조에서 찾은 코드를 소개 한다. 기존 개발 환경 VS Code에서 바로 테스트 할 수 있다. 

필요한 파이썬 라이브러리

  • OpenCV : 이미지 처리, 컴퓨터 비젼 및 기계 학습 라이브러리
  • Numpy : 행렬이나 일반적으로 대규모 다차원 배열을 쉽게 처리 할 수 있도록 지원하는  라이브러리
  • pyzbar : 주어진 이미지에서 Bar code, QR Code를 읽는다. EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 및 QR Code를 지원

라이브러리 설치

  • OpenCV 설치
   > pip install opencv-python                                          

       혹은  

   > pip install opencv-contrib-python                                  
  •  numpy 설치
   > pip install numpy                                                  
  • pyzbar 설치

       > pip install pyzbar                                                 

    코드

    • 필요 라이브러리 import
    • import cv2
      import numpy as np
      from pyzbar.pyzbar import decode

      • 카메라로부터 이미지 캡쳐 
      • cap = cv2.VideoCapture(0)
        while True:
            ret, frame = cap.read()
            decoder(frame)
            cv2.imshow('Image', frame)
            code = cv2.waitKey(10)
            if code == ord('q'):
                break
        •  주어진 이미지로부터 QR Code를 얻는 함수 
        • def decoder(image):
              gray_img = cv2.cvtColor(image,0)
              barcode = decode(gray_img)

              for obj in barcode:
                  points = obj.polygon
                  (x,y,w,h) = obj.rect
                  pts = np.array(points, np.int32)
                  pts = pts.reshape((-1, 1, 2))
                  cv2.polylines(image, [pts], True, (0, 255, 0), 3)

                  barcodeData = obj.data.decode("utf-8")
                  barcodeType = obj.type
                  string = "Data " + str(barcodeData) + " | Type " + str(barcodeType)
                 
                  cv2.putText(frame, string, (x,y), cv2.FONT_HERSHEY_SIMPLEX,0.8,(255,0,0), 2)
                  print("Barcode: "+barcodeData +" | Type: "+barcodeType)

          •  최종 코드  
          • cap = cv2.VideoCapture(0)
            while True:
            import cv2
            import numpy as np
            from pyzbar.pyzbar import decode

            def decoder(image):
                gray_img = cv2.cvtColor(image,0)
                barcode = decode(gray_img)

                for obj in barcode:
                    points = obj.polygon
                    (x,y,w,h) = obj.rect
                    pts = np.array(points, np.int32)
                    pts = pts.reshape((-1, 1, 2))
                    cv2.polylines(image, [pts], True, (0, 255, 0), 3)

                    barcodeData = obj.data.decode("utf-8")
                    barcodeType = obj.type
                    string = "Data " + str(barcodeData) + " | Type " + str(barcodeType)
                   
                    cv2.putText(frame, string, (x,y), cv2.FONT_HERSHEY_SIMPLEX,0.8,(255,0,0), 2)
                    print("Barcode: "+barcodeData +" | Type: "+barcodeType)

            cap = cv2.VideoCapture(0)
            while True:
                ret, frame = cap.read()
                decoder(frame)
                cv2.imshow('Image', frame)
                code = cv2.waitKey(10)
                if code == ord('q'):
                    break

          참조 

          VS Code 에서 Python OpenCV 설치하기


          VS Code TERMINAL 창에서 "pip install opencv-contrib-python" 을 입력하면 설치 완료



          참고 



          내로남불

          정의

          '내로남불’은 국립 국어원의 오픈 사전인 우리말샘에 ‘내가 하면 로맨스, 남이 하면 불륜’이라는 뜻으로, 남이 할 때는 비난하던 행위를 자신이 할 때는 합리화하는 태도를 이르는 말

          기원

          1990년대 초반 내로남불과 유사한 유머들이 유행. 내가 사랑에 빠지면 로맨스, 네가 사랑에 빠지면 스캔들. 가 하면 숙달운전, 남이 하면 얌체운전. 내가 못 생긴 건 개성, 네가 못 생긴 건 원죄. 1993년 8월에 이영미 작가의 <남이 하면 스캔들 내가 하면 로맨스>라는 콩트집 출간.

          내로남불은 특정정당이 연상된다?

          한국일보 : "내로남불, 특정 정당 연상되니 쓰지 말라"는 선관위, 공정의 역설

          노컷뉴스 : 선관위가 내로남불 ? 


          관련글

          VisualStudio Code에서 esptool.py 사용하기

          ESP32 개발시 FW를 한개의 파일로 만들기 위해 esptool.py를 사용하기 위해 해당 component를 설치해야 사용할 수 있다.

          설치방법은 cmd를 실행하고 esp idf가 설치된 디렉토리에서 components\esptool_py\esptool 로 이동하여 아래와 같이 설치한다.


          c:\esp\esp-idf\components\esptool_py\esptool> python setup.py install
           



          수행하면 이후 VSCode상에서도 esptool.py를 사용할 수 있다. 


          관련문서 


          밀리 초, 마이크로 초

          시간 단위

          ms, msec : milli-second, 10−3, 1/1,000 초
          μs : micro-second, 10−6, 1/1,000,000 초 
          ns : nano-second, 10−9, 1/1,000,000,000 초