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

Scale-aware Automatic Augmentation for Object Detection (CVPR 2021)

SA-AutoAug Scale-aware Automatic Augmentation for Object Detection Yukang Chen, Yanwei Li, Tao Kong, Lu Qi, Ruihang Chu, Lei Li, Jiaya Jia [Paper] [Bi

Jia Research Lab 182 Dec 29, 2022
Validate and transform various OCR file formats (hOCR, ALTO, PAGE, FineReader)

ocr-fileformat Validate and transform between OCR file formats (hOCR, ALTO, PAGE, FineReader) Installation Docker System-wide Usage CLI GUI API Transf

Universitätsbibliothek Mannheim 152 Dec 20, 2022
This is a GUI for scrapping PDFs with the help of optical character recognition making easier than ever to scrape PDFs.

pdf-scraper-with-ocr With this tool I am aiming to facilitate the work of those who need to scrape PDFs either by hand or using tools that doesn't imp

Jacobo José Guijarro Villalba 75 Oct 21, 2022
Program created with opencv that allows you to automatically count your repetitions on several fitness exercises.

Virtual partner of gym Description Program created with opencv that allows you to automatically count your repetitions on several fitness exercises li

1 Jan 04, 2022
This is a implementation of CRAFT OCR method

This is a implementation of CRAFT OCR method

Esaka 0 Nov 01, 2021
Natural language detection

Detect the language of text. What’s so cool about franc? franc can support more languages(†) than any other library franc is packaged with support for

Titus 3.8k Jan 02, 2023
Python rubik's cube solver

This program makes a 3D representation of a rubiks cube and solves it step by step.

Pablo QB 4 May 29, 2022
A curated list of awesome synthetic data for text location and recognition

awesome-SynthText A curated list of awesome synthetic data for text location and recognition and OCR datasets. Text location SynthText SynthText_Chine

Tianzhong 283 Jan 05, 2023
Toolbox for OCR post-correction

Ochre Ochre is a toolbox for OCR post-correction. Please note that this software is experimental and very much a work in progress! Overview of OCR pos

National Library of the Netherlands / Research 117 Nov 10, 2022
PyQT5 app that colorize black & white pictures using CNN(use pre-trained model which was made with OpenCV)

About PyQT5 app that colorize black & white pictures using CNN(use pre-trained model which was made with OpenCV) Colorizor Приложение для проекта Yand

1 Apr 04, 2022
A list of hyperspectral image super-solution resources collected by Junjun Jiang

A list of hyperspectral image super-resolution resources collected by Junjun Jiang. If you find that important resources are not included, please feel free to contact me.

Junjun Jiang 301 Jan 05, 2023
A Python wrapper for the tesseract-ocr API

tesserocr A simple, Pillow-friendly, wrapper around the tesseract-ocr API for Optical Character Recognition (OCR). tesserocr integrates directly with

Fayez 1.7k Dec 31, 2022
A curated list of papers and resources for scene text detection and recognition

Awesome Scene Text A curated list of papers and resources for scene text detection and recognition The year when a paper was first published, includin

Jan Zdenek 43 Mar 15, 2022
pyntcloud is a Python library for working with 3D point clouds.

pyntcloud is a Python library for working with 3D point clouds.

David de la Iglesia Castro 1.2k Jan 07, 2023
This is a tensorflow re-implementation of PSENet: Shape Robust Text Detection with Progressive Scale Expansion Network.My blog:

PSENet: Shape Robust Text Detection with Progressive Scale Expansion Network Introduction This is a tensorflow re-implementation of PSENet: Shape Robu

Michael liu 498 Dec 30, 2022
Document Layout Analysis Projects

Layout_Analysis Introduction This is an implementation of RLSA and X-Y Cut with OpenCV Dependencies OpenCV 3.0+ How to use Compile with g++ : g++ -std

22 Dec 08, 2022
Recognizing cropped text in natural images.

ASTER: Attentional Scene Text Recognizer with Flexible Rectification ASTER is an accurate scene text recognizer with flexible rectification mechanism.

Baoguang Shi 681 Jan 02, 2023
Go package for OCR (Optical Character Recognition), by using Tesseract C++ library

gosseract OCR Golang OCR package, by using Tesseract C++ library. OCR Server Do you just want OCR server, or see the working example of this package?

Hiromu OCHIAI 1.9k Dec 28, 2022
Um RPG de texto orientado a objetos.

RPG de texto Um RPG de texto orientado a objetos, sem história. Um RPG (Role-playing game) baseado em texto em que você pode viajar para alguns locais

Vinicius 3 Oct 05, 2022
Tesseract Open Source OCR Engine (main repository)

Tesseract OCR About This package contains an OCR engine - libtesseract and a command line program - tesseract. Tesseract 4 adds a new neural net (LSTM

48.4k Jan 09, 2023