<?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 Abhishikta Dhar on Medium]]></title>
        <description><![CDATA[Stories by Abhishikta Dhar on Medium]]></description>
        <link>https://medium.com/@abhishiktadhar111?source=rss-18111f5a8d7a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*41X-nXvGB2N1A0j-c5905Q.jpeg</url>
            <title>Stories by Abhishikta Dhar on Medium</title>
            <link>https://medium.com/@abhishiktadhar111?source=rss-18111f5a8d7a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 13:02:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhishiktadhar111/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[Automating Team Emails with n8n, AI, and Google Sheets]]></title>
            <link>https://medium.com/@abhishiktadhar111/automating-team-emails-with-n8n-ai-and-google-sheets-4e18d42d608b?source=rss-18111f5a8d7a------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e18d42d608b</guid>
            <category><![CDATA[n8n-workflow]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[n8n]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Abhishikta Dhar]]></dc:creator>
            <pubDate>Mon, 15 Sep 2025 10:04:59 GMT</pubDate>
            <atom:updated>2025-09-15T10:04:59.815Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>AI won’t replace you. But a person using AI will.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Gwxpr3Vw1Kr8tAD2" /></figure><p>Keeping your team in the loop is essential, but writing the same reminder emails every day?<br>That’s time you could spend on real work.</p><p>Here’s how I built a <strong>simple n8n workflow</strong> that takes a short request — like <em>“Ask the team for daily updates”</em> — and automatically:</p><ul><li>Expands it into a polished email with AI</li><li>Grabs the recipient list from Google Sheets</li><li>Sends the message through Gmail</li></ul><p>Set it up once, and it runs forever.</p><h3>What Is n8n?</h3><p>If you haven’t tried it yet, <strong>n8n</strong> (pronounced <em>“n-eight-n”</em>) is an open-source automation tool.<br>Think of it as <strong>Lego for workflows</strong>: you drag and drop “nodes,” connect them visually, and watch data flow from one service to another.</p><p>Because it’s open source, you can host it yourself or use the cloud version. It supports hundreds of integrations — Google Sheets, Gmail, Slack, databases, APIs — without needing to write much code. And when you do want to customize, each step can run JavaScript for total flexibility.</p><h3>The Five-Node Workflow</h3><p>Here’s the high-level picture:</p><ol><li><strong>Webhook</strong> — Accepts a short instruction.</li><li><strong>AI Agent</strong> — Turns that instruction into a complete email.</li><li><strong>Google Sheets</strong> — Supplies employee names and addresses.</li><li><strong>Code</strong> — Checks every email address for typos.</li><li><strong>Gmail</strong> — Sends the final email.</li></ol><p>Let’s break those down.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zF_Hkxr4iCKsoPrA" /></figure><h3>1. Webhook Trigger</h3><p>A Webhook node starts the process.<br>Send a POST request with a single text field — something like:</p><pre>{<br>    &quot;message&quot;:&quot;Request a daily update from the team.&quot;<br>}</pre><p>That message is all the workflow needs to begin.</p><h3>2. AI Generates the Email</h3><p>Next, the text is passed to an <strong>AI Agent</strong> powered by an OpenAI model.<br>The prompt instructs the AI to:</p><ul><li>Turn the short request into a professional email.</li><li>If it’s an update request, include sections for completed tasks, ongoing work, and blockers.</li><li>Specify when updates are due (for example, “by 5:00 PM IST”).</li><li>Provide a subject line and a clear closing.</li></ul><p>In a few seconds, you have a well-written email ready to send.</p><h3>3. Fetch Recipients from Google Sheets</h3><p>A <strong>Google Sheets node</strong> retrieves names and email addresses from a shared spreadsheet.<br>This keeps the recipient list easy to update — add or remove rows in the sheet and the workflow adjusts automatically.</p><h3>4. Validate Email Addresses</h3><p>Before sending, a small <strong>Code node</strong> runs a regular-expression check to ensure each address is valid.<br>Invalid entries are logged and skipped, preventing bounce errors.</p><h3>5. Send with Gmail</h3><p>Finally, a <strong>Gmail node</strong> delivers the AI-generated email to every validated address.<br>The subject, body, and closing text all come directly from the AI output.</p><h3>Benefits of This Setup</h3><ul><li><strong>Time saver:</strong> No more rewriting similar messages or copying addresses.</li><li><strong>Professional tone:</strong> AI ensures every email is clear and courteous.</li><li><strong>Easy to scale:</strong> Works for three recipients or three hundred.</li><li><strong>Error-resistant:</strong> Built-in email validation reduces failed sends.</li></ul><h3>Ideas for Future Enhancements</h3><p>This workflow is intentionally simple, but you can extend it:</p><ul><li>Post the same update to Slack or Microsoft Teams.</li><li>Store a log of each sent email in a database or another Google Sheet.</li><li>Add conditional logic to handle different types of requests (daily vs. weekly).</li><li>Offer multi-language email generation by adjusting the AI prompt.</li></ul><h3>Conclusion</h3><p>With n8n, a few nodes are enough to automate a task that normally eats up valuable time.<br>Instead of writing and sending the same reminders every day, you can now send a single webhook request and let the workflow handle the rest — AI drafting the email, validating addresses, and delivering messages automatically.</p><p>Automation like this isn’t just convenient; it keeps communication consistent and frees you to focus on work that matters.</p><p><em>Happy automating!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e18d42d608b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Feature Extraction and Classification in Hyperspectral Images]]></title>
            <link>https://medium.com/@abhishiktadhar111/feature-extraction-and-classification-in-hyperspectral-images-2a79c8345ecb?source=rss-18111f5a8d7a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a79c8345ecb</guid>
            <category><![CDATA[semi-supervised-learning]]></category>
            <category><![CDATA[remote-sensing]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[feature-extraction]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Abhishikta Dhar]]></dc:creator>
            <pubDate>Wed, 18 Sep 2024 16:28:27 GMT</pubDate>
            <atom:updated>2024-09-22T11:10:36.798Z</atom:updated>
            <content:encoded><![CDATA[<p><em>In hyperspectral image (HSI) analysis, the challenge lies in handling the high-dimensional data that contains detailed spectral information. Mixed pixel classification is one such problem, where individual pixels may represent a combination of different materials. This blog will explore a semi-supervised approach for hyperspectral image classification using feature extraction via Principal Component Analysis (PCA) and classification through a 3D Convolutional Neural Network (3D CNN). Our method is demonstrated using the Samson dataset.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fDjeDkm-JUxqdBHDqjqWjw.png" /><figcaption>Samson and its ground truths (GT:<em>abundances</em> and GT:<em>endmembers</em>) Source: <a href="https://lesun.weebly.com/hyperspectral-data-set.html">Weebly</a></figcaption></figure><p><em>Hyperspectral imaging captures a wide spectrum of light for each pixel in an image, resulting in hundreds of spectral bands. Each pixel contains rich information, which makes HSI useful for a variety of applications such as remote sensing, agriculture, and mineral exploration. However, the high dimensionality of hyperspectral data presents challenges for analysis, including increased computational costs and difficulty in training models due to the small size of labeled datasets.</em></p><h3>Problem: Mixed Pixel Classification</h3><p>In HSI, each pixel can be a mixture of different materials, leading to mixed pixel classification challenges. Classifying these mixed pixels requires robust feature extraction and effective modeling techniques to handle the complexities of the data. Here, we use PCA for unsupervised feature extraction followed by a 3D CNN to classify these features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*38YOEtGam_4P07QXJ5BNyA.png" /><figcaption>Flowchart of the Model</figcaption></figure><h3>Step 1: Feature Extraction using PCA</h3><p>PCA is a dimensionality reduction technique that transforms high-dimensional data into a lower-dimensional space by capturing the variance in the dataset. In our semi-supervised model, we use PCA as an unsupervised method to extract the most significant features from the hyperspectral data.</p><p>The code for applying PCA is:</p><pre>from sklearn.decomposition import PCA<br><br>def applyPCA(X, numComponents=75):<br>    newX = np.reshape(X, (-1, X.shape[2]))<br>    pca = PCA(n_components=numComponents, whiten=True)<br>    newX = pca.fit_transform(newX)<br>    newX = np.reshape(newX, (X.shape[0],X.shape[1], numComponents))<br>    return newX, pca<br><br>HSI,pca = applyPCA(HSI,numComponents=6)<br>HSI.shape</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5oDTOZU2Wv4IjALAZ5XHNQ.png" /><figcaption>Feature Extraction</figcaption></figure><p>Here, the dataset is reduced to 6 components, where each component represents a linear combination of the original spectral bands, effectively capturing the variance of the original data.</p><h3>Step 2: Building the 3D CNN Model</h3><p>The extracted features are fed into a 3D CNN model for classification. The advantage of using a 3D CNN is that it can capture both the spectral and spatial features of the hyperspectral data. The architecture includes layers of 3D convolutions, pooling, and dense layers to perform the classification task.</p><p>3D CNN model code:</p><pre>import keras<br>from keras.layers import Dropout, Input, Conv2D, Conv3D, MaxPooling3D, Flatten, Dense, Reshape, BatchNormalization, UpSampling3D<br>from keras.models import Sequential, Model<br><br>input_layer = Input((3, 3, 6, 1))<br><br>leaky_relu = layers.LeakyReLU(alpha=0.1)<br><br>conv_layer1 = Conv3D(filters=16, kernel_size=(1, 1, 1), activation=leaky_relu)(input_layer)<br>conv_layer2 = Conv3D(filters=32, kernel_size=(1, 1, 1), activation=leaky_relu)(conv_layer1)<br>conv_layer3 = Conv3D(filters=64, kernel_size=(1, 1, 1), activation=leaky_relu)(conv_layer2)<br>conv_layer4 = Conv3D(filters=128, kernel_size=(1, 1, 1), activation=leaky_relu)(conv_layer3)<br>conv_layer5 = Conv3D(filters=256, kernel_size=(1, 1, 1), activation=leaky_relu)(conv_layer4)<br><br>flatten_layer = Flatten()(conv_layer5)<br><br>dense_layer1 = Dense(units=128, activation=leaky_relu)(flatten_layer)<br>dense_layer1 = Dropout(0.5)(dense_layer1)<br>output_layer = Dense(units=3, activation=&#39;softmax&#39;)(dense_layer1)<br><br>model = Model(inputs=input_layer, outputs=output_layer)<br>model.summary()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*CkTbZJK3-puzKhHjnyGxZA.png" /><figcaption>Model Summary</figcaption></figure><p>This model uses 3D convolution layers to extract meaningful patterns from the hyperspectral data. After several convolution and pooling layers, the features are flattened and passed through dense layers for classification.</p><h3>Step 3: Constructing the Classified Map</h3><p>After the 3D CNN model has been trained on the reduced features, we proceed to classify the mixed pixels and construct the classified map. This map visually represents the classification results for each pixel, showing which material (e.g., soil, water, tree) the pixel belongs to.</p><pre>def Patch(data,height_index,width_index,label_index):<br>    height_slice = slice(height_index, height_index+PATCH_SIZE)<br>    width_slice = slice(width_index, width_index+PATCH_SIZE)<br>    label_slice = slice(label_index, label_index+PATCH_SIZE)<br>    patch = data[height_slice, width_slice, :]<br>    return patch<br><br>outputs = np.zeros((height, width, label))<br><br>for i in range(height):<br>    for j in range(width):<br>        image_patch = Patch(HSI, i, j, label)<br>        X_test_image = image_patch.reshape(1, image_patch.shape[0], image_patch.shape[1], image_patch.shape[2], 1).astype(&#39;float32&#39;)  <br>        prediction = model.predict(X_test_image)<br>        outputs[i, j, :] = prediction<br>outputs = np.abs(outputs) <br>outputs /= np.sum(outputs, axis=-1, keepdims=True)<br><br>def plot_data(data):<br>    fig = plt.figure(figsize=(8, 8))<br>    plt.imshow(data, cmap=&#39;nipy_spectral&#39;)<br>    plt.colorbar()<br>    plt.axis(&#39;off&#39;)<br>    plt.show()<br><br>plot_data(outputs)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*EwlzjOO6e06g84KgfheoXw.png" /><figcaption>Classified Map</figcaption></figure><pre>np.set_printoptions(suppress=True)<br><br>import matplotlib.pyplot as plt<br><br>for k in range(label):<br>    plt.figure(figsize=(8, 8))<br>    plt.title(f&quot;Abundance Map for Endmember {k+1}&quot;)<br>    plt.imshow(outputs[:, :, k])<br>    plt.colorbar()<br>    plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*07zEJsJWphe03Q8PJjp7ew.png" /><figcaption>Abundance Maps of each Endmembers</figcaption></figure><h3>Step 4: Endmember Estimation in Mixed Pixels</h3><p>After constructing the classified map, the next step is to evaluate the accuracy of the model in estimating the contribution of each material (endmember) in the mixed pixels. This is done by comparing the predicted values of the mixed pixels with the ground truth values (true composition of the materials).</p><pre>import math<br>MSE = np.square(np.subtract(GT,outputs)).mean()</pre><p>The MSE value gives an indication of how well the model predicts the proportions of different materials in the mixed pixels. A lower MSE means that the model’s predictions are closer to the true endmember values.</p><pre>print(outputs)</pre><p>The outputs array contains the estimated proportions of each endmember for every mixed pixel. Each pixel may contain a mixture of materials, and the outputs array shows how much of each endmember (e.g., 30% soil, 50% water, 20% tree) is present in the pixel.</p><p>The outputs will show values for each endmember per pixel, which can be further used to analyze the material composition in the hyperspectral image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*hrBB1Cu1UtADcWfRmmCQaQ.png" /><figcaption><em>Estimated proportions of each endmember for every mixed pixel</em></figcaption></figure><p><strong>Endmember estimation</strong>, which is critical for understanding the material composition of mixed pixels in hyperspectral imagery. By calculating the MSE between the predicted and actual endmember values, we can assess how accurately the model captures the true material distributions.</p><h3>Semi-Supervised Learning Approach</h3><p>In this approach, the unsupervised PCA extracts features, which are then classified using the labeled data in the 3D CNN. The semi-supervised nature arises from the fact that PCA works without label information, while the 3D CNN learns from the labeled data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qp4B5OdrMc-toQW96FmsSQ.png" /><figcaption>PCA and 3D CNN combined Model</figcaption></figure><h3>Conclusion</h3><p><em>This semi-supervised framework allows for dimensionality reduction and classification, especially in cases where labeled data is limited. By applying PCA to reduce the dimensionality and 3D CNN to classify, we achieve significant accuracy in the Samson dataset, demonstrating the effectiveness of combining unsupervised and supervised learning techniques in hyperspectral image analysis.</em></p><p><em>This approach offers a solution to the challenge of mixed pixel classification in hyperspectral imaging, providing a balance between computational efficiency and classification accuracy.</em></p><p><em>This blog gives an overview of the semi-supervised model for hyperspectral image classification using PCA for feature extraction and 3D CNN for classification, with a practical application to the Samson dataset.</em></p><p>For the complete code, you can refer to the GitHub repository:<strong> </strong><a href="https://github.com/mistiiberry-exe/hyperspectral_image_classification"><strong><em>Hyperspectral Image Classification</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a79c8345ecb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying Feature Extraction]]></title>
            <link>https://blog.gopenai.com/demystifying-feature-extraction-ded0d2ca9e2e?source=rss-18111f5a8d7a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ded0d2ca9e2e</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-preprocessing]]></category>
            <category><![CDATA[feature-extraction]]></category>
            <dc:creator><![CDATA[Abhishikta Dhar]]></dc:creator>
            <pubDate>Sat, 07 Oct 2023 05:41:37 GMT</pubDate>
            <atom:updated>2025-01-23T13:56:36.940Z</atom:updated>
            <content:encoded><![CDATA[<h3>Explore Feature Extraction</h3><p><em>Welcome to my exploration of the fascinating world of feature extraction — a crucial step in data preprocessing that can significantly impact the effectiveness of your machine-learning models. Whether you’re an aspiring data scientist or a seasoned AI enthusiast, understanding how to transform raw data into meaningful features is key to extracting valuable insights and building high-performing models.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZrGWyMwB3UmAWYdcpRqSMQ.png" /></figure><p><em>You might be wondering what exactly is feature extraction. No worries, as you dig further you will discover more. But here, let me give a short introduction to it. Feature extraction is the process of converting raw data into a set of meaningful features that facilitate better understanding and analysis. These features serve as the foundation for training machine learning models. Essentially, feature extraction transforms complex, raw data into a simplified, more manageable representation, making it easier to work with and analyze.</em></p><h3>Why is Feature Extraction Important?</h3><p>The importance of feature extraction cannot be overstated in the realm of data analysis and machine learning. Here are some compelling reasons why it’s a crucial step:</p><ul><li><strong><em>Enhanced Model Performance:</em></strong><em> Effective feature extraction enhances a model’s performance by providing it with relevant and discriminative features. This, in turn, allows the model to learn more efficiently and make accurate predictions.</em></li><li><strong><em>Dimensionality Reduction:</em></strong><em> Feature extraction helps in reducing the dimensionality of the dataset by selecting or creating a subset of relevant features. This not only simplifies the model but also mitigates the “curse of dimensionality.”</em></li><li><strong><em>Improved Interpretability:</em></strong><em> Extracted features are often more interpretable and easier to understand, enabling better insights into the underlying data patterns and relationships.</em></li></ul><h3>Common Types of Data and Their Features</h3><p>Different types of data require different approaches to feature extraction:</p><ol><li><strong>Numerical Data:</strong> Features for numerical data might include statistical measures like mean, median, variance, and other central tendency measures.</li><li><strong>Text Data:</strong> For text data, features can be generated using techniques such as TF-IDF, word embeddings (e.g., Word2Vec, GloVe), or n-grams.</li><li><strong>Image Data:</strong> Image-based features can include color histograms, texture analysis, edge detection, and features extracted from deep learning models like Convolutional Neural Networks (CNNs).</li><li><strong>Time Series Data:</strong> Time series data often involves features like moving averages, autoregressive models, Fourier transforms, and wavelet transforms to capture temporal patterns.</li></ol><h3>Overview of Feature Extraction Methods</h3><p>Let’s delve into the most common feature extraction methods:</p><h4><strong>* Statistical Feature Extraction:</strong></h4><p><em>Statistical feature extraction involves calculating statistical properties of the data, such as mean, median, standard deviation, and skewness. These metrics provide valuable insights into the distribution and characteristics of the data.</em></p><p><em>For instance, if we’re analyzing a dataset of customer purchases, calculating the mean and standard deviation of purchase amounts can offer insights into spending habits.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*lprDV78JfYzrqPWZ7vwpzQ.png" /><figcaption>Source: <a href="https://images.app.goo.gl/SK8Dwwwq2nLfUUk49">Research Gate</a></figcaption></figure><h4>* Text-based Feature Extraction:</h4><p><em>In text data, feature extraction methods include TF-IDF (Term Frequency-Inverse Document Frequency), which evaluates the importance of a word in a document relative to a collection of documents. Word embeddings, such as Word2Vec and GloVe, represent words in a vector space based on their context, allowing for semantic understanding.</em></p><p><em>For example, using TF-IDF, we can determine the importance of words in a collection of customer reviews about a product.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lb2wnhjRmeRgWySb.png" /><figcaption>Source: <a href="https://images.app.goo.gl/NJNNLvGjnrbM4zYA6">Analytics Vidya</a></figcaption></figure><h4>* Image-based Feature Extraction:</h4><p><em>Image-based feature extraction methods are critical in computer vision. Techniques like color histograms, texture analysis, and edge detection can help characterize an image. Deep learning models, especially Convolutional Neural Networks (CNNs), automatically extract rich features from images.</em></p><p><em>For example, CNNs can be used to extract features from images for tasks like object detection or facial recognition.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*Usr98FJADPSxgkztLKlbMg.jpeg" /><figcaption>Source: <a href="https://images.app.goo.gl/gKYrgv27WiaC4RWx7">perClass BV</a></figcaption></figure><h4>* Time Series Feature Extraction:</h4><p><em>Time series data often involves extracting features to capture patterns over time. This can include moving averages, autoregressive models, Fourier transforms, and wavelet transforms, among others.</em></p><p><em>For instance, in stock market analysis, Fourier transforms can help identify dominant cycles or frequencies in stock price fluctuations.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*37hKq0l5RnEhmSy9uJa-_A.png" /><figcaption>Source: <a href="https://images.app.goo.gl/MmsB3cnHy3YVYXoA8">Semantic Scholar</a></figcaption></figure><h3>Feature Engineering vs. Feature Extraction</h3><p>In the realm of machine learning and data analysis, feature engineering and feature extraction are two vital processes that significantly influence the success and effectiveness of models. Both are crucial steps in data preprocessing, allowing raw data to be transformed into a suitable format for machine learning algorithms. While feature extraction involves creating new features from existing data, feature engineering involves creating new features or modifying existing ones to improve model performance. Both are crucial in model development and deciding between them depends on the specific dataset and problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*ZfK9SeYyvRdZkEpft8rLkw.png" /><figcaption>Feature Extraction Vs Feature Engineering</figcaption></figure><h3>Considerations and Best Practices</h3><p>Feature extraction is a critical step in data preprocessing, shaping the foundation of successful machine learning models. Effective feature extraction can significantly impact model performance and the insights derived from the data. During feature extraction, it’s important to consider factors such as handling missing values, scaling features, and normalization to ensure consistent and reliable features. Proper preprocessing lays the foundation for effective feature extraction. Let’s explore these considerations and guidelines for extracting features from your data.</p><ol><li><strong>Understand Your Data and Problem Domain:</strong> <em>Before embarking on feature extraction, it’s crucial to thoroughly understand the dataset and the problem you’re addressing. Different datasets and problems may require tailored feature extraction approaches. Understanding the underlying patterns, relationships, and characteristics of the data is key to selecting appropriate feature extraction techniques.</em></li><li><strong>Choose the Right Feature Extraction Techniques:</strong> <em>Select feature extraction techniques based on the type of data you’re working with — numerical, text, image, time series, or other types. Each data type may require specific techniques for optimal feature extraction. For instance, statistical methods work well for numerical data, while text-based data might benefit from TF-IDF or word embeddings.</em></li><li><strong>Handle Missing Values Appropriately: </strong><em>Address missing values before feature extraction to prevent potential biases or errors. Depending on the scenario, you can either remove instances with missing values, impute missing values using statistical measures, or use more sophisticated imputation methods.</em></li><li><strong>Consider Dimensionality Reduction: </strong><em>For high-dimensional datasets, consider applying dimensionality reduction techniques like Principal Component Analysis (PCA). Dimensionality reduction can help reduce the computational load and potential overfitting while retaining essential information.</em></li><li><strong>Avoid Overfitting:</strong> <em>Guard against overfitting, a common concern during feature extraction. Overfitting occurs when the model learns noise in the data rather than meaningful patterns. Regularization techniques, cross-validation, and careful feature selection can help mitigate overfitting.</em></li></ol><p>By considering these best practices and adhering to sound principles during feature extraction, you set the stage for more robust and effective machine learning models.</p><h3>Conclusion</h3><p><em>Feature extraction is a vital step in the data preprocessing pipeline. The choice of appropriate feature extraction methods can profoundly impact the performance and interpretability of machine learning models. By understanding and utilizing various feature extraction techniques, you can unlock the true potential of your data and build models that accurately represent the underlying patterns.</em></p><p><em>In this blog, I’ve covered the fundamental concepts and common methods of feature extraction. Tailoring feature extraction to your specific dataset and problem domain is the key to deriving valuable insights and achieving optimal model performance. Experiment with these techniques, adapt them to your datasets, and explore how they can elevate your data analysis and machine learning projects. Happy feature extracting!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ded0d2ca9e2e" width="1" height="1" alt=""><hr><p><a href="https://blog.gopenai.com/demystifying-feature-extraction-ded0d2ca9e2e">Demystifying Feature Extraction</a> was originally published in <a href="https://blog.gopenai.com/">GoPenAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Comprehensive Guide to Data Cleaning Techniques]]></title>
            <link>https://medium.com/@abhishiktadhar111/a-comprehensive-guide-to-data-cleaning-techniques-ebb2659c89a7?source=rss-18111f5a8d7a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebb2659c89a7</guid>
            <category><![CDATA[data-cleaning]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Abhishikta Dhar]]></dc:creator>
            <pubDate>Fri, 06 Oct 2023 12:42:27 GMT</pubDate>
            <atom:updated>2023-10-07T07:30:24.825Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Data is the foundation of any data-driven process, analysis, or decision-making. It is the starting point for deriving valuable insights and knowledge, which can then be used to solve problems, make informed decisions, and generate actionable outcomes. Data is the lifeblood of any data-driven endeavor. It fuels decision-making, insights, and innovation. However, raw data is often riddled with imperfections, inaccuracies, and inconsistencies that can impede analysis and lead to flawed conclusions. This is where data cleaning, an essential aspect of data science, comes into play.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_nSBm0OmuEipifPZV7EqCQ.jpeg" /></figure><p><em>In this blog, we will delve into the world of data cleaning techniques, exploring how they enhance the quality and reliability of data for meaningful analysis.</em></p><h3><strong>What is data?</strong></h3><p>Data refers to raw facts, figures, symbols, or any form of information that is collected, recorded, and stored for various purposes. In its raw form, data often lacks structure and context, and it needs to be processed and analyzed to derive meaningful information and insights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L14MpQ20noKOqyj7LN6mwQ.png" /><figcaption><em>Source: </em><a href="https://images.app.goo.gl/iryz4o8zchgZ6sTy6"><em>BIS</em></a></figcaption></figure><p>There are various types of data, which include:</p><p>· <strong>Structured data:</strong> data that is organized and follows a well-defined format, often in databases or spreadsheets. Each piece of information is stored in specific fields and can be easily queried and analyzed.</p><p>· <strong>Unstructured Data:</strong> Data that lacks a predetermined structure or format is referred to as unstructured data. Text, photos, audio, video, and other types of data that are more difficult to analyze without further processing are included in this.</p><p>· <strong>Semi-structured data:</strong> data that does not have a strict structure like structured data but has elements of structure, often with tags or hierarchies. Examples include XML, JSON, and HTML files.</p><h3><strong>Understanding Data Cleaning</strong></h3><p>Data cleaning, sometimes referred to as data cleansing or data scrubbing, is the process of locating and fixing errors or inaccuracies in data. These errors could be the result of a number of factors, including incorrect data entry, missing numbers, duplicates, outliers, and more. Data cleaning helps ensure that the information within the dataset is correct and precise. Inaccuracies can stem from human error, system glitches, or faulty measuring instruments. The ultimate goal of data cleaning is to make sure the data is accurate, full, consistent, and relevant. Data preprocessing is sometimes called data cleaning, but data preprocessing involves more steps than just cleaning the data. So, data cleaning is a subset of data preprocessing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*ZfzX5D7ST5EvjrFqGJVWug.jpeg" /><figcaption><em>Source: </em><a href="https://images.app.goo.gl/x9Nwap557uh8DELXA"><em>Analytics India Magazine</em></a></figcaption></figure><h3><strong>Importance of Data Cleaning</strong></h3><p>Clean data is fundamental for robust analysis and accurate modeling in data science. If data is not adequately cleaned and prepared before analysis, several significant problems can arise, impacting the reliability and accuracy of any subsequent analysis or decision-making processes. Data that hasn’t been cleaned appropriately can lead to questionable results. This can reduce the confidence that stakeholders have in the analysis and its implications, potentially causing delays in decision-making. Here are some reasons highlighting the importance of data cleaning:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/1*YGYc4SYjXe1b_BUsulfmpQ.png" /><figcaption>Importance of Data Cleaning</figcaption></figure><p>· <strong><em>Enhanced Data Quality:</em></strong></p><p><em>Clean data ensures that machine learning models and algorithms perform optimally, leading to better predictive accuracy. Data cleaning makes sure the data is accurate, dependable, and consistent. The overall quality of the dataset improves by locating and fixing errors and discrepancies.</em></p><p>· <strong><em>Improved Accuracy of Analysis:</em></strong></p><p><em>Uncleaned data often contains errors, inconsistencies, and inaccuracies, leading to incorrect or misleading insights. These inaccuracies can significantly skew analytical results and misguide decision-making. Clean, accurate data leads to more precise and trustworthy analysis. Reliable and accurate data generates trustworthy insights, forming a solid foundation for decision-making processes and drawing meaningful insights from the data.</em></p><p>· <strong><em>Effective Decision-Making:</em></strong></p><p><em>Analyzing and presenting unclean data can reduce the credibility of the analysis and the individuals or organizations responsible for it. Stakeholders may lose trust in the accuracy and reliability of the findings. Decision-making is supported by trustworthy data that is free of biases and inaccuracies. Managers and stakeholders can confidently rely on the results of analyses based on clean data.</em></p><p><em>· </em><strong><em>Avoidance of biased insights:</em></strong></p><p><em>Inaccuracies in data can introduce biases that skew analysis and conclusions. Data containing biases, such as imbalances, duplicate records, or incomplete entries, can result in biased conclusions that may favor a particular group or perspective. This can be detrimental in various domains, including business, healthcare, finance, and the social sciences. Data cleaning helps mitigate these biases and ensures that the insights drawn are representative and unbiased.</em></p><p><em>· </em><strong><em>Increased Productivity and Efficiency:</em></strong></p><p><em>Working with inaccurate data can be time- and resource-consuming. Analyzing raw, uncleaned data can slow down the analysis process and introduce complexities. If data-cleaning tasks are put off until later phases, they may take longer and be less productive. Data cleaning streamlines the analysis process by removing unnecessary obstacles, allowing analysts to focus on deriving insights rather than correcting errors.</em></p><p><em>· </em><strong><em>Better Data Integration:</em></strong></p><p><em>Data frequently comes from various sources. When data is not properly standardized and cleaned, integrating it with other datasets can become challenging. Merging inconsistent or incompatible data can result in further data quality issues and hinder the overall analysis. Data cleaning facilitates smooth integration by aligning data formats, resolving inconsistencies, and ensuring compatibility across various datasets.</em></p><p><em>· </em><strong><em>Compliance and Reporting:</em></strong></p><p><em>Incomplete or inconsistent data can misrepresent trends or patterns, causing a misinterpretation of the underlying phenomena. This misrepresentation can lead to erroneous assumptions and flawed strategies. In regulated industries or contexts where data compliance is critical, having clean and accurate data is essential for meeting regulatory requirements and producing accurate reports.</em></p><p><em>· </em><strong><em>Cost Savings:</em></strong></p><p><em>Data cleaning reduces unnecessary costs associated with erroneous data, such as marketing to incorrect addresses or targeting the wrong audience. Analyzing unclean data can lead to wasted resources and time spent on investigating false leads, correcting errors, and redoing analyses. In terms of both time and money, this can be expensive. Correcting errors early in the data lifecycle is typically more cost-effective than addressing issues later, especially after analysis or when errors have propagated throughout the organization.</em></p><p>Data cleaning plays a foundational role in data analysis, enabling reliable insights, informed decision-making, and overall better utilization of data for organizational success. Failing to clean data can jeopardize the integrity and reliability of analytical outcomes, hinder informed decision-making, waste resources, and negatively impact an organization’s credibility. Proper data cleaning is a critical step in the data analysis workflow to ensure accurate and trustworthy results.</p><h3><strong>Common Data Cleaning Techniques</strong></h3><p>It is impossible to exaggerate the significance of reliable, high-quality data in the age of big data and sophisticated analytics. Data, in its raw form, often contains imperfections, inaccuracies, and inconsistencies. These issues can adversely affect the results of any analysis or modeling efforts, ultimately leading to incorrect conclusions and flawed decision-making. Let’s look at several popular data cleaning methods that enable data scientists to turn unstructured data into useful assets:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/1*gczIBj2vX2ljhfHDwjH_Bg.png" /><figcaption>Data Cleaning Techniques</figcaption></figure><p><strong>1. Handling Missing Values</strong></p><p>Datasets frequently have missing values. Data scientists utilize various approaches to handle them, including imputation (filling missing values with statistical measures like mean, median, or mode), deletion of rows or columns with missing values, or using advanced algorithms to predict missing values based on the available data.</p><p>· Deletion of Rows or Columns: Remove rows or columns with missing values. This is suitable if the amount of missing data is very small and won’t significantly affect the analysis.</p><p>· Imputation: The mean (average), median (middle value), or mode (most frequent value) of the non-missing values in the column should be used to fill in any missing values.</p><p>· K-Nearest Neighbors (K-NN) Imputation: Fill in missing values using the values of the k-nearest neighbors in the feature space. Based on the average of the values from the nearest neighbors, the missing values are imputed.</p><p><strong>2. Outlier Detection and Treatment</strong></p><p>Data points that deviate significantly from other observations are known as outliers. Analysis and models can be distorted by outliers. Techniques like the Z-score method or the IQR (interquartile range) method help identify and handle outliers appropriately, ensuring they don’t skew the analysis. Managing outliers is crucial for robust analysis.</p><p>· Visual Inspection: Calculate summary statistics (e.g., mean, median, standard deviation, quartiles) to understand the central tendency and spread of the data. Unusually large or small values could indicate outliers. To visualize and spot outliers, use histograms, box plots, or scatter plots.</p><p>· Statistical Methods: Employ statistical techniques like Z-score or IQR (interquartile range) to detect and handle outliers, either by removal or transformation. Calculate the Z-score for each data point. Data points with a Z-score beyond a threshold (e.g., 3) are considered outliers. The difference between the first quartile (Q1) and the third quartile (Q3) is known as the IQR. Outliers fall outside the range defined by Q1–1.5 * IQR and Q3 + 1.5 * IQR.</p><p><strong>3. Data Transformation and Standardization</strong></p><p>Data transformation includes converting data into a format that is acceptable for analysis. This may include scaling features, encoding categorical variables, or creating new features that are more informative for the intended analysis. Standardizing data ensures uniformity and consistency, simplifying subsequent analysis.</p><p>· Scaling: Scale numerical features to a specific range (e.g., [0, 1] or [-1, 1]) to provide equal importance to all features.</p><p>· Normalization and standardization: Normalization scales the features between 0 and 1, while standardization transforms the data to have a mean of 0 and a standard deviation of 1, making it easier to compare and analyze.</p><p><strong>4. Removing Duplicates</strong></p><p>Duplicate data can lead to misleading analyses. Data deduplication techniques identify and remove duplicate records, ensuring that each data point is unique and contributes meaningfully to the analysis. Duplicate records can bias results and skew analyses. Here’s how to address duplicates:</p><p>· Identify Duplicate Rows: Compare each row in the dataset to determine if it is a duplicate of another row. Duplicates can be found by looking at particular columns or an entire row.</p><p>· Remove Duplicates: Keep only the first occurrence or a randomly selected instance while removing duplicate records.</p><p>· Check for Fuzzy Duplicates: Sometimes duplicates may not be exact but can be similar. Consider using techniques like fuzzy matching to identify and remove similar records.</p><p><strong>5. Text Data Cleaning</strong></p><p>For text-based data, techniques like removing stop words, stemming, lemmatization, and handling special characters are crucial to prepare the text for analysis, sentiment analysis, or natural language processing. Text data often requires specialized cleaning techniques.</p><p>· Tokenization: Break the text into smaller units, such as words or sentences. Tokenization aids in text organization for additional processing.</p><p>· Removing special characters: Eliminate special characters, symbols, and non-alphanumeric characters that don’t contribute to the meaning of the text.</p><p>· Removing Stop Words: Stop words are commonly occurring words in a language that do not carry significant meaning. Eliminate common and non-informative words (e.g., “and,” &quot;the,&quot; and “is”) that do not provide meaningful insights for analysis. Removing stop words helps reduce the dimensionality of the text data and focus on the more informative terms.</p><p>· Lemmatization and Stemming: Reduce words to their root or base form (stemming) or transform them to their dictionary form (lemmatization). This helps standardize variations of words.</p><p><strong>6. Handling Inconsistent Data</strong></p><p>Inconsistencies in data formatting or values can hinder analysis. To make sure the data is accurate, dependable, and appropriate for analysis or other uses, it is necessary to handle inconsistent data. Data input errors, differing information formats, divergent standards, or the integration of data from numerous sources are just a few causes of inconsistent data. Here are steps to handle inconsistent data:</p><p>· Identify Inconsistencies: Begin by thoroughly examining the dataset to identify inconsistencies, including discrepancies, errors, or anomalies in the data.</p><p>· Data Formatting: Standardize date formats, capitalization, and other conventions to maintain uniformity. Ensure that data follows consistent formats for dates, times, currency, units, and other relevant formats. Convert inconsistent data to the desired format.</p><p>· Data Validation Rules: Define and apply validation rules to ensure data adheres to predefined patterns or constraints. Implement validation rules to ensure that the data adheres to predefined criteria, such as a range of valid values or required fields.</p><p><strong>7. Feature Engineering and Selection</strong></p><p>In order to create powerful machine learning models, feature engineering and selection are essential tasks. To enhance model performance and efficiency, these steps entail generating new features from current data and choosing the most significant features. Effective feature engineering can improve the quality of data for analysis and modeling.</p><p>· Creating New Features: Generate new features based on existing ones, potentially enhancing the predictive power of the dataset. Transform existing features using mathematical operations (e.g., logarithm, square root) to make them more suitable for the model. Convert continuous variables into categorical bins to capture patterns that might be missed otherwise. Encode categorical variables into binary values (0s and 1s) to make them compatible with machine learning algorithms.</p><p>· Feature Selection: Choose the most relevant features to reduce noise and improve model performance. To determine the most influential features, compute correlations between the feature and the target variable. To rank features according to how relevant they are to the goal variable, use statistical tests or information gathering. Utilize methods like principal component analysis (PCA) or singular value decomposition (SVD) to decrease the feature space’s dimensionality while preserving the most crucial data.</p><p><strong>8. Addressing Class Imbalance (for Classification Tasks)</strong></p><p>Class imbalance in a classification task occurs when the number of instances in each class significantly differs, potentially leading to biased models that favor the majority class. Addressing this imbalance is crucial to creating models that can make accurate predictions for all classes. For datasets that are unbalanced, with one class greatly outnumbering another:</p><p>· Oversampling: Duplication or synthetic generation can be used to increase the proportion of occurrences in the minority class. To balance the distribution of classes, duplicate instances from the minority class at random. Create artificial data points by using methods such as SMOTE (Synthetic Minority Over-sampling Technique).</p><p>· Undersampling: To establish balance, lower the number of instances in the majority class. To restore balance to the class distribution, arbitrarily eliminate instances from the dominant class. Be cautious not to remove too much information, which can lead to underrepresentation of the majority class.</p><p>· Class Weighting: Assign higher weights to the minority class during model training to give it more importance. Many classification algorithms allow for class weights to be specified, which can help mitigate the impact of class imbalance.</p><p>· Ensemble Techniques: Use ensemble methods like bagging (e.g., Random Forest) or boosting (e.g., AdaBoost, XGBoost) that can handle class imbalance by combining predictions from multiple weak learners.</p><h3><strong>Conclusion</strong></h3><p><em>In order to ensure that the data utilized for analysis is correct, reliable, and consistent, data cleaning is a crucial step in the data preprocessing pipeline. By employing a combination of the aforementioned techniques and more, data scientists can transform messy, unrefined data into a valuable asset, enabling organizations to make informed decisions, gain competitive advantages, and drive innovation.</em></p><p><em>In the field of data science, having clean data is not only a good practice; it is completely essential. As we navigate the ever-evolving landscape of data science, let us always remember the significance of data cleaning and strive for the highest standards of data quality and accuracy. Keep in mind that the fundamental foundation of any data-driven venture is a clean dataset. Happy Data Cleaning!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebb2659c89a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring Image Processing through Python and Tkinter]]></title>
            <link>https://medium.com/@abhishiktadhar111/exploring-image-processing-through-python-and-tkinter-440b389e5e53?source=rss-18111f5a8d7a------2</link>
            <guid isPermaLink="false">https://medium.com/p/440b389e5e53</guid>
            <category><![CDATA[tkinter]]></category>
            <category><![CDATA[opencv]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[gui]]></category>
            <category><![CDATA[image-processing]]></category>
            <dc:creator><![CDATA[Abhishikta Dhar]]></dc:creator>
            <pubDate>Sun, 23 Jul 2023 19:18:01 GMT</pubDate>
            <atom:updated>2023-07-30T14:44:15.235Z</atom:updated>
            <content:encoded><![CDATA[<p><em>In today’s visually driven world, image processing has become essential for enhancing, segmenting, and adding special effects to photographs. To make image processing more accessible and user-friendly, we embarked on a journey to develop integrated software with a graphical user interface (GUI) using Python and Tkinter. This software utilizes the power of OpenCV for image processing, while Python GUI programming brings the functionalities to life. This blog will delve into the creation process and explore the key features and technologies that enable this powerful tool.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*glfpvSXqug1x9D8iuEpb7g.png" /><figcaption><em>Before and After Enhancement with OpenCV</em></figcaption></figure><p><em>Before we delve into the technical aspects, let’s discuss the significance of image processing. In various fields like medical imaging, photography, and computer vision, image processing plays a vital role. It enables us to improve image quality, extract important information, and perform various analyses that aid decision-making processes.</em></p><p><em>The inception of this project was fueled by the idea of combining the power of Python’s OpenCV library with a user-friendly GUI, allowing users to harness the potential of image processing. Python, with its simplicity and readability, was a natural choice for the project. Tkinter, the standard GUI toolkit for Python, offered seamless integration and cross-platform compatibility.</em></p><p><strong><em>OpenCV for Image Processing</em></strong></p><p><em>OpenCV (Open Source Computer Vision Library) is the backbone of our software. It is a versatile library with a vast array of functions and algorithms for image processing and computer vision tasks. From basic operations like loading and saving images to advanced functionalities like feature detection and object tracking, OpenCV provides us with a robust framework.</em></p><p><strong><em>Building the Python Tkinter GUI</em></strong></p><p><em>The heart of the software lies in its user-friendly GUI. Tkinter allows us to design an intuitive interface with buttons, sliders, and other interactive elements that cater to users of varying skill levels. Python’s event-driven programming model ensures seamless interaction between the GUI components and the underlying image processing functions.</em></p><p><strong><em>GUI functionalities</em></strong></p><p><em>Our integrated software boasts these main functionalities:</em></p><p><em>a. Grayscale, Negative, Channel Separation</em></p><p><em>b. Threshold, Edge Detection, Skeleton</em></p><p><em>c. Image enhancement like Sharpening, Denoising, Power Law Transformation, and Histogram Equalization</em></p><p><em>d. Background removal</em></p><p><em>e. Adding special effects like pencil sketches, watercolor effects, and emboss</em></p><p><em>So, let&#39;s get started.</em></p><p><strong><em>Importing necessary libraries:</em></strong></p><p><em>The code begins by importing the necessary libraries and modules required for image processing and GUI development.</em></p><pre>import PIL<br>from tkinter import *<br>from PIL import Image<br>from PIL import ImageTk<br>from PIL import ImageFilter<br>from tkinter import filedialog<br>import cv2<br>from skimage import filters<br>import skimage<br>import mahotas<br>import mahotas.demos<br>import numpy as np</pre><p><strong><em>Defining the Functions:</em></strong></p><p><em>Now let&#39;s define a series of functions that will perform different image processing tasks. Each function will display the processed image in a Tkinter GUI.</em></p><p><strong><em>Uploading image</em></strong></p><p><em>upload()is intended to handle image uploading and display the selected image in a Tkinter GUI.</em></p><pre>def upload():<br>    global panelA, panelB, image<br>    f_types = [(&#39;Jpg Files&#39;, &#39;*.jpg&#39;),(&#39;PNG Files&#39;,&#39;*.png&#39;)] <br>    path = filedialog.askopenfilename(filetypes=f_types)<br>    image = cv2.imread(path) <br>    image = cv2.resize(image, (500,500))<br><br>    image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)<br>    image1 = Image.fromarray(image)<br><br>    image1 = ImageTk.PhotoImage(image1)<br><br>    panelA = Label(image=image1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelA.image = image1<br>    panelA.grid(row= 1, column=1 , rowspan= 13, columnspan= 3, padx=20, pady=20)<br>    <br>    return image</pre><p><em>The function opens a file dialog using </em><em>filedialog.askopenfilename() , Tkinter allows the user to select an image file. The file dialog filters the allowed file types to JPEG (</em><em>*.jpg) and PNG (</em><em>*.png) files. After the user selects an image file, the function uses OpenCV (</em><em>cv2) to read the image from the selected path and store it in the </em><em>image variable. The image is in BGR (Blue-Green-Red) color space, which is the default color space used by OpenCV. However, for displaying the image using Tkinter, it needs to be in RGB (Red-Green-Blue) color space. So, the function converts the image from BGR to RGB using </em><em>cv2.cvtColor().The RGB image is then converted into a PIL </em><em>Image object (</em><em>image1) using </em><em>Image.fromarray(). The PIL </em><em>Image is converted into a Tkinter </em><em>PhotoImage object (</em><em>image1) using </em><em>ImageTk.PhotoImage(). This step is necessary to display the image in the Tkinter GUI. Finally, the function returns the uploaded and processed image as a NumPy array (</em><em>image).</em></p><p><strong><em>Converting to Grayscale Image</em></strong></p><p><em>grayscale()converts the input image (</em><em>image) from its original color space (BGR) to grayscale using the </em><em>cv2.cvtColor() function from OpenCV.</em></p><pre>def grayscale():<br>    grayimg= cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)<br>    grayimg1= Image.fromarray(grayimg)<br>    <br>    grayimg1= ImageTk.PhotoImage(grayimg1)<br>    <br>    panelB = Label(image=grayimg1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = grayimg1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>    <br>    return grayimg</pre><p><strong><em>Converting to a Negative Image</em></strong></p><p><em>negative(), inverts the colors of the input image (</em><em>image) by subtracting each pixel value from 255.</em></p><pre>def negative():<br>    neg= 255 - image<br>    neg1= Image.fromarray(neg)<br>    <br>    neg1= ImageTk.PhotoImage(neg1)<br>    <br>    panelB = Label(image=neg1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = neg1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>    <br>    return neg</pre><p><strong><em>Converting to a Binary Image</em></strong></p><p><em>threshold(), calls the </em><em>grayscale() function to convert the input image (</em><em>image) to grayscale. It then applies binary thresholding using </em><em>cv2.threshold() from OpenCV to convert the grayscale image into a binary image. Pixels with intensity values greater than the threshold (127) are set to 255 (white), and others are set to 0 (black).</em></p><pre>def threshold():<br>    image = grayscale()<br>    <br>    ret, thresh = cv2.threshold(image, 127, 255, cv2.THRESH_BINARY)<br>    thresh1= Image.fromarray(thresh)<br>    <br>    thresh1= ImageTk.PhotoImage(thresh1)<br>    <br>    panelB = Label(image=thresh1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = thresh1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>        <br>    return thresh</pre><p><strong><em>Red, Green and Blue Channel Extraction</em></strong></p><p><em>redext(), </em><em>greenext(), </em><em>blueext(), these functions extract the red, green, and blue channels of the input image (</em><em>image). Each function creates a new image with zeros for the channels other than the one being extracted, effectively isolating the selected color channel.</em></p><pre>def redext():<br>    row,col,plane = image.shape<br>                <br>    red = np.zeros((row,col,plane),np.uint8)<br>    red[:,:,0] = image[:,:,0]<br>    <br>    red1 = Image.fromarray(red)<br>    <br>    red1= ImageTk.PhotoImage(red1)<br>    <br>    panelB = Label(image=red1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = red1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>        <br>    return red<br><br>def greenext():<br>    row,col,plane = image.shape<br>        <br>    green= np.zeros((row,col,plane),np.uint8)<br>    green[:,:,1] = image[:,:,1]<br>    <br>    green1 = Image.fromarray(green)<br>    <br>    green1= ImageTk.PhotoImage(green1)<br>    <br>    panelB = Label(image=green1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = green1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>       <br>    return green<br><br>def blueext():<br>    row,col,plane = image.shape<br>        <br>    blue = np.zeros((row,col,plane),np.uint8)<br>    blue[:,:,2] = image[:,:,2]<br>    <br>    blue1 = Image.fromarray(blue)<br>    <br>    blue1= ImageTk.PhotoImage(blue1)<br>    <br>    panelB = Label(image=blue1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = blue1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>        <br>    return blue   </pre><p><strong><em>Edge Detection</em></strong></p><p><em>edge(), calls the</em><em>threshold() function to obtain a binary image then applies the Canny edge detection algorithm using </em><em>cv2.Canny() from OpenCV to find edges in the binary image.</em></p><pre>def edge():<br>    image = threshold()<br>    <br>    edged = cv2.Canny(image, 50, 100)<br>    edged1 = Image.fromarray(edged)<br>    <br>    edged1= ImageTk.PhotoImage(edged1)<br>    <br>    panelB = Label(image=edged1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = edged1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>    <br>    return edged</pre><p><strong><em>Skeletonization</em></strong></p><p><em>skeleton(), calls the</em><em>threshold() function to obtain a binary image, then performs skeletonization using the morphological operations provided by OpenCV and repeatedly erodes the binary image, and combines the result with the skeleton image until the binary image is empty.</em></p><pre>def skeleton():<br>    image = threshold()<br>    skel = np.zeros(image.shape, np.uint8)<br>    <br>    element = cv2.getStructuringElement(cv2.MORPH_CROSS, (3,3))<br>    <br>    while True:<br>        open = cv2.morphologyEx(image, cv2.MORPH_OPEN, element)<br>        temp = cv2.subtract(image, open)<br>        eroded = cv2.erode(image, element)<br>        skel = cv2.bitwise_or(skel,temp)<br>        image = eroded.copy()<br>        if cv2.countNonZero(image)==0:<br>            break<br>            <br>    skel1= Image.fromarray(skel)<br>    <br>    skel1= ImageTk.PhotoImage(skel1)<br>    <br>    panelB = Label(image=skel1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = skel1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br><br>    return skel</pre><p><strong><em>Denoising</em></strong></p><p><em>denoise(), this function applies a non-local means denoising filter to the uploaded image using </em><em>cv2.fastNlMeansDenoisingColored().</em></p><pre>def denoise():<br>    denoise = cv2.fastNlMeansDenoisingColored(image,None,5,5,7,21)<br>    denoise1 = Image.fromarray(denoise)<br>    <br>    denoise1= ImageTk.PhotoImage(denoise1)<br>    <br>    panelB = Label(image=denoise1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = denoise1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>    <br>    return denoise</pre><p><strong><em>Sharpening</em></strong></p><p><em>sharp(), this function applies a custom sharpening kernel to the uploaded image using </em><em>cv2.filter2D().</em></p><pre>def sharp():<br>    kernel = np.array([[0, -1, 0], [-1, 5,-1], [0, -1, 0]])<br>    sharpened = cv2.filter2D(image, ddepth=-1, kernel=kernel)<br>    <br>    sharpened1 = Image.fromarray(sharpened)<br>    <br>    sharpened1= ImageTk.PhotoImage(sharpened1)<br>    <br>    panelB = Label(image=sharpened1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = sharpened1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>    <br>    return sharpened</pre><p><strong><em>Histogram Equalization</em></strong></p><p><em>histo(), this function applies histogram equalization to the luminance channel (Y-channel) of the uploaded image in the YUV color space. The equalized image is then converted back to the BGR color space using </em><em>cv2.cvtColor().</em></p><pre>def histo():<br>    histogram = cv2.cvtColor(image, cv2.COLOR_BGR2YUV)<br>    histogram [:,:,0] = cv2.equalizeHist(histogram [:,:,0])<br>    histogram = cv2.cvtColor(histogram, cv2.COLOR_YUV2BGR)<br>    histogram1 = Image.fromarray(histogram)<br>    <br>    histogram1= ImageTk.PhotoImage(histogram1)<br>    <br>    panelB = Label(image=histogram1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = histogram1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>    <br>    return histogram</pre><p><strong><em>Power Law Transformation</em></strong></p><p><em>powerlawtrans(), this function applies a power-law transformation to the uploaded image to adjust the image contrast.</em></p><pre>def powerlawtrans():<br>    gammaplt = np.array(255*(image/255)**2.05,dtype=&#39;uint8&#39;)<br>    gammaplt1 = Image.fromarray(gammaplt)<br>    <br>    gammaplt1= ImageTk.PhotoImage(gammaplt1)<br>    <br>    panelB = Label(image=gammaplt1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = gammaplt1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>    <br>    return gammaplt</pre><p><strong><em>Masking/Background Removal</em></strong></p><p><em>maskimg(), this function allows the user to select a region of interest (ROI) in the uploaded image using the OpenCV function </em><em>cv2.selectROI(). A rectangular region is drawn around the selected ROI using </em><em>cv2.rectangle(). The function then applies the GrabCut algorithm to extract the foreground (inside the ROI) from the background.</em></p><pre>def maskimg():  <br>    x, y , w, h = cv2.selectROI(image)<br>    start = (x, y)<br>    end = (x + w, y + h)<br>    rect = (x, y , w, h)<br>    <br>    cv2.rectangle(image, start, end, (0,0,255), 3)<br>    mask = np.zeros(image.shape[:2], np.uint8)<br>        <br>    bgdModel = np.zeros((1, 65), np.float64)<br>    fgdModel = np.zeros((1, 65), np.float64)<br>        <br>    cv2.grabCut(image, mask, rect, bgdModel, fgdModel, 100, cv2.GC_INIT_WITH_RECT)<br>    cv2.waitKey(0)<br>    cv2.destroyAllWindows()<br>        <br>    mask1 = np.where((mask == 2) | (mask == 0), 0, 1).astype(&#39;uint8&#39;)<br>    maskimage = image * mask1[:, :, np.newaxis]<br>    <br>    maskimage1 = Image.fromarray(maskimage)<br>    <br>    maskimage1= ImageTk.PhotoImage(maskimage1)<br>    <br>    panelB = Label(image=maskimage1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = maskimage1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br><br>    return maskimage</pre><p><strong><em>Pencil Sketch Effect</em></strong></p><p><em>pencil(), this function converts the uploaded image to grayscale using the </em><em>grayscale() function. The grayscale image is inverted, and a smoothing effect is applied using Gaussian blur. The pencil sketch effect is obtained by dividing the inverted grayscale image by the smoothed image.</em></p><pre>def pencil():<br>    img=grayscale()<br>    img_invert = cv2.bitwise_not(img)<br>    img_smoothing = cv2.GaussianBlur(img_invert, (25, 25),sigmaX=0, sigmaY=0)<br>    <br>    pencilimg = cv2.divide(img, 255 - img_smoothing, scale=255)<br>    pencilimg1= Image.fromarray(pencilimg)<br>    <br>    pencilimg1= ImageTk.PhotoImage(pencilimg1)<br>    <br>    panelB = Label(image=pencilimg1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = pencilimg1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>    <br>    return pencilimg</pre><p><strong><em>Color Pencil Sketch Effect</em></strong></p><p><em>colpencil(), this function applies a color pencil sketch effect to the uploaded image. The image is inverted, and a smoothing effect is applied using Gaussian blur. The color pencil sketch effect is obtained by dividing the inverted image by the smoothed image.</em></p><pre>def colpencil():<br>    img_invert = cv2.bitwise_not(image)<br>    img_smoothing = cv2.GaussianBlur(img_invert, (21, 21),sigmaX=0, sigmaY=0)<br>    <br>    colpencilimg = cv2.divide(image, 255- img_smoothing, scale=255)<br>    colpencilimg1= Image.fromarray(colpencilimg)<br>    <br>    colpencilimg1= ImageTk.PhotoImage(colpencilimg1)<br>    <br>    panelB = Label(image=colpencilimg1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = colpencilimg1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>    <br>    return colpencilimg</pre><p><strong><em>Cartoonify</em></strong></p><p><em>cartoon(), this function converts the uploaded image to grayscale using the </em><em>grayscale() function. The grayscale image is further processed to obtain edges using adaptive thresholding. The color information is retained using bilateral filtering. The cartoon effect is obtained by applying a bitwise AND operation between the color image and the edges image.</em></p><pre>def cartoon():<br>    gray=grayscale()<br>    gray = cv2.medianBlur(gray, 5)<br>    edges = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 9, 9)<br>    <br>    color = cv2.bilateralFilter(image, 9, 250, 250)<br>    cartoon = cv2.bitwise_and(color, color, mask=edges)<br><br>    cartoon1= Image.fromarray(cartoon)<br>    <br>    cartoon1= ImageTk.PhotoImage(cartoon1)<br>    <br>    panelB = Label(image=cartoon1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = cartoon1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>    <br>    return cartoon</pre><p><strong><em>Watercolor Effect</em></strong></p><p><em>watercolor(), this function applies a watercolor painting effect to the uploaded image using the </em><em>cv2.stylization() function.</em></p><pre>def watercolor():<br>    watercolor = cv2.stylization(image, sigma_s=100, sigma_r=0.45)<br>    <br>    watercolor1= Image.fromarray(watercolor)<br>    <br>    watercolor1= ImageTk.PhotoImage(watercolor1)<br>    <br>    panelB = Label(image=watercolor1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = watercolor1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>    <br>    return watercolor</pre><p><strong><em>Emboss Effect</em></strong></p><p><em>emboss(), this function applies an embossing effect to the uploaded image using a custom kernel. The embossed image is converted to grayscale and inverted.</em></p><pre>def emboss():<br>    kernel = np.array([[0,-1,-1],[1,0,-1],[1,1,0]])<br>    emboss = cv2.filter2D(image, kernel=kernel, ddepth=-1)<br>    emboss= cv2.cvtColor(emboss, cv2.COLOR_BGR2GRAY)<br>    emboss=255-emboss<br>    emboss1= Image.fromarray(emboss)<br>    <br>    emboss1= ImageTk.PhotoImage(emboss1)<br>    <br>    panelB = Label(image=emboss1, borderwidth=5, relief=&quot;sunken&quot;)<br>    panelB.image = emboss1<br>    panelB.grid(row= 1, column=4 , rowspan= 13,columnspan= 3, padx=20, pady=20)<br>    <br>    return emboss</pre><p><strong><em>Tkinter GUI application for image processing</em></strong></p><p><em>The GUI consists of various buttons, each associated with a specific image processing function. When a button is clicked, the corresponding image processing operation is performed on the uploaded image, and the result is displayed in the window.</em></p><pre>root = Tk()<br>root.title(&quot;IMAGE PROCESSING&quot;)<br><br>l1= Label(root, text=&quot;CLICK THE BUTTONS TO PERFORM THE FUNCTIONALITIES MENTIONED&quot;,<br>           fg=&quot;white&quot;, bg=&quot;purple&quot;, width= 98, borderwidth=5, relief=&quot;groove&quot;,  font =(&#39;Verdana&#39;, 15))<br>l1.grid(row= 0, column= 1, columnspan= 6, padx=20, pady=20, sticky=&#39;nesw&#39;)<br><br>btn= Button(root, text=&quot;UPLOAD&quot;, fg=&quot;black&quot;, bg=&quot;lavender&quot;, command=upload)<br>btn.grid(row= 1, column= 0, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn1= Button(root, text=&quot;GRAYSCALE&quot;, fg=&quot;white&quot;, bg=&quot;snow4&quot;, command=grayscale)<br>btn1.grid(row= 2, column= 0, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn2= Button(root, text=&quot;INVERT COLOR&quot;, fg=&quot;white&quot;, bg=&quot;black&quot;, command=negative)<br>btn2.grid(row= 3, column= 0, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn3= Button(root, text=&quot;RED ATTRIBUTES&quot;, fg=&quot;white&quot;, bg=&quot;red&quot;, command=redext)<br>btn3.grid(row= 4, column= 0, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn4= Button(root, text=&quot;GREEN ATTRIBUTES&quot;, fg=&quot;white&quot;, bg=&quot;green&quot;, command=greenext)<br>btn4.grid(row= 5, column= 0, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn5= Button(root, text=&quot;BLUE ATTRIBUTES&quot;, fg=&quot;white&quot;, bg=&quot;blue&quot;, command=blueext)<br>btn5.grid(row= 6, column= 0, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn6= Button(root, text=&quot;BINARY&quot;, fg=&quot;white&quot;, bg=&quot;black&quot;, command=threshold)<br>btn6.grid(row= 7, column= 0, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn7= Button(root, text=&quot;EDGE DETECTION&quot;, fg=&quot;white&quot;, bg=&quot;black&quot;, command=edge)<br>btn7.grid(row= 8, column= 0, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn8= Button(root, text=&quot;SKELETON&quot;, fg=&quot;white&quot;, bg=&quot;black&quot;, command=skeleton)<br>btn8.grid(row= 9, column= 0, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn9= Button(root, text=&quot;POWER LAW TRANSFORMATION&quot;, fg=&quot;white&quot;, bg=&quot;purple&quot;, command=powerlawtrans)<br>btn9.grid(row= 10, column= 0, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn10= Button(root, text=&quot;CONTRAST ENHANCEMENT&quot;, fg=&quot;white&quot;, bg=&quot;purple&quot;, command=histo)<br>btn10.grid(row= 11, column= 0, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn11= Button(root, text=&quot;SHARPENING&quot;, fg=&quot;white&quot;, bg=&quot;purple&quot;, command=sharp)<br>btn11.grid(row= 12, column= 0, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn12= Button(root, text=&quot;SMOOTHENING&quot;, fg=&quot;white&quot;, bg=&quot;purple&quot;, command=denoise)<br>btn12.grid(row= 13, column= 0, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn13= Button(root, text=&quot;REMOVE BACKGROUND&quot;, fg=&quot;white&quot;, bg=&quot;purple&quot;, command=maskimg)<br>btn13.grid(row= 14, column= 0, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn14= Button(root, text=&quot;PENCIL SKETCH&quot;, fg=&quot;white&quot;, bg=&quot;purple&quot;, command=pencil)<br>btn14.grid(row= 15, column= 1, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn15= Button(root, text=&quot;COLOR PENCIL SKETCH&quot;, fg=&quot;white&quot;, bg=&quot;purple&quot;, command=colpencil)<br>btn15.grid(row= 15, column= 2, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn16= Button(root, text=&quot;CARTOONIFY&quot;, fg=&quot;white&quot;, bg=&quot;purple&quot;, command=cartoon)<br>btn16.grid(row= 15, column= 3, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn17= Button(root, text=&quot;WATERCOLOR&quot;, fg=&quot;white&quot;, bg=&quot;purple&quot;, command=watercolor)<br>btn17.grid(row= 15, column= 4, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn18= Button(root, text=&quot;EMBOSS&quot;, fg=&quot;white&quot;, bg=&quot;purple&quot;, command=emboss)<br>btn18.grid(row= 15, column= 5, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>btn19= Button(root, text=&quot;EMBOSS image&quot;, fg=&quot;white&quot;, bg=&quot;purple&quot;, command=emboss)<br>btn19.grid(row= 15, column= 6, padx=10, pady=10, sticky=&#39;nesw&#39;)<br><br>root.mainloop()</pre><p><em>Let’s summarize the functionality of each button:</em></p><ul><li><em>UPLOAD: Allows the user to upload an image file (JPG or PNG format) using the file dialog.</em></li><li><em>GRAYSCALE: Converts the uploaded image to grayscale.</em></li><li><em>INVERT COLOR: Inverts the colors of the uploaded image (negative effect).</em></li><li><em>RED ATTRIBUTES: Extracts the red color channel of the uploaded image.</em></li><li><em>GREEN ATTRIBUTES: Extracts the green color channel of the uploaded image.</em></li><li><em>BLUE ATTRIBUTES: Extracts the blue color channel of the uploaded image.</em></li><li><em>BINARY: Converts the uploaded image to a binary (black and white) image using a thresholding operation.</em></li><li><em>EDGE DETECTION: Detects edges in the uploaded image using the Canny edge detection algorithm.</em></li><li><em>SKELETON: Performs skeletonization on the binary image obtained in the previous step.</em></li><li><em>POWER LAW TRANSFORMATION: Applies a power-law transformation to adjust the contrast of the uploaded image.</em></li><li><em>CONTRAST ENHANCEMENT: Enhances the contrast of the uploaded image using histogram equalization.</em></li><li><em>SHARPENING: Sharpens the uploaded image using a custom sharpening kernel.</em></li><li><em>SMOOTHENING: Applies denoising to the colored image to reduce noise.</em></li><li><em>REMOVE BACKGROUND: Allows the user to manually select a region of interest (ROI) and removes the background using the GrabCut algorithm.</em></li><li><em>PENCIL SKETCH: Creates a pencil sketch effect from the grayscale version of the uploaded image.</em></li><li><em>COLOR PENCIL SKETCH: Creates a color pencil sketch effect from the uploaded image.</em></li><li><em>CARTOONIFY: Converts the uploaded image into a cartoon-like version.</em></li><li><em>WATERCOLOR: Applies a watercolor painting effect to the uploaded image.</em></li><li><em>EMBOSS: Applies an embossing effect to the uploaded image using a custom kernel.</em></li></ul><p><em>After applying any of the effects, the processed image will be displayed in the application.</em></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FPiw4xuQOLQjGYisuQX%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExcnZiNXZhanlteWtlczNpbTN0bDQxOWd4NmtzMjM1aDk0b3NjaTFwMyZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw%2FPiw4xuQOLQjGYisuQX%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FPiw4xuQOLQjGYisuQX%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="232" frameborder="0" scrolling="no"><a href="https://medium.com/media/0375516456e80e294cd0d952085eb8bd/href">https://medium.com/media/0375516456e80e294cd0d952085eb8bd/href</a></iframe><p><strong><em>Conclusion</em></strong></p><p><em>Exploring the realm of image processing through Python and Tkinter has been an exhilarating experience. Witnessing the power of Python’s simplicity combined with the robustness of OpenCV and the user-friendly Tkinter GUI has opened up a world of possibilities for both image processing enthusiasts and professionals. With this integrated software, anyone can now effortlessly enhance, segment, and add artistic effects to their images, bringing out the true potential of their visual creations.</em></p><p>For the complete code, you can refer to the GitHub repository:<strong> </strong><a href="https://github.com/mistiiberry-exe/imageprocessing_using_python_and_tk"><strong><em>Image Processing using Python and Tkinter.</em></strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=440b389e5e53" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>