<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Prasad Raju G on Medium]]></title>
        <description><![CDATA[Stories by Prasad Raju G on Medium]]></description>
        <link>https://medium.com/@iamprasadraju?source=rss-dc8b4215dcb0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zLbq4CI3CfXsZDWdzHmXig.jpeg</url>
            <title>Stories by Prasad Raju G on Medium</title>
            <link>https://medium.com/@iamprasadraju?source=rss-dc8b4215dcb0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 08:00:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iamprasadraju/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Early Approach —(K)*  Nearest Neighbor Classifier]]></title>
            <link>https://iamprasadraju.medium.com/the-early-approach-k-nearest-neighbor-classifier-b34dfbdd05f5?source=rss-dc8b4215dcb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/b34dfbdd05f5</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[knn]]></category>
            <category><![CDATA[mnist]]></category>
            <dc:creator><![CDATA[Prasad Raju G]]></dc:creator>
            <pubDate>Thu, 10 Apr 2025 16:44:55 GMT</pubDate>
            <atom:updated>2025-04-10T16:44:55.199Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Early Approach —(K)* Nearest Neighbor Classifier</h3><p>Spoiler : KNN is just a lazy algorithm one that stores and uses training data at prediction time</p><ol><li>What is <strong>Nearest Neighbors classifier ?</strong></li></ol><p>The nearest neighbor classifier is a simple and intuitive machine learning algorithm that classifies a data point based on the class of its closest data points in the feature space. It is a type of <em>instance-based learning</em> (or lazy learning) where no explicit training phase occurs; instead, the algorithm memorizes the training dataset and uses it directly for prediction.</p><p>How it works:</p><p><strong>Distance Calculation</strong>: For a given query point, the algorithm calculates the distance between it and all other points in the training dataset. Common distance metrics include:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/195/0*7FjETjrGv1-91QRP" /></figure><ul><li>Manhattan distance → Also called <em>Taxicab</em> or <em>City Block Distance</em>, it is the sum of the absolute differences between the Cartesian coordinates of two points. It represents the distance traveled along grid lines.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/185/1*caPyeyKpSxhNztEEGPoWoQ.png" /><figcaption>Manhattan distance</figcaption></figure><pre>def manhattan(a, b):<br>  return sum(abs(va11, val2) for val1, val2 in zip(a,b))<br><br># Using numpy<br>distance = np.linalg.norm(point_a - point_b, ord = 1) #The norm() function with ord=1 calculates the Manhattan distance by treating it as a special case of Minkowski distance<br></pre><ul><li>Euclidean distance → It is the straight-line distance between two points in Euclidean space, calculated using the Pythagorean theorem.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/151/1*Ev6C_eh1evVoYR9_fCarFw.png" /><figcaption>Euclidean distance</figcaption></figure><pre>import math<br><br>def euclidean(a, b):<br>  return math.sqrt(sum((val1 - val2) ** 2 for val1, val2 in zip(a, b))<br><br># Using Numpy<br>distance = np.linalg.norm(point_a - point_b, ord = 2) # The norm() function with ord=2 calculates the Euclidean distance by treating it as a special case of Minkowski distance.<br><br></pre><h3>STEPS TO IMPLEMENT KNN ALGORITHM:</h3><h4>Step 1: Load Your Dataset</h4><ul><li>Import your dataset into your programming environment.</li><li>Split the dataset into features and labels.</li><li>Divide the data into training and testing sets for evaluation.</li></ul><h4>Step 2: Choose a Distance Metric</h4><ul><li>Select a distance metric to measure similarity between data points. Common metrics include:</li><li>Euclidean distance</li><li>Manhattan distance</li><li>Hamming distance (for categorical data)</li></ul><h4>Step 3: Implement Distance Calculation</h4><ul><li>Develop a method to compute the distance between two points using the chosen metric.</li></ul><h4>Step 4: Find the Nearest Neighbors</h4><ul><li>For each test sample, calculate its distance to all training samples.</li><li>Sort the distances and select the k nearest neighbors.</li></ul><h4>Step 5: Make Predictions</h4><ul><li>For Classification:</li><li>Use majority voting among the k nearest neighbors&#39; labels.</li><li>Assign the most frequent class as the prediction.</li><li>For Regression:</li><li>Take the average of the target values of the k nearest neighbors.</li></ul><h4>Step 6: Iterate Over Test Data</h4><ul><li>For each test sample, find its k nearest neighbors and make predictions.</li></ul><h4>Step 7: Evaluate the Model</h4><ul><li>Compare predictions with actual labels in the test set.</li><li>Calculate metrics such as:</li><li>Accuracy for classification</li><li>Mean squared error or mean absolute error for regression</li></ul><h3>Step 8: Optimize Parameters (Optional)</h3><ul><li>Experiment with different values of k to improve model performance.</li></ul><h3><strong>Implementing of Nearest Neighbors classifier from scratch</strong></h3><pre>import numpy as np<br><br>class NearestNeighborClassifier:<br>  def __init__(self, k = 1):<br>    &quot;&quot;&quot;<br>    Initialize k-NN classifier with default k=1<br>    Parameters:<br>    k (int): Number of nearest neighbors to consider for voting<br>    &quot;&quot;&quot;<br>    self.k = k  # Store the k value<br>    self.X_train = None  # Placeholder for training features<br>    self.Y_train = None  # Placeholder for training labels<br><br>  def fit(self, X_train, Y_train):<br>    &quot;&quot;&quot;<br>    Store training data (lazy learner - no actual training)<br>    Parameters:<br>    X_train (array): Feature matrix of shape (n_samples, n_features)<br>    Y_train (array): Label vector of shape (n_samples,)<br>    &quot;&quot;&quot;<br>    # Simply memorize the training dataset<br>    self.X_train = X_train  # Store feature matrix<br>    self.Y_train = Y_train  # Store corresponding labels<br><br>  def predict(self, X_test):<br>    &quot;&quot;&quot;<br>    Predict labels for test samples<br>    Parameters:<br>    X_test (array): Feature matrix of shape (n_samples, n_features)<br>    Returns:<br>    array: Predicted labels for test data<br>    &quot;&quot;&quot;<br>    predictions = []<br>    <br>    # Process each test sample individually<br>    for test_sample in X_test:<br>      # Calculate Euclidean distances using vectorized operations<br>      # (More efficient than looping through each training sample)<br>      distances = np.linalg.norm(self.X_train - test_sample, axis=1)<br>      <br>      # Get indices of k smallest distances<br>      nearest_neighbors = np.argsort(distances)[:self.k]<br>      <br>      # Get labels of nearest neighbors<br>      nearest_labels = self.Y_train[nearest_neighbors]<br>      <br>      # Find most common label using majority vote<br>      # Counter.most_common(1) returns [(label, count)] format<br>      most_common_label = Counter(nearest_labels).most_common(1)[0][0]<br>      <br>      # Store prediction for current test sample<br>      predictions.append(most_common_label)<br><br>    # Convert list to numpy array for consistency<br>    return np.array(predictions)</pre><p>Example: <strong>Implementing of Nearest Neighbors classifier on MNIST Dataset</strong></p><ol><li>Download MNIST Dataset (csv or images) from <a href="https://github.com/iamavenger/Datasets/releases/tag/DATASETS">https://github.com/iamavenger/Datasets/releases/tag/DATASETS</a></li></ol><p>Read and convert data into Numpy arrays:</p><pre># For CSV File<br><br>import numpy as np<br>import pandas as pd<br><br>def load_mnistcsv(path):<br>    df = pd.read_csv(path)<br>    data = df.iloc[:, 1:]<br>    data = Normalization(data)<br>    data_labels = df.iloc[:, 0]<br>    return np.array(data), np.array(data_labels)<br><br># Normalize pixel values to [0, 1]<br>def Normalization(data):<br>    return data / 255.0</pre><pre># for images files<br><br>import numpy as np<br>import struct<br>import matplotlib.pyplot as plt<br>import os<br><br># Path configuration (update these paths to match your file locations)<br>FILE_PATHS = {<br>    &#39;train_images&#39;: &#39;MNIST_DATASET/train-images-idx3-ubyte/train-images-idx3-ubyte&#39;,<br>    &#39;train_labels&#39;: &#39;MNIST_DATASET/train-labels-idx1-ubyte/train-labels-idx1-ubyte&#39;,<br>    &#39;test_images&#39;: &#39;MNIST_DATASET/t10k-images-idx3-ubyte/t10k-images-idx3-ubyte&#39;,<br>    &#39;test_labels&#39;: &#39;MNIST_DATASET/t10k-labels-idx1-ubyte/t10k-labels-idx1-ubyte&#39;<br>}<br><br>def read_images(file_path):<br>    &quot;&quot;&quot;Read MNIST image data from binary file&quot;&quot;&quot;<br>    with open(file_path, &#39;rb&#39;) as f:<br>        magic, num_images = struct.unpack(&#39;&gt;II&#39;, f.read(8))<br>        rows, cols = struct.unpack(&#39;&gt;II&#39;, f.read(8))<br>        <br>        if magic != 2051:<br>            raise ValueError(f&quot;Invalid magic number {magic} for image file&quot;)<br>            <br>        image_data = np.frombuffer(f.read(), dtype=np.uint8)<br>        images = image_data.reshape(num_images, rows, cols)<br>    <br>    return images<br><br>def read_labels(file_path):<br>    &quot;&quot;&quot;Read MNIST label data from binary file&quot;&quot;&quot;<br>    with open(file_path, &#39;rb&#39;) as f:<br>        magic, num_labels = struct.unpack(&#39;&gt;II&#39;, f.read(8))<br>        <br>        if magic != 2049:<br>            raise ValueError(f&quot;Invalid magic number {magic} for label file&quot;)<br>            <br>        labels = np.frombuffer(f.read(), dtype=np.uint8)<br>    <br>    return labels<br><br>def load_mnist():<br>    &quot;&quot;&quot;Load entire MNIST dataset&quot;&quot;&quot;<br>    # Check if files exist<br>    for path in FILE_PATHS.values():<br>        if not os.path.exists(path):<br>            raise FileNotFoundError(f&quot;MNIST file not found: {path}&quot;)<br>    <br>    # Load data<br>    train_images = read_images(FILE_PATHS[&#39;train_images&#39;])<br>    train_labels = read_labels(FILE_PATHS[&#39;train_labels&#39;])<br>    test_images = read_images(FILE_PATHS[&#39;test_images&#39;])<br>    test_labels = read_labels(FILE_PATHS[&#39;test_labels&#39;])<br>    <br>    # Normalize pixel values to [0, 1]<br>    train_images = train_images.astype(np.float32) / 255.0<br>    test_images = test_images.astype(np.float32) / 255.0<br>    <br>    return (train_images, train_labels), (test_images, test_labels) # Returns tuples with ndArrays train(6000,) test(10000,)<br><br></pre><p>KNN ON MNIST :-</p><pre>import numpy as np<br>from MNIST_dataloadercsv import load_mnistcsv<br>from collections import Counter<br><br>X_train, Y_train = load_mnistcsv(r&quot;MNIST_DATASET_CSV\mnist_train.csv&quot;)<br>X_test, Y_test = load_mnistcsv(r&quot;MNIST_DATASET_CSV\mnist_test.csv&quot;)<br><br><br>class NearestNeighborClassifier:<br>  def __init__(self, k = 1):<br>    self.k = k<br>    self.X_train = None # Train data<br>    self.Y_train = None # Train labels<br><br>  def fit(self, X_train, Y_train):<br>    # Store the training data and labels<br>    self.X_train = X_train<br>    self.Y_train = Y_train<br><br>  def predict(self, X_test): # X_test -&gt; test data<br>    predictions  = []<br>    nearest_labels = []<br>    for test_sample in X_test:<br>      # Compute distance to all training samples<br>      distances = np.linalg.norm(self.X_train - test_sample, axis =  1) # Using Vectorized Computation (Super Fast) -&gt; Euclidien Distance<br>      # distances = np.sqrt(np.sum((self.X_train - test_sample) ** 2, axis = 1))      <br>      nearest_neighbors = np.argsort(distances)[:self.k]<br>      nearest_labels = self.Y_train[nearest_neighbors]<br>      <br>      <br>      most_common_label = Counter(nearest_labels).most_common(1)[0][0]<br>      predictions.append(most_common_label)<br><br>    return np.array(predictions)<br><br><br><br><br><br>knn = NearestNeighborClassifier()<br><br>knn.fit(X_train, Y_train)<br><br>predict = knn.predict(X_test)<br><br><br><br><br>accuracy = np.mean( predict == Y_test) * 100<br><br>print(f&quot;{accuracy:.2f}&quot;)</pre><h4>Hyperparameter Tuning ( k — value):</h4><p>Evaluate the model’s performance for different k values. This helps identify the k value that maximizes accuracy or minimizes error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*n5pIF_TZJklbqlPr6xLJZg.png" /></figure><p>Here k = 3 is the best value for mnist dataset</p><p>Accuracy ~ 90 %</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b34dfbdd05f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Evolution of Computer Vision]]></title>
            <link>https://iamprasadraju.medium.com/the-evolution-of-computer-vision-41d0e2ee0ea0?source=rss-dc8b4215dcb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/41d0e2ee0ea0</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Prasad Raju G]]></dc:creator>
            <pubDate>Fri, 21 Mar 2025 09:54:20 GMT</pubDate>
            <atom:updated>2025-03-21T09:57:05.314Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s digital era, billions of images and videos are generated daily — from social media uploads to endless CCTV footage — fueling a massive visual data surge. This flood of content, stored in public, government, and corporate databases, is revolutionizing problem-solving through computer vision. By transforming raw images into actionable insights, computer vision powers innovations like facial recognition, medical imaging, and automated surveillance, reshaping automation, security, and digital intelligence.</p><h3>What is Computer Vision ?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XlhCU7VxIozSOmLneuZH1w.png" /><figcaption>Computer Vision</figcaption></figure><p><strong>Computer vision</strong> is an <a href="https://en.wikipedia.org/wiki/Interdisciplinarity">interdisciplinary field</a> that deals with how computers can be made to gain high-level understanding from <a href="https://en.wikipedia.org/wiki/Digital_image">digital images</a> or <a href="https://en.wikipedia.org/wiki/Video">videos</a>. From the perspective of <a href="https://en.wikipedia.org/wiki/Engineering">engineering</a>, it seeks to automate tasks that the <a href="https://en.wikipedia.org/wiki/Human_visual_system">human visual system</a> can do. “Computer vision is concerned with the automatic extraction, analysis, and understanding of useful information from a single image or a sequence of images. It involves the development of a theoretical and algorithmic basis to achieve automatic visual understanding.” As a <a href="https://en.wikipedia.org/wiki/Scientific_discipline">scientific discipline</a>, computer vision is concerned with the theory behind artificial systems that extract information from images. The image data can take many forms, such as video sequences, views from multiple cameras, or multi-dimensional data.</p><h3>History of Computer Vision ?</h3><h3>1. The Early Days (1960s — 1980s): The Birth of Computer Vision</h3><p><strong>1960s:</strong></p><ul><li>The idea of teaching computers to “see” was explored in AI research.</li><li>Early work focused on <strong>simple object recognition</strong> using binary images.</li></ul><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>1970s:</strong></p><ul><li><strong>David Marr</strong> introduced a computational theory of vision, emphasizing edge detection and 3D scene reconstruction.</li><li><strong>Optical Character Recognition (OCR)</strong> was one of the first real-world applications.</li></ul><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>1980s:</strong></p><ul><li>Development of edge detection algorithms (e.g., <strong>Canny Edge Detector</strong>).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/566/1*DrxSIcxwNrR7Os7rjIUsiQ.png" /><figcaption>canny Edge Detection</figcaption></figure><ul><li>Focus on <strong>handcrafted feature extraction</strong> techniques.</li></ul><h3>2. Classical Computer Vision (1990s — Early 2000s): Feature-Based Methods</h3><p>The rise of <strong>feature detection and matching</strong> methods:</p><ul><li><strong>Harris Corner Detector</strong> (1988).</li><li><strong>Scale-Invariant Feature Transform (SIFT)</strong> (1999).</li><li><strong>Histogram of Oriented Gradients (HOG)</strong> (2005).</li></ul><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><ul><li><strong>Viola-Jones Face Detection (2001)</strong> made real-time face detection possible.</li><li><strong>Machine learning models (SVMs, Random Forests)</strong> were used for classification.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*yHUhaevCEhDEaOnO3DyMlw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TSjvQlDde90FQtoD9-9iHw.png" /><figcaption>Random Forest &amp; Support Vector machine</figcaption></figure><h3>3. Deep Learning Revolution (2012 — Present): Data-Driven Computer Vision</h3><ul><li><strong>2012: AlexNet</strong> won the ImageNet competition, proving the power of Convolutional Neural Networks (CNNs).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*XB-GLvslXu8zyKiyd3RoEw.png" /><figcaption>Alexnet — designed by <a href="https://en.wikipedia.org/wiki/Alex_Krizhevsky">Alex Krizhevsky</a> in collaboration with <a href="https://en.wikipedia.org/wiki/Ilya_Sutskever">Ilya Sutskever</a> and <a href="https://en.wikipedia.org/wiki/Geoffrey_Hinton">Geoffrey Hinton</a></figcaption></figure><p><strong>Advancements in Deep Learning:</strong></p><ul><li><strong>ResNet (2015):</strong> Solved vanishing gradients, enabling very deep networks.</li><li><strong>YOLO (2016):</strong> Real-time object detection.</li><li><strong>Vision Transformers (ViT, 2020):</strong> Introduced self-attention mechanisms to CV.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*SoXHGxDPUqFQHFbJKYoVLg.png" /><figcaption>Vision Transformer</figcaption></figure><h3>Typical Tasks in Computer Vision :</h3><h4>Recognition Tasks</h4><ul><li><strong>Object Recognition</strong>: Identifying objects or object classes in images (e.g., Google Lens).</li><li><strong>Identification</strong>: Recognizing a specific instance of an object (e.g., face or fingerprint recognition).</li><li><strong>Detection</strong>: Locating objects within an image (e.g., detecting obstacles in self-driving cars).</li><li><strong>Content-Based Image Retrieval</strong>: Finding images with similar content.</li><li><strong>Pose Estimation</strong>: Determining object orientation (e.g., robotic arm picking objects).</li><li><strong>Optical Character Recognition (OCR)</strong>: Recognizing printed/handwritten text (e.g., reading QR codes).</li><li><strong>Facial Recognition</strong>: Matching faces to a database (e.g., phone unlocking, surveillance).</li><li><strong>Emotion Recognition</strong>: Identifying emotions from facial expressions.</li><li><strong>Human Activity Recognition</strong>: Recognizing actions in videos (e.g., walking, picking up an object).</li></ul><h4>Motion Analysis</h4><ul><li><strong>Egomotion</strong>: Estimating camera movement from video.</li><li><strong>Tracking</strong>: Following moving objects or points (e.g., monitoring industrial machines).</li><li><strong>Optical Flow</strong>: Measuring pixel movement between frames.</li></ul><h4>Scene Reconstruction</h4><ul><li><strong>3D Model Generation</strong>: Constructing 3D scenes from 2D images.</li><li><strong>Point Cloud Stitching</strong>: Combining multiple 3D images into a complete model.</li></ul><h4>Image Restoration</h4><ul><li><strong>Noise Removal</strong>: Reducing blur, distortion, or sensor noise (e.g., enhancing low-light images).</li><li><strong>Image Inpainting</strong>: Restoring missing or damaged parts of an image.</li></ul><h4>System Methods</h4><ul><li><strong>Image Acquisition</strong>: Capturing images using various sensors (e.g., cameras, tomography, radar).</li></ul><p><strong>Pre-processing</strong>:</p><ul><li><strong>Re-sampling</strong>: Adjusting image coordinates.</li><li><strong>Noise Reduction</strong>: Removing unwanted distortions.</li><li><strong>Contrast Enhancement</strong>: Improving visibility.</li><li><strong>Scale Space Representation</strong>: Detecting objects at different scales.</li></ul><p><strong>Feature Extraction</strong>:</p><ul><li><strong>Low-Level Features</strong>: Edges, corners, blobs.</li><li><strong>High-Level Features</strong>: Texture, shape, motion.</li><li><strong>Detection/Segmentation</strong>:</li><li>Identifying objects or regions of interest.</li><li>Dividing images into layers (e.g., foreground, background).</li><li>Co-segmentation across multiple frames for video analysis.</li></ul><p><strong>High-Level Processing</strong>:</p><ul><li><strong>Model Verification</strong>: Ensuring extracted data is meaningful.</li><li><strong>Object Pose &amp; Size Estimation</strong>: Measuring position and dimensions.</li><li><strong>Image Recognition</strong>: Categorizing detected objects.</li><li><strong>Image Registration</strong>: Aligning images from different viewpoints.</li></ul><p><strong>Decision Making</strong>:</p><ul><li>Pass/fail in inspections.</li><li>Match/no-match in recognition tasks.</li><li>Flagging for human review (e.g., medical diagnosis, security).</li></ul><h4>Image-Understanding Systems</h4><ul><li><strong>Low-Level Processing</strong>: Detecting edges, textures, regions.</li><li><strong>Intermediate-Level Processing</strong>: Identifying boundaries, surfaces, and volumes.</li><li><strong>High-Level Processing</strong>: Understanding objects, scenes, and events.</li></ul><h4>Requirements for Image Understanding Systems (IUS)</h4><ul><li><strong>Representation</strong>: Storing prototypes, spatial/temporal knowledge, and scaling.</li><li><strong>Inference</strong>: Deriving new facts from images.</li><li><strong>Control Mechanisms</strong>: Selecting appropriate processing techniques dynamically.</li></ul><h3>Applications of Computer Vision ?</h3><p>Computer vision applications span diverse fields, including facial recognition in security, autonomous vehicles, medical imaging analysis, agriculture, and manufacturing, enabling tasks like object detection, image segmentation, and anomaly detection.</p><p>Here’s a more detailed look at some key areas:</p><p><strong>1. Security and Surveillance:</strong></p><ul><li><strong>Facial Recognition:</strong> Used for identification, access control, and law enforcement purposes.</li><li><strong>Object Detection:</strong> Identifying and tracking objects in real-time for security monitoring.</li><li><strong>Anomaly Detection:</strong> Identifying unusual events or behaviors in video footage.</li><li><strong>Surveillance Systems:</strong> Automating human supervision in security applications.</li></ul><p><strong>2. Healthcare:</strong></p><ul><li><strong>Medical Imaging Analysis:</strong> Analyzing medical images (X-rays, CT scans, MRIs) to aid in diagnosis and treatment planning.</li><li><strong>Disease Detection:</strong> Identifying diseases or abnormalities in medical images.</li><li><strong>Drug Discovery:</strong> Analyzing images of cells and tissues to accelerate drug development.</li></ul><p><strong>3. Autonomous Vehicles:</strong></p><ul><li><strong>Object Detection and Tracking:</strong> Identifying and tracking objects (pedestrians, cars, traffic signals) in the environment.</li><li><strong>Path Planning:</strong> Analyzing the environment to plan safe and efficient routes.</li><li><strong>Lane Detection:</strong> Identifying and following lane markings.</li></ul><p><strong>4. Agriculture:</strong></p><ul><li><strong>Precision Farming:</strong> Monitoring crop health, identifying diseases, and optimizing irrigation and fertilization.</li><li><strong>Crop Yield Estimation:</strong> Estimating crop yield based on visual data.</li><li><strong>Defect Detection:</strong> Identifying defects in crops or products.</li></ul><p><strong>5. Manufacturing:</strong></p><ul><li><strong>Quality Control:</strong> Inspecting products for defects or anomalies.</li><li><strong>Robotics:</strong> Guiding robots to perform tasks like assembly or inspection.</li><li><strong>Defect Detection:</strong> Identifying defects in products with precision.</li></ul><p><strong>6. Retail:</strong></p><ul><li><strong>Inventory Management:</strong> Tracking inventory levels and identifying low-stock items.</li><li><strong>Customer Analytics:</strong> Analyzing customer behavior in stores.</li><li><strong>Image-Based Search:</strong> Allowing customers to search for products using images.</li></ul><p><strong>7. Other Applications:</strong></p><ul><li><strong>Interactive Entertainment:</strong> Creating realistic and immersive experiences in video games and virtual reality.</li><li><strong>Human-Computer Interaction:</strong> Enabling natural and intuitive interaction with computers through gestures and facial expressions.</li><li><strong>Character Recognition:</strong> Identifying handwritten or printed text.</li><li><strong>Pose Estimation:</strong> Determining the pose of objects or people in images or videos.</li><li><strong>Image Segmentation:</strong> Dividing an image into different regions or objects.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41d0e2ee0ea0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is an Image ?]]></title>
            <link>https://iamprasadraju.medium.com/what-is-an-image-387a154de105?source=rss-dc8b4215dcb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/387a154de105</guid>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[image]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[image-classification]]></category>
            <dc:creator><![CDATA[Prasad Raju G]]></dc:creator>
            <pubDate>Tue, 11 Mar 2025 16:17:54 GMT</pubDate>
            <atom:updated>2025-03-11T16:17:54.354Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is an Image ?</h3><p>An <strong>image</strong> is a visual representation. An image can be <a href="https://en.wikipedia.org/wiki/Two-dimensional_space">two-dimensional</a>, such as a <a href="https://en.wikipedia.org/wiki/Drawing">drawing</a>, <a href="https://en.wikipedia.org/wiki/Painting">painting</a>, or <a href="https://en.wikipedia.org/wiki/Photograph">photograph</a>, or <a href="https://en.wikipedia.org/wiki/Three-dimensional_space">three-dimensional</a>, such as a <a href="https://en.wikipedia.org/wiki/Carving">carving</a> or <a href="https://en.wikipedia.org/wiki/Sculpture">sculpture</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DfuSyEZ472tMaFnQNI21xA.jpeg" /><figcaption>A <a href="https://en.wikipedia.org/wiki/Synthetic_aperture_radar">synthetic-aperture radar</a> <a href="https://en.wikipedia.org/wiki/Radar_imaging">image</a> acquired by the SIR-C/X-SAR radar on board the <a href="https://en.wikipedia.org/wiki/Space_Shuttle_Endeavour">Space Shuttle <em>Endeavour</em></a> shows the <a href="https://en.wikipedia.org/wiki/Teide">Teide</a> volcano.</figcaption></figure><h3>Digital Image</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*78fIdklLfCFfl8Sr4-KfJA.png" /><figcaption>The <a href="https://en.wikipedia.org/wiki/Smiley">smiley face</a> in the top left corner is a raster image</figcaption></figure><p>A <strong>digital image</strong> is an <a href="https://en.wikipedia.org/wiki/Image">image</a> composed of <a href="https://en.wikipedia.org/wiki/Pixel">picture elements</a>, also known as <a href="https://en.wikipedia.org/wiki/Pixel">pixels</a>, each with <a href="https://en.wikipedia.org/wiki/Natural_number"><em>finite</em></a>, <a href="https://en.wikipedia.org/wiki/Discrete_mathematics"><em>discrete quantities</em></a> of numeric representation for its <a href="https://en.wikipedia.org/wiki/Amplitude">intensity</a> or <a href="https://en.wikipedia.org/wiki/Gray_level">gray level</a> that is an output from its <a href="https://en.wikipedia.org/wiki/Function_(mathematics)">two-dimensional functions</a> fed as input by its <a href="https://en.wikipedia.org/wiki/Spatial_coordinates">spatial coordinates</a> denoted with <em>x</em>, <em>y</em> on the x-axis and y-axis, respectively. Depending on whether the <a href="https://en.wikipedia.org/wiki/Image_resolution">image resolution</a> is fixed, it may be of <a href="https://en.wikipedia.org/wiki/Vector_graphics">vector</a>(SVG) or <a href="https://en.wikipedia.org/wiki/Raster_graphics">raster</a> (GIF, PNG, JPEG) type. By itself, the term “digital image” usually refers to <a href="https://en.wikipedia.org/wiki/Raster_graphics">raster images</a> or <a href="https://en.wikipedia.org/wiki/Bitmap">bitmapped</a> images (as opposed to <a href="https://en.wikipedia.org/wiki/Vector_graphics">vector images</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*YOXx-KEXAhhAETbA8k8Qnw.png" /></figure><h4>Types of Images</h4><ol><li><strong>Raster Images (Bitmap)</strong> — Made up of pixels (e.g., JPEG, PNG, GIF).</li><li><strong>Vector Images</strong> — Made up of mathematical shapes and paths (e.g., SVG, AI).</li><li><strong>3D Images</strong> — Represent three-dimensional objects (e.g., 3D models, rendered graphics).</li></ol><h3>Digital Image Representation</h3><p>A digital image is stored as an array of numbers (pixels) where each pixel represents a color or intensity. It can be:</p><ul><li><strong>Grayscale</strong> — Single intensity values (black &amp; white).</li><li><strong>RGB (Red, Green, Blue)</strong> — Each pixel has three color components.</li><li><strong>CMYK (Cyan, Magenta, Yellow, Black)</strong> — Used in printing.</li></ul><h3><strong>How Computers see images ?</strong></h3><p>A computer sees the image as a matrix of pixels! A pixel is the smallest entity of an image and is characterized by some values that represent the intensity of the colors in that pixel. The computer sees only those! But for us, it is these values that make us see what we see!</p><p>Here’s a breakdown of how they interpret images:</p><ol><li><strong>Binary Image</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*fgWNlgfgHaJjOtFwUYy5dQ.png" /><figcaption>Example Image for Binary Image</figcaption></figure><p>A <strong>binary image</strong> is a <a href="https://en.wikipedia.org/wiki/Digital_image">digital image</a> that consists of <a href="https://en.wikipedia.org/wiki/Pixels">pixels</a> that can have one of exactly two colors, usually black and white. Each pixel is stored as a single <a href="https://en.wikipedia.org/wiki/Bit">bit</a> — i.e. either a 0 or 1.</p><p>A binary image can be stored in memory as a <a href="https://en.wikipedia.org/wiki/Bitmap">bitmap</a>: a packed array of bits. A binary image of 640×480 pixels has a file size of only 37.5 <a href="https://en.wikipedia.org/wiki/Kibibyte">KiB</a>.</p><p><strong>2. Grayscale Image</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/150/1*uKScwesN-JBluopKt1e81w.png" /><figcaption>Grayscale image of a parrot</figcaption></figure><p><strong>Grayscale</strong> <a href="https://en.wikipedia.org/wiki/Image">image</a> is one in which the value of each <a href="https://en.wikipedia.org/wiki/Pixel">pixel</a> is a single <a href="https://en.wikipedia.org/wiki/Sample_(signal)">sample</a> representing only an <em>amount</em> of <a href="https://en.wikipedia.org/wiki/Light">light</a>; that is, it carries only <a href="https://en.wikipedia.org/wiki/Luminous_intensity">intensity</a> information. Grayscale images, are <a href="https://en.wikipedia.org/wiki/Black-and-white">black-and-white</a> or gray <a href="https://en.wikipedia.org/wiki/Monochrome">monochrome</a>, and composed exclusively of <a href="https://en.wikipedia.org/wiki/Shades_of_gray">shades of gray</a>. The <a href="https://en.wikipedia.org/wiki/Contrast_(vision)">contrast</a> ranges from <a href="https://en.wikipedia.org/wiki/Black">black</a> at the weakest intensity to <a href="https://en.wikipedia.org/wiki/White">white</a> at the strongest.</p><p>Each pixel has a single intensity value (0 to 255 in 8-bit images), where 0 is black, and 255 is white.</p><p><strong>3. Color Images</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gUEaZMMzPi34ne9R_7GQXA.jpeg" /><figcaption>The first color photograph made by the three-color method suggested by <a href="https://en.wikipedia.org/wiki/James_Clerk_Maxwell">James Clerk Maxwell</a> in 1855</figcaption></figure><p>A <strong>color image</strong> is an image that contains multiple colors, typically represented using three primary color channels: <strong>Red (R), Green (G), and Blue (B)</strong>. Each pixel in a color image is a combination of these three channels, creating a wide range of colors.</p><p>In an <strong>8-bit per channel RGB image</strong>, each pixel has three color channels: <strong>Red (R), Green (G), and Blue (B)</strong>. Each channel can take values from <strong>0 to 255</strong> (total <strong>256</strong> values per channel).</p><p>The total number of possible colors is calculated as:</p><p>Total Colors = 256 × 256 × 256 = 16,777,216</p><p>So, an <strong>8-bit RGB image can represent approximately 16.7 million colors</strong>.</p><h4><strong>Color Depth and Higher Bit Images :</strong></h4><ul><li><strong>8-bit per channel (24-bit color)</strong> → <strong>16.7 million colors</strong> (standard for most displays and images).</li><li><strong>10-bit per channel (30-bit color)</strong> → <strong>1.07 billion colors</strong>.</li><li><strong>12-bit per channel (36-bit color)</strong> → <strong>68.7 billion colors</strong>.</li><li><strong>16-bit per channel (48-bit color)</strong> → <strong>Over 281 trillion colors</strong>.</li></ul><p>Higher bit depths are used in professional photography, high-end monitors, and HDR (High Dynamic Range) images.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=387a154de105" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>