This repository summarized computer vision theories.

Overview

CV_theory

Python Cv2

Basic Overview

This repository summarized computer vision theories.


PSNR

mse = np.mean((img1 - img2) ** 2)
# MSE 구하는 식

PLXEL_MAX = 255.0
# 8bit MAX는 255의 값을 가짐

return 20 * math.log10(PLXEL_MAX/math.sqrt(mse))
#PSNR 구하는 식

[output]
openCV를 이용한 PSNR : 52.37698680492553
주어진 수식을 이용한 함수구현 : 52.37698680492553

Color transform

for i in range(height):
    for j in range(width):
        y2[i][j] = 0.299 * r[i][j] + 0.587 * g[i][j] + 0.114 * b[i][j]
        cb2[i][j] = (-0.172*r[i][j]) - (0.339*g[i][j]) + (0.511*b[i][j]) + 128
        cr2[i][j] = (0.511*r[i][j])- (0.428*g[i][j]) - (0.083*b[i][j]) + 128
# RGB 영상을 YCbCr로 변환 수식

for i in range(height):
    for j in range(width):
        r[i][j] = y2[i][j] + 1.371*(cr2[i][j] - 128)
        g[i][j] = y2[i][j] - 0.698*(cr2[i][j] - 128) - 0.336*(cb2[i][j] - 128)
        b[i][j] = y2[i][j] + 1.732*(cb2[i][j] - 128)
# yCbCr을 RGB 변환 수식

Filterring Smoothing

After converting the original image to Ycrcb, only the Y value was filtered with 3*3 kernels and smoothing was performed.

kernel = np.ones((3, 3), np.float32) / 9
# 3*3 커널값 저장

for i in range(5):
    Y = cv2.filter2D(Y, -1, kernel)
# 5번 필터링


Histogram equalization

height, width, channel = src.shape


hist, bins = np.histogram(Y.flatten(), 256, [0, 256])
# 이미지 히스토그램 구해주기

cdf = hist.cumsum()
# 각 멤버값을 누적하여 더한 1차원 배열 생성

cdf_m = np.ma.masked_equal(cdf, 0)
# cdf에서 값이 0인 부분  mask 처리


cdf_m = (cdf_m - cdf_m.min()) * 255 / (cdf_m.max() - cdf_m.min())
#  균일화 방정식 코드

cdf = np.ma.filled(cdf_m, 0). astype("uint8")
# mask처리된 부분을 o으로 다시 리턴

out = (np.dstack((Y, cr, cb)))
out_rgb = cv2.cvtColor(out, cv2.COLOR_YCrCb2RGB)

img2 = cdf[out_rgb]

dst -> function in cv2 , dst2 -> Self-made function


Hough Line Detection


Contributing

Let's connect 👨‍💻 and forge the future together. 😁

Check the Repositories and don't forget to give a star. 👇

From S-jooyoung

You might also like...
A dataset handling library for computer vision datasets in LOST-fromat

A dataset handling library for computer vision datasets in LOST-fromat

SRA's seminar on Introduction to Computer Vision Fundamentals
SRA's seminar on Introduction to Computer Vision Fundamentals

Introduction to Computer Vision This repository includes basics to : Python Numpy: A python library Git Computer Vision. The aim of this repository is

Using computer vision method to  recognize and calcutate the features of the architecture.
Using computer vision method to recognize and calcutate the features of the architecture.

building-feature-recognition In this repository, we accomplished building feature recognition using traditional/dl-assisted computer vision method. Th

computer vision, image processing and machine learning on the web browser or node.

Image processing and Machine learning labs   computer vision, image processing and machine learning on the web browser or node note Fast Fourier Trans

Omdena-abuja-anpd - Automatic Number Plate Detection for the security of lives and properties using Computer Vision.

Omdena-abuja-anpd - Automatic Number Plate Detection for the security of lives and properties using Computer Vision.

Python Computer Vision application that allows users to draw/erase on the screen using their webcam.
Python Computer Vision application that allows users to draw/erase on the screen using their webcam.

CV-Virtual-WhiteBoard The Virtual WhiteBoard is a project I made using the OpenCV and Mediapipe Python libraries. Using your index and middle finger y

Smart computer vision application

Smart-computer-vision-application Backend : opencv and python Library required:

Computer vision applications project (Flask and OpenCV)

Computer Vision Applications Project This project is at it's initial phase. This is all about the implementation of different computer vision techniqu

Image processing is one of the most common term in computer vision

Image processing is one of the most common term in computer vision. Computer vision is the process by which computers can understand images and videos, and how they are stored, manipulated, and retrieve details from them. OpenCV is an open source computer vision image processing library for machine learning, deep leaning and AI application which plays a major role in real-time operation which is very important in today’s systems.

Owner
null
Repository for playing the computer vision apps: People analytics on Raspberry Pi.

play-with-torch Repository for playing the computer vision apps: People analytics on Raspberry Pi. Tools Tested Hardware RasberryPi 4 Model B here, RA

eMHa 1 Sep 23, 2021
Open Source Differentiable Computer Vision Library for PyTorch

Kornia is a differentiable computer vision library for PyTorch. It consists of a set of routines and differentiable modules to solve generic computer

kornia 7.6k Jan 4, 2023
Open Source Computer Vision Library

OpenCV: Open Source Computer Vision Library Resources Homepage: https://opencv.org Courses: https://opencv.org/courses Docs: https://docs.opencv.org/m

OpenCV 65.7k Jan 3, 2023
"Very simple but works well" Computer Vision based ID verification solution provided by LibraX.

ID Verification by LibraX.ai This is the first free Identity verification in the market. LibraX.ai is an identity verification platform for developers

LibraX.ai 46 Dec 6, 2022
This is a Computer vision package that makes its easy to run Image processing and AI functions. At the core it uses OpenCV and Mediapipe libraries.

CVZone This is a Computer vision package that makes its easy to run Image processing and AI functions. At the core it uses OpenCV and Mediapipe librar

CVZone 648 Dec 30, 2022
An organized collection of tutorials and projects created for aspriring computer vision students.

A repository created with the purpose of teaching students in BME lab 308A- Hanoi University of Science and Technology

Givralnguyen 5 Nov 24, 2021
Roboflow makes managing, preprocessing, augmenting, and versioning datasets for computer vision seamless.

Roboflow makes managing, preprocessing, augmenting, and versioning datasets for computer vision seamless. This is the official Roboflow python package that interfaces with the Roboflow API.

Roboflow 52 Dec 23, 2022
Aloception is a set of package for computer vision: aloscene, alodataset, alonet.

Aloception is a set of package for computer vision: aloscene, alodataset, alonet.

Visual Behavior 86 Dec 28, 2022
Kornia is a open source differentiable computer vision library for PyTorch.

Open Source Differentiable Computer Vision Library

kornia 7.6k Jan 6, 2023
Multi-choice answer sheet correction system using computer vision with opencv & python.

Multi choice answer correction ?? 5 answer sheet samples with a specific solution for detecting answers and sheet correction. ?? By running the soluti

Reza Firouzi 7 Mar 7, 2022