OpenCV In Mobile Technology | Computer Vision on Mobile
dineshlakhzz
26 views
17 slides
Jun 26, 2024
Slide 1 of 17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
About This Presentation
OpenCV, which stands for Open Source Computer Vision Library, is a powerful tool for computer vision. It has a wide range of applications, from basic image processing to complex computer vision tasks. In recent years, OpenCV has made significant strides in mobile technology, enabling developers to c...
OpenCV, which stands for Open Source Computer Vision Library, is a powerful tool for computer vision. It has a wide range of applications, from basic image processing to complex computer vision tasks. In recent years, OpenCV has made significant strides in mobile technology, enabling developers to create advanced applications for smartphones. Let's dive into how OpenCV is used in mobile technology and explore the benefits it brings to computer vision on mobile devices. Plus, I'll share a bit about a sample Android app I've created that demonstrates a simple filter app using OpenCV.
Size: 13.79 MB
Language: en
Added: Jun 26, 2024
Slides: 17 pages
Slide Content
OpenCV in Mobile Technology The Power of Computer Vision By DINESH S (Mobility Team)
Introduction to OpenCV OpenCV, or Open Source Computer Vision Library, is like a super-smart tool that helps computers see and understand pictures. It enables the development of applications that can interpret and make decisions based on visual data. In the Mobile Technology landscape, OpenCV plays a crucial role in enhancing apps with vision capabilities (Object Detection, Image manipulation, AR and more…)
How OpenCV works ? 1. Image Representation The images are represented in the computer as a matrix / grid of numbers , where each number corresponds to the color or intensity of a pixel . Grayscale Image: (2D matrix ) A grayscale image has pixel values representing intensity, usually ranging from 0 (black) to 255 (white) RGB Image: (3D matrix ) An RGB image consists of three channels (Red, Green, and Blue), each represented by a separate matrix.
How OpenCV works ? 2. Feature Extraction: The image goes through a series of layers in a complex neural network called a Convolutional Neural Network (CNN) The first layer takes pixel value and tries to identify the edges . The next few layers will try to detect simple shapes with the help of edges . In the end, all of it is put together to understand the image.
How OpenCV works ? 3. Image Recognition and Analysis: Once features are extracted and objects are detected, OpenCV can be used for image recognition and analysis. This could involve recognizing faces , identifying text , or even determining the pose of objects.
Quest for Image Filtering Our quest today is to apply image filter to enhance and modify images in exciting ways. We’ll transform Color images into grayscale and adjust brightness . This will be the foundation of creating attractive visual effects in your apps. Lets start programming……..^..^..
Converting Image to Bitmap In the context of Android development, a " Bitmap " refers to the android.graphics.Bitmap class, which is part of the Android graphics framework. A Bitmap is a pixel-based representation of an image. It stores information about the color of each individual pixel in a grid. Bitmap is often used to display images in Android user interfaces. The ImageView widget, for example, accepts Bitmap objects as the source for displaying images.
Converting Image to MAT Mat is a multi-dimensional array that represents an image in OpenCV . It holds pixel values , C olor information, and other image-related data. It is a fundamental data structure used to store image data, and it is a key component of the OpenCV library // Creating a Mat object to hold the image data val imageMat = Mat() // convert bitmap into mat format Utils. bitmapToMat ( imageBitmap , imageMat )
Color Image to Grayscale image Imgproc.cvtColor is a function from the OpenCV library used to convert the color space of an image. In the code snippet, it is used to convert the original color image ( imageMat ) to grayscale ( grayMat ) // Convert the Color image (BGR) to grayscale Imgproc .cvtColor ( imageMat , grayMat , Imgproc. COLOR_BGR2GRAY )
Changing the Brightness - 1 In the code snippet, it is used to adjust the brightness of the grayscale image ( grayMat ) Core.add is a function from the OpenCV library used to perform element-wise addition on two Mat objects. //Syntax -- Core.add ( Mat src1, Mat src2, Mat dst ) Core. add ( grayMat , Scalar.all ( -30.0 ), grayMat )
Changing the Brightness - 2 a Scalar is a class used to represent a four-element mathematical vector. It is often used to represent color information in OpenCV, where each element corresponds to a color channel (Blue, Green, Red, and an optional Alpha channel for transparency). // Adjust the brightness of the grayscale image Core. add ( grayMat , Scalar.all ( -30.0 ), grayMat )
Mat to Bitmap… // Convert the filtered grayscale Mat back to a Bitmap format Utils. matToBitmap ( grayMat , bwBitmap ) // Set the filtered Bitmap ( bwBitmap ) to be displayed in the ImageView imageView. setImageBitmap ( bwBitmap )
FlowPilot This is an example from the real world that has become a trending topic in recent days!