Skip to content

AutoPipo/EasyPipo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Easy Pipo

"Pipo Painting" Image Auto Creation System

Using Image Processing, the real image is automatically converted to a "Pipo Painting" image.

Our Icon


πŸ“Œ Name : Easy Pipo

πŸ“Œ Authors : Minku Koo Β Jiyong Park

πŸ“Œ Development Period : Feb.2021 ~ Jun.2021

πŸ“Œ Main Library : OpenCV, numpy, Flask

πŸ“Œ Keyword : "Computer Vision", "Image Processing", "OpenCV", "Pipo Painting", "Line Detection", "Color Numbering"

Process Summary

πŸ“ƒ Table of Contents

πŸ€” What is Pipo Painting?

"Pipo Painting" is also called "Paint by Number" or "Painting by Numbers".

It is a kit having a board on which light markings to indicate areas to paint, and each area has a number and a corresponding numbered paint to use. The kits come with little compartmentalised boxes where the numbered colour pigments are stored. The users are encouraged to wash the paintbrush every time a new numbered colour is being used.

πŸ”— Wikipedia Description
πŸ”— Amazon Products
πŸ”— Coupang Products

βš™ How to Use?

Command Line

git clone https://github.com/AutoPipo/EasyPipo.git
cd EasyPipo
pip install -r requirements.txt
python .

On your Web Browser

https://localhost:5000

πŸ–₯ SW Architecture

πŸ’‘ Working Process

Original Image

Step 1. Color Clustering (8, 16, 32 Colors)

Step 2. Select appropriate number of colors and Line Drawing

Step 3. Remove noise line and Set Color Numbering (Color Label Included or Not)

πŸ”Ž If it zoom in, you can see numbers

πŸ“½ Testing Video

You can see the Testing Video here (Youtube)

πŸ“š Modules Development

πŸ“ Painting()

Painting() converts the image like a picture through reduce color.
Use Blurring and K-Means Clustering.
This is step 1 of the Working Steps

    painting = Painting( "./imagePath/image.jpg")
    
    # Blurring
    blurImage = painting.blurring(  div = 8, 
                                    radius = 10, 
                                    sigmaColor =20, 
                                    medianValue=7)
    
    # Color K-Means Clustering
    clusteredImage = painting.colorClustering( blurImage, cluster = 16)
    
    expandedImage = imageExpand(clusteredImage, size = 4)
    
    # ν™•μž₯된 μ΄λ―Έμ§€μ—μ„œ λ³€ν˜•λœ 색상을 κ΅°μ§‘ν™”λœ 색상과 맀칭
    similarMap = painting.expandImageColorMatch(expandedImage)
    # κ΅°μ§‘ν™”λœ 색상을 μ§€μ •λœ 색상과 κ°€μž₯ λΉ„μŠ·ν•œ μƒ‰μƒμœΌλ‘œ 맀칭
    paintingMap = painting.getPaintingColorMap(similarMap)

πŸ“ DrawLine()

DrawLine() draw a line based on the color border.
Draw an arbitrary line at the edge of the image for apply Numbering()
This is step 2 of the Working Steps

    # Input : Painted Image
    
    drawLine = DrawLine(image)
    lineMap = drawLine.getDrawLine()
    lineMap = drawLine.drawOutline(lineMap)
    
    # Output : Image drawn with lines

πŸ“ Numbering()

Numbering() input the color index number inside the line.
Find the contours and its hierarchy.
Extracts the color label, calculates the Incenter point, and input a color index number.
This is step 3 of the Working Steps

    # Input : Image drawn with lines
    
    # get Color(RGB) dictionary, Color index dictionary from Painted image 
    colorNames, colors = getColorFromImage(image)
    # Extracts Color label from Painted Image
    img_lab, lab = getImgLabelFromImage(colors, image)
    # Extracts contours, hierarchy, thresh from Image drawn with lines
    contours, hierarchy, thresh = getContoursFromImage(lineMap)
    # Make White image same size with Image drawn with lines
    result_img = makeWhiteFromImage(lineMap)
    # Draw contouor borders and Color index on White image
    result_img = setColorNumberFromContours(result_img, 
                                              thresh, 
                                              contours, 
                                              hierarchy, 
                                              img_lab, 
                                              lab, 
                                              colorNames)
    # Draw Color label index on Result image
    result_img2 = setColorLabel(result_img.copy(), colorNames, colors)
    
    # Output : Pipo Painting Canvas Image

πŸ’‘ Patent Application

βœ” 발λͺ… λͺ…μΉ­ : ν”Όν¬νŽ˜μΈνŒ… 이미지 μžλ™λ³€ν™˜λ°©λ²• 및 이λ₯Ό μ΄μš©ν•œ ν”Όν¬νŽ˜μΈνŒ… 이미지 μžλ™λ³€ν™˜ μ‹œμŠ€ν…œ

βœ” μΆœμ› 번호 : 10-2021-0152394

βœ” μΆœμ› λ‚ μ§œ : 2021.11.08

πŸ“§ Contact to us