Inflearn brand logo image
Inflearn brand logo image
Inflearn brand logo image
Programming

/

etc. (Programming)

Free Python Lecture (Usage 6) - Image Processing (OpenCV)

Learn how to use the OpenCV library, a powerhouse in computer vision and image processing, using Python, and learn how to apply image processing to real life through a variety of fun projects.

(5.0) 62 reviews

3,794 learners

  • nadocoding
OpenCV
Thumbnail

Reviews from Early Learners

What you will learn!

  • How to use OpenCV, which is essential for image processing

  • Development of a semi-automatic document scanner (mini project #1)

  • Developing a program to detect and classify cards in photos (Mini Project #2)

  • Character Overlay Using Face Recognition (Practical Project)

Learning through diverse and fun projects
Image processing lecture using Python !

📢 Please check before attending the lecture.

  • The development environment used in the lecture is Jupyter Notebook and Python 3.x.

We meet every day in our daily lives
Image processing

Until recently, you had to scan a QR code to enter a restaurant, cafe, or other location. If you've ever tried QR check-in , you've already experienced image processing. If you hold the QR code displayed on your smartphone screen up to the device installed at the store entrance at an appropriate distance, it will automatically find the area and recognize the QR code.

(Source: https://www.emkat.com/products/emkat-temperature-screening-kiosk/)

You've probably tried measuring your body temperature at least once. By placing a tablet at a person's height and placing your face against it, it automatically detects the facial area, measures your body temperature, and reports whether it's normal.

Thus, image processing (computer vision) refers to the process of manipulating and analyzing images to extract useful information from them . It's used in a wide range of fields, beyond automatically detecting QR codes or human faces in images captured by cameras.

Face filters , everyone has tried something like this at least once, right?

(Source: https://play.google.com/store/apps/details?id=com.campmobile.snow&hl=ko)

Let me think of a few more:
For example, in an interview video to be broadcast on the news , you can find people's faces and mosaic only that part .
When I try to upload a video from a car black box , it automatically finds the license plate number of another car and mosaics it.
Oh, if it's a license plate, it's automatically recognized when entering and exiting a paid parking lot, right?

Recommending clothes that suit the user ,
Automatically putting clothes on body parts virtually ,
There is also fun content to check if someone is handsome or ugly... such as celebrities who look like them,
Recognize hand gestures to create something like the swoosh swoosh from Minority Report,
Automatically recognizes prohibited items when passing through security checkpoints, etc.

OpenCV

Image processing is done with the help of OpenCV .
OpenCV is an open source library for real-time image processing , and it's just the best 😊😊


In this lecture, we will learn one by one what can be done using OpenCV through various examples .

Example #1

We'll transform the original image in various ways.

Original image

swing

incision

Reduce size

Black and white effect

Blur

Does it look too easy? 😀
Let's delve a little deeper.

Example #2

I'm trying to get all the text parts in the book.

Original image

There is a picture of me reading a book.

grayscale conversion

First, to simplify the image, we convert it to grayscale. Black and white is much simpler than color, right?

threshold function

To get the text in the red area, you can use OpenCV's threshold function. However, the desired area isn't clearly visible. This is due to the coexistence of bright and dark areas caused by sunlight shadows. This is because the entire image is being applied as a reference.

Apply adaptive threshold

In such cases, how about applying something called adaptive thresholding? Isn't that much better? By dividing the image into smaller areas and processing them, you can clearly identify text in the book even when there are shading differences due to sunlight (or other lighting)!

Example #3

Image processing includes erosion and dilation, and we'll also explore open and close operations, which combine these two techniques, with easy examples. You'll learn detailed explanations of how each works, as well as when to use them.

Open operation

Closing operation

Hmm... You might not know just by looking at this picture😊
You can try this too!

Example #4

If you find a certain area within the image and transform it, you can expand the image from a trapezoidal shape to a rectangular shape.

Example #5

You can also create a semi-automatic document scanner that extracts the desired area by selecting it.
In this example, I will use a card image.

Going a little further, you can also use something called contour detection to automatically detect and extract areas within an image that contain cards or documents.

Although not covered in the lecture, detecting and reading text areas can easily identify the type of card you have. If applied to a business card management program, it could read text and categorize and store information like name, phone number, and email address. For example, if you were providing a remote account opening service, you could automatically fill in the required fields by reading text from an ID card and automatically blurring or masking the resident registration number.

Example #6

Using these image processing techniques, we can't help but find human faces and do something fun with them, right?
In this project, we will be using a package called mediapipe (https://google.github.io/mediapipe/) .

As introduced on the homepage, you can do a variety of interesting tasks such as face detection, object recognition, and motion recognition .

We'll apply the face detection example code, introduced first, to find a human face in an image. With just a few lines of code, we can locate the eyes, nose, mouth, and ears, and even draw shapes on them.

Instead of shapes, let's try putting an animal image on it. Here are some ears and a nose drawn with my clumsy hands.

I tried putting this on

It turns out like this 🤣

Now that's all done, let's find a really realistic character image and cover it up.

Ta-da!! I put a cute character image on this old man's face.
Actually, there is a bit of work to handle transparency during this process, but I will explain it in detail later in the lecture, so don't worry.

After studying this far, you'll probably have all sorts of creative ideas floating around in your head, eager to put them into practice right away. Of course, you'll be able to implement them easily, too. You'll even be able to create playful programs like a mischievous child ✨

All of this would take about 5 hours and 40 minutes .

Well then, shall we start right now?

Designed by Freepik
 https://www.freepik.com

Images, Videos by Pixabay, Pexels
https://www.pixabay.com
https://www.pexels.com

Recommended for
these people

Who is this course right for?

  • Those who have studied the basics of Python

  • Anyone who wants to use Python in real life

  • Complete your own project using various image processing techniques

Hello
This is

100,337

Learners

3,109

Reviews

915

Answers

4.9

Rating

11

Courses

유튜브에서 코딩 교육 채널을 운영하고 있는 나도코딩입니다.
누구나 쉽고 재미있게 코딩을 공부하실 수 있도록 친절한 설명과 쉬운 예제로 강의합니다.
코딩, 함께 하실래요? 😊

🧡 유튜브 나도코딩
🎁 코딩 자율학습 나도코딩의 파이썬 입문
📚 코딩 자율학습 나도코딩의 C 언어 입문

Curriculum

All

48 lectures ∙ (5hr 40min)

Published: 
Last updated: 

Reviews

All

62 reviews

5.0

62 reviews

  • lovesome99님의 프로필 이미지
    lovesome99

    Reviews 2

    Average Rating 3.0

    5

    60% enrolled

    힘이 되는 좋은 강의.. 알찬 강의 감사합니다.

    • 김민서님의 프로필 이미지
      김민서

      Reviews 2

      Average Rating 5.0

      5

      60% enrolled

      이런 강의가 무료라니 너무 좋아요!

      • 김비탈리님의 프로필 이미지
        김비탈리

        Reviews 1

        Average Rating 5.0

        5

        31% enrolled

        • 김창은님의 프로필 이미지
          김창은

          Reviews 1

          Average Rating 5.0

          5

          31% enrolled

          • 김기찬님의 프로필 이미지
            김기찬

            Reviews 1

            Average Rating 5.0

            5

            31% enrolled

            Free

            nadocoding's other courses

            Check out other courses by the instructor!