Basic Cooking #1 -Open,Save, Resize, Display
![이미지](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEigs_8olG0CCX_a5tCrvAK6BD7BRANfZVKc0UtKhynQv09JwMaTNL8iNCLV-1OgXq1hKaWqvYr4adLFHdCUstHKO7QAFXDnZJW4VKmG-8S40bJ8RxGjHVqnWC2hFb3gk_JAp61G3nIyoH-4/s0/%25EC%259D%25B4%25EB%25AF%25B8%25EC%25A7%2580+1.png)
OpenCV Open image Use cv2.imread function to open an image file. import cv2 img = cv2 . imread( "dog.jpg" , cv2 . IMREAD_COLOR) height, width, channels = img . shape print( "JPG H:%d W:%d, Channel:%d" % (height, width, channels)) #There's no channel value when open with grayscale img = cv2 . imread( "dog.jpg" , cv2 . IMREAD_GRAYSCALE) height, width = img . shape print( "JPG H:%d W:%d " % (height, width)) img = cv2 . imread( "linux.png" , cv2 . IMREAD_COLOR) height, width, channels = img . shape print( "PNG 1 H:%d W:%d, Channel:%d" % (height, width, channels)) img = cv2 . imread( "linux.png" , cv2 . IMREAD_UNCHANGED) height, width, channels = img . shape print( "PNG 2 H:%d W:%d, Channel:%d" % (height, width, channels)) <open.py> Flags cv2.IMREAD_COLOR : BGR format image is opened. So the channel will be 3. cv2.IMREAD_GRAYSCALE : only 1...