"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;
Showing posts with label OpenCV. Show all posts
Showing posts with label OpenCV. Show all posts

March 09, 2023

Vision Tagging Media Asset Management - reflexion.ai

Vision Tagging Media Asset Management

reflexion.ai

Building a scalable AI core SaaS platform



Solving specific media problems

  • Specific focus on industry
  • Depth / Better Solution
  • Highlight content
  • Augment Editors




Architecture Components






APIs / Vision Models





Keep Exploring!!!

August 16, 2022

Image Quality Reads

Ideas for Image Features and Image Quality

  • Dullness - analysis of prominent colors 
  • Image Whiteness - color analysis
  • Uniform Images (with no pixel variations)
  • Dominant Color

Key Topics to Explore

  • Super-Resolution
  • Image Deraining
  • Image Dehazing
  • Deblurring
  • Denoising
  • Image Restoration
  • Image Enhancement
  • Image Demoireing
  • Inpainting
  • Image Quality Assessment

Ref - Link

Projects to Explore

Keep Exploring!!!

August 07, 2022

ImageHash package - simplify hash

Python library to hash by different methods. Useful to build indexes / similarity search.

The different hashing techniques are

  • Average hashing  - crushes the image into a grayscale 8x8 image and sets the 64 bits in the hash based on whether the pixel's value is greater than the average color for the image.
  • Perceptual hashing - use a discrete cosine transform (DCT) and compares based on frequencies rather than color values
  • Difference hashing - gradient hash, calculate the difference for each of the pixel and compares the difference with the average differences.
  • Wavelet hashing - works in the frequency domain as pHash but it uses DWT instead of DCT.
  • HSV color hashing (colorhash)
  • Crop-resistant hashing

Ref - Link1, Link2


Ref - Link

Package Installation




File Upload



Create Hash Methods



Depending on usecases need to evaluate which suits the need or a combination of techniques.

Keep Exploring!!!






July 06, 2022

OpenCV Notes

Color channels

  • Hue: Measures the color of the pixel.
  • Saturation: Measures the intensity of color of the pixel.
  • Value: Measures the brighness of the pixel.

Hue range

  • Red (0-60)
  • Yellow (60-120)
  • Green (120-180)
  • Cyan (180-240)
  • Blue (240-300)
  • Magenta (300-360)

RGB Channels

  • (0,0,0) is a black color.
  • (255,0,0) is a pure red color.
  • (0,255,0) is a pure green color.

 

Smoothing Functions

  • Image Smoothing - convolving the image with a low-pass filter kernel. It is useful for removing noise
  • Bilateral filter - replaces the intensity of each pixel with a weighted average of intensity values. cv.bilateralFilter() is highly effective in noise removal while keeping edges sharp


Color Codes

Mask for custom color range


Keep Thinking!!!!

June 26, 2021

Convert avi to mp4 in ffmpeg for streamlit

Streamlit didn't work with avi. ffmpeg tool worked for converting from avi to mp4

What did not work 

ffmpeg -i video_Raw.avi -c:v copy -c:a copy -y video_Raw_New.mp4

What Worked 

ffmpeg -y -i video_Raw.avi -vcodec libx264 video_Raw_New.mp4

Keep Learning!!!


June 07, 2021

OpenCV Experiments

Experiment with

  • Logging
  • Threads
  • Error Handling
  • Writing text on Frame with grey background






Keep Exploring!!!

February 19, 2019

January 29, 2019

Day #201 - Person Detection for Surveillance Camera Video

Today I was pulled out for a real theft investigation. There was a theft reported in my community. We have a ton of videos. Finding out the person across all the videos is a tedious task. I worked on approach for the same.

Step #1 - OpenCV to Extract Frames form the Videos
Step #2 - Used Yolo to Detect Person from the frame
Step #3 - Extract the region of Person and Add Appropriate reference for further analysis

This was a great way and lesson to experiment and save time in this Situation.

Happy Coding!!!
Happy Mastering DL!!!


November 02, 2018

Computer Vision - Learning OpenCV

Outline of Exercises to understand basic image manipulations using OpenCV, available packages
  • Day #1 - Basic Image Manipulations (Flip / Rotate / Blur)
  • Day #2 - Image Sharpening, Edge Detection, Sobel, Laplacian Filters, SIFT
  • Day #3 - Contour Detection, Haar Face Detection, Haar Eye Detection, HOG Based Person Detection
  • Day #4 - OCR Detection from Image, Working with Tesseract
  • Day #5 - PCA on Image - Dimensionality Reduction, Split into Channels RGB, HSV
  • Day #6 - Working with Videos, Converting from Videos to Frames in OpenCV
#OpenCVGuidance

OpenCV Techniques for Feature Engineering
Perform below operations, Normalize and Convert into 1D array to train ML Model
  • Edge Detection - Canny Edge, Hough Transform
  • Image Sharpening, Threshold, Dialation, Erosion
  • Filters - Sobel, Laplace, Texture
  • Histogram Equalzation
  • Segmentation, Contours, HSV
References
OpenCV Examples
Snake Game in OpenCV
Record Specific Window in OpenCV
Add Image in Live Camera Feed
Object Tracking with Colors
OCR and OpenCV

Happy Learning!!!

June 30, 2018

Day #117 - Yolo Object Detection

This post is using Yolo for object detection

Step 1 - Download Repo - https://github.com/thtrieu/darkflow
Step 2 - Install Commands - https://github.com/markjay4k/YOLO-series/blob/master/part1%20-%20setup%20YOLO.ipynb

Step 3 - Install Cython
Step 4 - Build Downloaded Code


Step 5 - Made Changes to following lines in code



Sample Example Code

Yolo on Colab - Link

Happy Learning!!!

June 25, 2018

Day #115 - Image Template Comparison

Template Matching, OpevCV3, Python 3 Environment

Happy Learning!!!

May 31, 2018

Day #111 - OpenCV3 Feature Matching


On Windows platform performed the following installations

pip install opencv-python
pip install opencv-contrib-python


Happy Learning!!!

May 30, 2018

Day #110 - Image Processing - Line Counting from Images

Learning's from recent exposure to working on images, texture and identifying the line count in vertical and horizontal axis. OpenCV was useful to arrive at different approaches

Happy Coding!!!

May 21, 2018

Day#108 - OCR for Hindi

OCR for Hindi

1. Download data from https://github.com/tesseract-ocr/tessdata/blob/3.04.00/hin.traineddata

2. Copy it to C:\opencv\Tesseract-OCR\tessdata/hin.traineddata


3. Test Data



3. Output

Code

More Reads - Link, Link1

Happy Learning!!!

April 26, 2018

Day #106 - OpenCV for Python3

Finally installed OpenCV for python3 following steps in link 

Anaconda 3 Distribution works fine perfectly!
pip install opencv-python

Happy Learning!!!

March 29, 2018

Day #102 - Error - Opening Video File using OpenCV python

Sometimes the setup settings, I actually forgot.

Error - RuntimeError: invalid rotation plane specified

Actual Setup  - Copy your opencv_ffmpeg.dll to C:\Python27\ and rename it to relevant your OpenCV Python Version. In my case, I had to rename it to opencv_ffmpeg240.dll



In my case opencv version was 3.4.1

Often, These setup steps are missed once things start working. This link was useful - link

Happy Learning!!!

August 25, 2015

OpenCV Python Basics

Basic image loading modules

Example #1

import cv2
import numpy as np
from matplotlib import pyplot as plt
#Load Image
source = cv2.imread('D:\images\Benz.png')

Ref - Link

Example #2

#Printing width and height of image
import cv2
import numpy as np
from matplotlib import pyplot as plt

#Load Image
source = cv2.imread('D:\images\Benz.png')
print source.shape

#Output Number of Rows / Columns
rowCount = source.shape[0]
columnCount = source.shape[1]
print rowCount, columnCount

Ref - Link

Example #3
#Drawing Histogram

import cv2
import numpy as np
from matplotlib import pyplot as plt

#Load Image
source = cv2.imread('D:\images\Benz.png')

# Image, Channel
# Channels - grayscale image - [0], RGB - 0,1,2
# Mask - Supplied None as FULL Region Needed
# histSize - Bin Size
# ranges - 0 to 256
hist = cv2.calcHist([source], [0], None, [256], [0,256])
plt.plot(hist)
plt.show()

Happy Learning!!!