GithubHelp home page GithubHelp logo

opencv-usecases's Introduction

OpenCV-UseCases

This project showcases some practical application of OpenCV using its inbuilt modules.

1. Image Enhancement: For this problem, the RGB values of the original image are equalized between 0 and 255 to obtain a clearer picture.

Original Image

Enhanced Image

2. Wiener Deconvolution: For this problem, the approach is to use Wiener deconvolution to stabilize the image. This can be done by testing the effect of deconvolution on the image with different kernels as PSF and varying values of NSR. However, this approach proved difficult for this image in OpenCV. Thus Matlab was used to deconvolve the image using Wiener deconvolution. This was done using the deconvwnr function with NSR = 0.003 and the unknown PSF as a Gaussian kernel of size 12 and standard deviation = 20. Legible results were obtained using these parameters but esults of similar quality could not be reproduced in OpenCV with the same parameters.

However, on further trials, a 12x12 square kernel of all 1s as the PSF and NSR = 0.002 was found to yield acceptable results on the sample implementation of the Wiener deconvolution in OpenCV.

Original Image

Resored Image with Matlab(Left) and OpenCV(Right)

3. Hough Circles: This problem was solved by utilizing the HoughCircles method of OpenCV which uses Hough transforms to identify circular shapes in the original image. The correctly identified circles are indicated by outlining them in blue, incorrect by red, and close to correct by orange. Thirty five out of the total thirty seven circles were correctly identified resulting in an accuracy of 94.59%

Original Image

Image with identified circles

5. Mean Shift Algorithm: In this problem, the objective is to track the movement of the red ball as it moves around in the video feed. For this, the user is first asked to trace a bounding box around the red ball in the first frame of the video. The image inside the bounding box is then cropped and converted to HSV and its histogram is computed. The back projection of this histogram and the coordinates of the bounding box are then provided as parameters for the meanShift function. This function returns the coordinates of the new location of the object of interest and this and its pack projection is again fed to the function for the next frame.

Video frames highlighting the tracked red ball

6. Image Segmentation: For this problem, the original image is segmented into clusters using k-means clustering with k = 5. Each cluster is then repeatedly eroded and dilated to remove fragments and obtain a suitable segmented image of each berry type.

Original Image

Segmented images

7. Image Blending: This problem was solved by computing the Gaussian pyramids of the original images upto level 5 and using them to compute the Laplacian pyramids. These were then successively merged and added up to obtain a blended version of the two images.

Original Images

Blended Image

opencv-usecases's People

Contributors

ad8454 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.