OpenCV In Mobile Technology | Computer Vision on Mobile

dineshlakhzz 26 views 17 slides Jun 26, 2024
Slide 1
Slide 1 of 17
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
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...


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!

Ask me….

Thanks Guys! References… https://www.turing.com/kb/all-you-need-to-know-about-computer-vision https://neptune.ai/blog/15-computer-visions-projects https://medium.com/optisol-datalabs/first-opencv-android-project-simple-image-filter-in-android-d9ce4ff27968 https://kdr2.com/tech/main/1810-elewise-matrix-op-opencv.html Google, ChatGpt and bard :>)