yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
ROS-WiFi Camera Module📖
1.Basic usage
  • 1. Computer configuration esp32 instruction
  • 2. Viewing camera on ROS2
  • 3. Camera screen changes
  • 4. Preparation(ReadMe)
2.mediapipe usage
  • 0.Installation of media pipe
  • 1. Hand detection
  • 2. Posture detection
  • 3. Overall inspection
  • 4. Face detection
  • 5. Face recognition
  • 6. Facial effects
  • 7. 3D object recognition
  • 8. Brush
  • 9. Finger control
  • 10. Gesture recognition
3.Opencv usage
  • 1. Open Source CV Getting started
  • 2. Geometric transformation
  • 3. Image processing and drawing text line segments
  • 4. Image beautification
  • 5. Color recognition
  • 6. Object recognition
  • 7. QR code recognition
4.Display screen on the APP
  • 1. YahboomCam APP screen view
  • 2. ROS Robot APP screen view
Download
  • Code
  • VM_File
  • Tools
Download ZIP

Welcome to ROS-WiFi Camera Module repository

4. Image beautification

Image beautification

Open Source CV Image beautification

1、 OpenCV Fix images

1.1、Image restoration is a type of algorithm in computer vision,

Its goal is to fill the area within the image or video. This area is identified using binary masks, and filling is usually done based on the boundary information of the area that needs to be filled. The most common application of image restoration is to restore old scanned photos. It is also used to remove small unwanted objects from images.

1.2、In OpenCV, dst=cv2. inpint (src, inpaintMask, inpaintradius, flags) is provided to achieve image restoration,

Parameter meanings:

src:Source image, which is the image that needs to be repaired

inpaintMask:Binary mask, indicating the pixels to be repaired.

dst:Result image

inpaintRadius:Indicates the radius of repair

flags : Repair algorithm,major have INPAINT_NS (Navier-Stokes based method) or INPAINT_TELEA (Fast marching based method)

The repair based on Navier Stokes should be slower and tend to produce more blurry results than the fast marking method. In practice, we have not found this situation. INPAINT-NS produced better results in our testing, and the speed was slightly higher than INPAINT-TELEA。

1.3、Code and actual effect display

(1)、Firstly, based on the intact image, we will add damage to it, which can be understood as modifying the pixel values of specific parts of it

cd ~/yahboomcar_ws/src/yahboom_esp32ai_car/scripts/opencv/
python3 4_1_1.py
xxxxxxxxxx
import cv2
import numpy as np
if __name__ == '__main__':
    img = cv2.imread('yahboom.jpg')
    for i in range(50,100):
        img[i,50] =   (0,0,0)
        img[i,50+1] =   (0,0,0)
        img[i,50-1] =   (0,0,0)
    for i in range(100,150):
        img[150,i] =   (0,0,0)
        img[150,i+1] =   (0,0,0)
        img[150-1,i] =   (0,0,0)
    cv2.imwrite("damaged.jpg",img)
    dam_img = cv2.imread('damaged.jpg')
    while True :
        cv2.imshow("dam_img",dam_img)
        action = cv2.waitKey(10) & 0xFF
        if action == ord('q') or action == 113:
            break
    img.release()
    cv2.destroyAllWindows()

After running, an image will be generated, which is considered as a damaged image of the original image

image-20240123165811326

(2)、To fix the photo you just created, first read it, then create a mask, and finally use a function to fix it

Image processing and drawing text line segments
Color recognition

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文