fabiochiu/medium-articles huggingface dataset:
Human and Cat Face Detection using OpenCV
By: Faiza Anan Noor
Tags: Detection, Image Processing, Computer Vision, Opencv, Python

One of the main ways an object can be detected in OpenCV is the by making use of something called a “Cascade Classifier”. A Cascade classifier can be defined in the following way:

“It is a machine learning based approach where a cascade function is trained from a lot of positive and negative images. It is then used to detect objects in other images.”

By positive images, we mean the objects we want to detect.

By negative images, we mean all the objects we want to avoid.

In our examples, we will work with faces as our objects. So primarily, we will be needing a lot of positive images (Images containing faces) and negative images (Images without faces) to train the classifier.

OpenCV comes with its trainer and detector and if we want we can train classifiers by ourselves . But in our examples we will be using the trained classifiers which exist in the form of XML files available at OpenCV’s github page.

So let’s start identifying faces.

Human face Detection:

Let us consider this image and try to identify all the faces.

Step 1:

Let’s import necessary libraries, read the image and then plot it

Image Reading and Plotting

If you’re unfamiliar with the steps of reading an image, check out this blog of mine.

Step 2:

OpenCv has a function called “CascadeClassifier” in which we are going to pass in the file path of our trainer classifier and then the result of executing this function is stored in a variable called “faceCascade”.

Syntax:

cv.CascadeClassifier(path)

Parameters:

Trained Classifier XML file path

Now to finally detect faces, we are going to use the method called “detectMultiScale” and then store the result in a variable called “detectedFaces” and then print out this variable.

Syntax:

obj=cv.CascadeClassifier.detectMultiScale(image,scaleFactor,minNeighbour)

Parameters:

Image: The image we want to use

Scale Factor: Parameter specifying how much the image size is reduced at each image scale.

MinNeighbour: Specifies how many neighbours a candidate rectangle should have.

Result

The result of execution is actually a matrix containing the length, breadth, width, height of the rectangles denoting our faces in the image provided. Take a close look at the matrix in the figure above.

Step 3:
K-Means and Image Processing
Tags: Image Processing, Machine Learning

Suppose we take a photo of our notes on a white paper. Due to the lighting conditions, the white paper may appear grey in the image. Our objective is to remove the background color (which is grey in our case).

It turns out that we can simply apply the K-means algorithms to the image directly. Most of the pixels in the image are close to the white color and our writings only occupy a small fraction of the image. Therefore, we have two different types of pixels in the image and we only need a classification algorithm to add labels to the pixels. If a pixel belongs to “paper”, then we will set the pixel to white.

Implementation

The source code can be found here: http://compassinbabel.org/post/1c8e81b9-5e56-4c5c-9064-e2e9cd249b9e

Output
Finding out the values of a Gaussian Kernel in Image Processing
By: Nishat Anjum Lea
Tags: Filters, Image Processing, Gaussian

Suppose , we are given a size of a kernel like 5x5 and and the value of σ = 1 . We have to find out all the values for this kernel .

We know the equation of Gaussian function is :

For a filter (kernel is also known as filter) size uxv, the number of rows are u and the number of columns are v . Generally, The filter size consists of odd numbers . In this case ,the values for rows are -{(u-1)/2} to +{(u-1)/2} and the values of columns are -{(v-1)/2} to +{(v-1)/2} . So, for filter size 5x5 , the row values are -2 to +2 and column values are -2 to +2. So, if we want to calculate the 1st value of the kernel , we have to put the row value and column value of the kernel for that position in the Gaussian Function. Here , it is (-2,-2) . So, u=-2 , v=-2 . By putting the value of u , v in the equation we can find the value h(u,v) = 0.0029 which is approximately 0.003 . Following the same procedure , we can find the values of other positions . The entire table is shown below:

5x5 Gaussian kernel

Now , we can see that all the values are very small . If we normalize all the values by dividing all the values by 0.003 , we will get the following table :

5x5 Gaussian Kernel after Normalization

Note: σ is the parameter of the function . The Filter values will be changed if we change the value of σ
Face Recognition with Python, in Under 25 Lines of Code
By: Vaibhav Hariramani
Tags: Facedetection, Opencv Python, Image Processing, Face Recognition

OpenCV

OpenCV is the most popular library for computer vision. Originally written in C/C++, it now provides bindings for Python.

OpenCV uses machine learning algorithms to search for faces within a picture. Because faces are so complicated, there isn’t one simple test that will tell you if it found a face or not. Instead, there are thousands of small patterns and features that must be matched. The algorithms break the task of identifying the face into thousands of smaller, bite-sized tasks, each of which is easy to solve. These tasks are also called classifiers.

For something like a face, you might have 6,000 or more classifiers, all of which must match for a face to be detected (within error limits, of course). But therein lies the problem: for face detection, the algorithm starts at the top left of a picture and moves down across small blocks of data, looking at each block, constantly asking, “Is this a face? … Is this a face? … Is this a face?” Since there are 6,000 or more tests per block, you might have millions of calculations to do, which will grind your computer to a halt.

To get around this, OpenCV uses cascades. What’s a cascade? The best answer can be found in the dictionary: “a waterfall or series of waterfalls.”

Like a series of waterfalls, the OpenCV cascade breaks the problem of detecting faces into multiple stages. For each block, it does a very rough and quick test. If that passes, it does a slightly more detailed test, and so on. The algorithm may have 30 to 50 of these stages or cascades, and it will only detect a face if all stages pass.

The advantage is that the majority of the picture will return a negative during the first few stages, which means the algorithm won’t waste time testing all 6,000 features on it. Instead of taking hours, face detection can now be done in real time.

Cascades in Practice

Though the theory may sound complicated, in practice it is quite easy. The cascades themselves are just a bunch of XML files that contain OpenCV data used to detect objects. You initialize your code with the cascade you want, and then it does the work for you.

Since face detection is such a common case, OpenCV comes with a number of built-in cascades for detecting everything from faces to eyes to hands to legs. There are even cascades for non-human things. For example, if you run a banana shop and want to track people stealing bananas, this guy has built one for that!
Removing Noise from Images using a CNN model in Pytorch — Part 1
By: Ayoola Olaleye
Tags: Image Processing, Computer Vision, Artificial Intelligence, Neural Networks, Noise Removal

Sometimes when we take photos, they contain some fuzziness, actually some sort of noise. This noise get induced into our photos either while taking them or during transmission. That’s why, in this post, we will be using a CNN model to remove noise (gaussian) from images while keeping it features intact.

That sounds cool, right? Let’s get started.

A noisy image of myself

I believe if you’re reading this, you already have an idea of neural networks, CNN and some basic understanding of Pytorch deep learning framework.

In order to remove noise from images, we’ll be following a paper, Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising by Kai Zhang et al. I’ll suggest you take a quick look at the paper before you continue.
Top 5 Open-Source Image Super-Resolution Projects To Boost Your Image Processing Tasks
By: Mrinal Walia
Tags: Computer Science, Image Processing, Image Super Resolution, AI, Open Source

Super-resolution imaging is a class of techniques that enhance the resolution of an imaging system. In optical SR the diffraction limit of systems is transcended, while in geometrical SR the resolution of digital imaging sensors is enhanced. Wikipedia

In today’s article, we are going to talk about the Top 5 Open-Source Image Super-Resolution Projects, which you can include in your next Image Processing project.

Note: In this article, we are going to talk about some of the not-so-famous but really good Super Resolution projects which you can use in your projects. To read more about each of them I recommend following the link given along the project.
Image Editing to Improve Technical Illustration
Tags: Writing, Image Processing, Image, Blog, Technical Writing

Highlight Keypoint

Sometimes we want to highlight keypoint in our image. The result is below, where the number 129,758 is highlighted for easier identification.

In GIMP, we first need to select the area we like to highlight using the select tool.

Then using the color brush and select Luman/Luminance Darken only brush.

After that, you can then highlight your text as below.

Pixelize Text

Sometimes we want to hide away some irrelevant information or confidential information. We can use the Pixelate feature as shown below.

Similarly, to do so, first, we select the part we want to Pixelate using the Select Tool. Then in Filters →Blur → Pixelize

That’s it. Simple as that.

Change Background

Sometimes we want to improve the background to emphasize the portion of the image we want the reader to notice. We can add a vibrant background to the image.
Converting an image to line art
By: Rutuparn Pawar
Tags: Fun, Lineart, Image Processing, Opencv, Python

In this blog, we are going to see how an image can be converted to line art. If you observe the image shown below carefully you will quickly deduce that this is fundamentally a problem of edge detection.

A drawing of a fish converted to line art

We use the Canny edge detector of detecting the edges in the images. The heavy lifting for edge detection is done by the Sobel filter present in the Canny edge detector.

The canny edge detector’s generally output edges that have more than 1 pixels which make it look less like line art, hence we use a Guo-Hall thinning to reduce the numbers of pixels that represent the edges.

Running example: Cat

We are going to see how an image of a cute cat gets converted to line art depicting the cat.

Cute cat

Steps

Convert the image to grayscale. All coloured images have 3 bytes per pixel to represent the RGB values. In all the channels, the pixels that represent the edges show the same drastic change, hence we can average them out to get a grayscale image.

2. Apply Gaussian filter, median filter & bilateral filter in order to deal with noise in the image. Wowaaz that's a lot of filters.

Grayscale image after passing through all the filters

3. Use the canny edge detector to detect the edges. An edge in an image is nothing more than a rapid change in pixel values that can be identified using the Sobel operator.

4. Use Guo-Hall thinning for skeletonizing the image

The effect of thinning can be observed in the image below

Removed pixels marked in red

Optional step: Invert the pixels in the image.

After all the above image processing we get the lines of the line art. Hurray!

If you are into python, try out the line art creator using the following link:

https://github.com/InputBlackBoxOutput/Line_Art_Creator

Bonus

The generated line art can be further converted to ASCII text art using an ANN. Follow the link below to use the ANN

https://tar-bin.github.io/DeepAAonWeb/

I hope you enjoyed reading this article. Have a nice day!
A’dan Z’ye SSD (Single Shot Multibox Detector) Modeli
By: Buse Yaren Tekin
Tags: Image Processing, Nesne Tespiti, Ssd, Object Dete, Görüntü İşleme

AI Specialist at SimurgAI, Software Engineer ML Intern at Towards AI
Image Collection and Editing Services
By: Vellayan Lakshmanan
Tags: Image Collection, Image Processing, Image Editing Services

Image Collection and Editing Services. We showcase your products in creative ways that evoke emotion and promote brand awareness, letting consumers see, feel, and try products and inspiring them to make a purchase.
How to optimize images for SEO | Krohn Media
By: Steven Krohn, Krohn Media
Tags: Image Processing, SEO, Website, Image, Google Analytics

Image Optimization

There are many ways to make your articles easier to read on the web — lots of paragraph breaks, short snappy sentences, headings, sub-headings, Gifs of Kanye West’s mood swings — but one of the key ways to make your content seem attractive is with the use of images.

And the best thing about images, is that they can be used to bring in organic traffic via search engine image results.

But in order for this to happen, they need to be optimized accordingly.

Choosing images

It’s important to use images related to the text of the article. This is mainly from a user experience point of you, as you don’t want to baffle people with an obtuse choice of image.

Your images need to be of a good quality, in the correct aspect ration, with good resolution and of a size large enough to be visible across devices.

Another thing to consider is your use of ‘stock-photos’.

We introduced a strict ‘no stock photos allowed’ policy.

They make your website look like a marketing brochure for a characterless business that ‘leverages thought-leadership into hot leads’ or some such rubbish. They’re also over-used and cheesy as hell

You should also be creating your own graphs, charts and visual designs too.

But if you don’t have the time or resources to do that — and frankly who does? — there are plenty of free and easy-to-use resources out there…

Flickr Creative Commons

Flickr is an awesome resource for photos, and you can use any that are labelled with a Creative Commons license.

It’s an alternative to full copyright, you just have to make sure you give full credit and link to the Flickr profile of the person who took the photo.

Unsplash

One of my favorites, Unsplash images are all copyright free, you just need to credit and link to the photographer. Occasionally they border on ‘stock photo’ but they are all of a much higher quality than your standard ‘model looking at iPhone and smiling’ images.

Image size

You’ll definitely want to resize your photo so it’s not such a massive file. It’s very easy to overlook the fact that most iPhone photos can be in excess of 3,000 pixels wide (which can be 2,500 pixels bigger than you really need).

Huge image files can drag the page-load time of your site down and directly affect your rankings on search engines, so be sure to resize them before you upload.

File/Title name

Before you upload the image to your site, make sure you give it an accurate file name.

Alt-text

Most important of all is how you describe your image in the Alt section (can be known as Alt-tags or Alt-text). Google can’t ‘see’ your images, but it can ‘read’ them and what it reads is what you write in the alt-attribute.

Need help with your photo optimization?

Call Krohn Media at 888–443–2112

Source: How to optimize images for SEO
Will You Think For Yourself?
By: Rachel Lee White
Tags: Confidence, Image Processing, You

Will You Think For Yourself?

Photo by Sai De Silva on Unsplash

Human beings are works in progress that mistakenly think they’re finished. (Quotes Daniel Gilbert)

Never give up on your Future Self. Keep hope alive by keeping your imagination and confidence soaring vertically so that your faith will manifest your chosen results.

Happiness & Vibrancy with Rachel

www.rachelleewhite.com
Image retrieval systems
By: Rutuparn Pawar
Tags: Image Processing, Gan, Cnn, AI, Image Retrieval

What is an Image retrieval system?

An image retrieval system is used to search for images similar to the query image in a large image database. It helps in the processing, organizing, and handling of image data efficiently.

Companies like Google and Pinterest use image retrieval systems to provide users with related images.

Google Images: Search by image feature

Some interesting statistics

A study reveals that the number of cameras in the world exceeds the number of eyes. Reports suggest there will be approximately 7.4 trillion images generated by the end of 2020.

History of image retrieval systems

In the year 1970, a text-based image retrieval technique was implemented where images were first annotated manually and then searched using a text query. This method was extremely time-consuming, labour-intensive and

prone to errors in annotation due to the subjectivity of human perception.

Manually annotated images from the CIFAR-10 image dataset

Some years later in the early 1980s, a Content-based Image Retrieval (CBIR) system was introduced which used visual features extracted from an image. This method used traditional image processing tools for understanding the colour, texture, and shape-based features of the image. This approach had problems like inappropriate and limited feature representations which resulted in less efficient and non-generalized algorithms.

Face detection using the Viola-Jones algorithm which used handcrafted features

Image retrieval systems today

Today we use Convolutional Neural Networks (CNN) to perform image retrieval tasks. CNN is a variant of deep learning and is widely used for computer vision applications because of its inherent ability to extract features from an image. CNN has also shown prominent results as compared to traditional image processing techniques.

A CNN followed by SVM. Courtesy: Springer

In a CNN, convolutional layers are used for feature representation and extraction. After the features are extracted, distance metrics are used for measuring the similarity between the query image and the images from the database. Generally, similarity metrics like Euclid distance, Cosine distance and Manhattan distance facilitate finding similar images from the database.

Recently GANs have provided a way to improve the ways we can provide an input to an image retrieval system. For instance, a freehand sketch.

Contextual GAN in action

Hurray! You now know about image retrieval systems

I hope you enjoyed the article. Have a nice day!
What counts as intensity manipulation
By: Akula Hemanth Kumar
Tags: Image Processing, Data Science, Computer Vision

You can find the complete jupyter notebook here.

If you have any questions, you can reach Abhishek . Feel free to reach out to him.

I am extremely passionate about computer vision and deep learning. I am an open-source contributor to Monk Libraries.

You can also see my other writings at:
Color Theory in Computer Vision
By: Akula Hemanth Kumar
Tags: Image Processing, Computer Vision

You can find the complete jupyter notebook here.

If you have any questions, you can reach Abhishek. Feel free to reach out to him.

I am extremely passionate about computer vision and deep learning. I am an open-source contributor to Monk Libraries.

You can also see my other writings at:
OpenCV ile Derin Öğrenme — Temel Bilgiler
By: Umut Boz
Tags: Image Processing, Computer Vision, Opencv, Deep Learning, Python

Why does OpenCV use BGR color format ?

One of the elements of good design is the principle of least astonishment ( a.k.a principle of least surprise). A good…
How To Create GIF Images In Python
By: George Pipis
Tags: Python Programming, Image Processing, GIF, Imageio, Python

How To Create GIF Images In Python

GIF by Giphy

We will show how you can create GIF images in Python from a set of images. We will work with the imageio library and where we can install it as follows:

If you are in a conda env: conda install -c conda-forge imageio

If you have pip: pip install imageio

For this example, I used three images of Zach LaVine from a Slam Dunk contest.

The three images:

Let’s start!

import imageio import os files = os.listdir('my_images') # assume that your images that you # want to make the GIF are under the my_images folder images_path = [os.path.join('my_images',file) for file in files] # fps are the frames per second images = [] for img in images_path: images.append(imageio.imread(img)) imageio.mimsave('output/mygif.gif', images, fps=2)

et voilà!

Here is the GIF:
Fluff Lichtenfurr — How to Create Modern Art in Python
By: Gal Gilor
Tags: Image Processing, Python, Scikit Image

Even though both of them are incredibly photogenic, I suggested to make this project more interesting and to apply the images with different filters. Also, the photos we picked were taken by an older phone camera, and enlarging the photos too much would make them look pixelated.

At first, I thought which tools would be best suited for this task. I decided I want this task to be simple and that, at the moment, I did not need to use the robust image processing APIs OpenCV and Pillow in this project. For this project, I used scikit-images (skymage) with different Matplotlib colormaps.

If you include the reverse colormaps, Matplotlib has over 130 colormaps to choose from. I limited my options by only testing the Perceptually Uniform Sequential and Sequential colormaps. I created a function that accepts the images I want to hang on the wall, the figure size, and a colormap to test.

I ran this function with my dogs' photos and tested every one of the 32 different colormaps. Do note; I chose to display the images as they get created. To reduce runtime, or if you lack internal memory to hold many figures at once, there are workarounds. Out of those 32, I managed to narrow the options to 3 colormaps that my wife and I agreed looked best.
How to get the most out of your OCR Engine: Accuracy Matters
Tags: Image Processing, Document Understanding, Document Automation, Ocr, Data Extraction

A major problem many businesses face today is the inability to leverage data trapped inside scanned documents and images. Whenever a business relies on such data, manually re-keying the data becomes the biggest bottleneck and adversely affects the business.

In such scenarios, we need data-entry automation that helps extract information from scanned documents and automate document-based business processes.

But the problem is two-fold. The challenge is not just to extract information from scanned documents but also to extract it accurately. This becomes even more challenging when the data inside these scanned documents and images is tabular and graphical in nature and needs to be structured correctly.

Quick Overview of the Extraction Process

A. OCR — To accurately extract data from scanned documents, Optical Character Recognition (OCR) is needed. A combination of pattern recognition and image processing techniques are used to convert batches of scanned files to excel sheets or any other document format.

B. Information extraction (IE) — Information Extraction is the process of extracting domain-specific information from textual data sources. Bank Statements, Legal Acts, Corporate Reports, Medical Records Government Documents are other free flowing textual sources from which information extraction can provide structured information.

Gathering structured data from texts, Information Extraction enables
ImageQuilts
By: Zen Michael
Tags: Creativity, Image Processing, Image, Colors, Web Tools

Creative Tools

Subatomic Particles, image by ImageQuilts

ImageQuilts is a Chrome extension and a very special data visualization tool that allows you to build matrices of large sets of images.

Paul Klee Palette, image by ImageQuilts

An interesting tool that can be used to get or build a “group image” about a popular subject or trend. The tool was made by Edward Tufte and Adam Schwartz and is available at ImageQuilts.com.
Google Releases ‘Objectron Dataset’ of Object-Centric Video Clips…
By: Gayan Samuditha
Tags: Augmented Reality, Image Processing, Object Detection, Deep Learning, Augmented Intelligence

— Google Releases ‘Objectron Dataset’ of Object-Centric Video Clips to Advance 3D Object Understanding ……

What Google Releases?

Google AI yesterday released its Objection dataset — a collection of short, object-centric video clips capturing a large set of common objects from different angles.

Sample results of 3D object detection solution running on mobile

Google AI yesterday released its Objectron dataset — a collection of short, object-centric video clips capturing a large set of common objects from different angles. Each video clip is accompanied by AR session metadata that includes both camera poses and sparse point-clouds.

*******

The Google researchers hope the dataset’s release will help the research community push the limits of 3D object-geometry understanding, which has the potential to power a wide range of applications such as augmented reality, robotics, autonomy, and image retrieval.

****************************************************************

“Google AI researchers earlier this year released their MediaPipe Objectron, a mobile real-time 3D object detection pipeline able to detect everyday objects in plentiful 2D image collections and estimate their poses and sizes through a machine learning (ML) model trained on a newly created 3D dataset.”

Understanding objects in 3D remain challenging in large part due to the lack of large, real-world 3D datasets. The Google researchers believe the ML community has a strong need for object-centric video datasets that capture more of the 3D structure of an object while matching the data format used for many vision tasks, and so decided to release the Objectron dataset to aid in the training and benchmarking of ML models.

The Objectron dataset contains manually annotated 3D bounding boxes that describe each object’s position, orientation, and dimensions, comprising 15,000 annotated video clips supplemented with over 4 million annotated images collected from a geo-diverse sample covering 10 countries across five continents.

The dataset currently includes bikes, books, bottles, cameras, cereal boxes, chairs, cups, laptops, and shoes, and is stored in the Objectron bucket on Google Cloud Storage. An open-sourced data pipeline has been provided to parse the dataset in Tensorflow, PyTorch, and Jax ML frameworks.

Along with the dataset, the researchers also shared a 3D object detection solution for the shoes, chairs, mugs, and cameras categories. The models are trained with the Objectron dataset and have been released in MediaPipe, Google’s open-source framework for cross-platform customizable ML solutions for live and streaming media.

++++++++++++++++++++++++++++++++++++++++

The Objectron dataset is available on:

========================================

— — — — — — — — — — — — — — End — — — — — — — — — — — — — — —-
Base 64 Images with Node and JIMP
By: Chris Webb
Tags: Programming, Image Processing, JavaScript, Nodejs, Web Development

Base 64 Images with Node and JIMP

JIMP is the JavaScript Image Manipulation Program which is actually an NPM package, and one of its many features is the ability to create a Base 64 string from an image file. This has various uses (some nefarious…) and in this post I will demonstrate embedding a Base 64 encoded graphic as an img src in an HTML document. This is useful for small images such as logos or button graphics to reduce the number of HTTP requests, and although I am using HTML the Base 64 string can also be used in CSS.

As you probably know, base 10 (decimal) uses digits 0–9, and base 16 (hexadecimal) uses digits 0–9 plus the letters A-F. Base 64 of course needs 64 different characters and uses the 26 upper case letters, 26 lower case letters, numbers 0–9 and the plus and forward slash characters, as well as the equals sign for padding. (There are also a few other less common standards.) Therefore any code converting a file, stream or buffer to Base 64 will provide a string containing only ASCII characters which can be safely transmitted using any protocol.

For this project I will write a pair of simple functions which open an image file, obtain its Base 64 encoding, and then insert it into an HTML document. You can grab the source code from the Github repository.

The full documentation for JIMP is https://www.npmjs.com/package/jimp, and you can install it with:

npm install --save jimp

This is the source code for generating a base 64 image and embedding it into an HTML file.

In the openLogo function we read an image file (this is included with the source code) and then call getBase64Async with a MIME type of Jimp.AUTO to keep the file type of the original image. The resulting Base 64 string is then passed to base64ToPage .

The base64ToPage function opens an existing HTML file, replaces {{logo}} with the Base 64 string and then saves the file. This is a very crude approximation of what templating engines such as Mustache and Handlebars carry out, and is just a quick ’n’ dirty way of getting a Base 64 image into a web page rather than being production quality code.

In a real world situation the simplest way to use a JIMP generated base 64 image would probably be to write it to a text file and then copy/paste it into your code. Generating a base 64 image is quite time consuming, even for very small graphics, so is not something that can be done on the fly for each HTTP request — it is strictly a one-off process per image.

Now let’s run the code.

node base64image.js

If you open base64image.htm in your browser you will see a page containing this logo.
Generating Realistic Images Using Generative Adversarial Networks
By: Emproto Technologies
Tags: Artificial Intelligence, Image Processing, Generative Adversarial, Machine Learning

A generative adversarial network (GAN) is a class of machine learning frameworks designed by Ian Goodfellow and his colleagues in 2014. Two neural networks contesting with each other in a game (in the sense of game theory, often but not always in the form of a zero-sum game). Given a training set, this technique learns to generate new data with the same statistics as the training set.

GANs consists of two networks that compete with each other namely the generator network and discriminator network, discriminator network is designed in such a way that it can distinguish between real and fake data whereas the generator network is designed in such a way that it can produce fake data so that it can fool discriminator network.

Generally, a latent vector (random noise) is given as input to the generator network to generate fake images and these images are mixed with real images and given as input to the discriminator network to train it to distinguish between real and fake data, based on the output of discriminator our generator network learns accordingly how to make fake data that are close enough to fool discriminator and this is a never-ending process and also we cannot guarantee that after each step generator gets better always i.e. their loss functions keeps on fluctuating.

Generative adversarial networks are still developing and are getting better and better every year starting from deep convolutional GANs to StyleGAN we can see enormous changes in their outputs as well as their neural networks.

USE CASES OF GENERATING REALISTIC IMAGES:

✇ To generate fashion images useful for a designer to design clothes, shoes, jewelry, etc with ease.

–> Generating unique design patterns for houses, rooms, etc

–> Generating new images for images hosting firms

–> In the general use case of generating realistic images applies to all the applications where new design patterns are required.

OTHER COOL THINGS GANS CAN DO:

✇ Speech2Face GAN can reconstruct an image of a person’s face after listening to their voice

✇ GANs can be used to age face photographs to show how an individual’s appearance might change with age

✇ To convert low-resolution images to high-resolution images

–> Text to image translation

–> captioning the image with appropriate labels

–> Handwritten sketch to realistic image conversion

Originally published at https://emproto.com/ on 28th June 2020.
The Simple Math Behind Object Detection. Notes
By: Petro Ivanyuk
Tags: Image Processing, Data Science, Object Detection, Machine Learning

It’s just 4 picture-notes describing simple math needed to represent coordinates in their center-size fractional form, cropping images, and calculate some metrics (precision, recall, intersection over union) for the object detection task.

Fig. 1. Center-Size Coordinate
Compressing images in react using Browser Image Compression react library.
By: Dilip Bhaidiya
Tags: Image Compression, Image Processing, Image In React, Reactjs, Image Upload

I have started learning about image uploading through react js. And i came across good thing that by compressing image size before uploading to an actual server we can optimize application performance.

Install library via yarn or npm package manager.

npm install browser-image-compression --save

or

yarn add browser-image-compression

2. Creating a component

import React, { Component } from ‘react’ class App extends Component { constructor(props) { super(props) this.state = { selectedFile: null, compressedFile: null } } fileSelectedHandler=(event) =>{ } render() { return ( <div> <input name=”file” type=”file” onChange={this.fileSelectedHandler}/> </div> ) } } export default App

Here in above code we have two states selectedFile and compressedFile, initially both are kept to null. Also a input field with type file and fileSelectedHandler. This Handler will get fired when input changes data.

3. Import Library

import Compress from "browser-image-compression";

4. Update handler fileSelectedHandler = (event) => { // Get the files selected from the input tag // On select files always come in an array even // if you choose one its the first index // if you selected a couple then loop through the array const file = e.target.files[0] // Compression const options = { // As the key specify the maximum size // Leave blank for infinity maxSizeMB: 1.0, // Use webworker for faster compression with // the help of threads useWebWorker: true } // Initialize compression // First argument is the file object from the input // Second argument is the options object with the // config Compress(file, options) .then(compressedBlob => { // Compressed file is of Blob type // You can drop off here if you want to work with a Blob file console.log(compressedBlob) // If you want to work with the File // Let’s convert it here, by adding a couple of attributes compressedBlob.lastModifiedDate = new Date() // Conver the blob to file const convertedBlobFile = new File([compressedBlob], file.name, { type: file.type, lastModified: Date.now() }) this.setState({ selectedFile: file, compressedFile: convertedBlobFile }) }) .catch(e => { // Show the user a toast message or notification that something went wrong while compressing file }) }

Here , i have updated states, you can write your own logic to handle compressed image.

Note: I am beginner, i have just started writing blogs and also i am beginner in react js, so if i have made any mistake in it please feel free to correct me.
柱狀圖等化法（Histogram Equalization）
By: Ken Huang
Tags: Image Processing, Computer Vision, Histogram Equalization, Grayscale, Opencv

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
影像雜訊去除 — 中央加權中值法（Center Weighted Median）
By: Ken Huang
Tags: Image Processing, Computer Vision, Noise Reduction, Opencv, Noise Removal

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
影像雜訊去除 — 中值濾波器（Median filter）
By: Ken Huang
Tags: Image Processing, Computer Vision, Noise Reduction, Opencv, Noise Removal

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
OCR based Dot Matrix Character Recognition using Tesseract
By: Vijayakumar Pattanashetti
Tags: Tesseract, Ocr, Image Processing, Computer Vision

What is OCR?

OCR is the abbreviation for Optical Character Recognition. It is an algorithm to recognize the characters, including handwritten. It is available as the function in pytesseract package of Python. But it has few limitations such as, it fails to recognize characters in dot matrix form & 7-segment, cursive handwriting, etc… However, one may overcome these limitations by preprocessing the inputs instead of directly feeding the inputs.

Character Display Forms

There are many ways in which any alphanumeric character may be represented digitally, including, but not limited to, dot matrix, 7-segment, connected characters(cursive handwriting), normal(like those which appears on your mobile screen). In dot matrix, the each character is displayed as the grid of the dots, while 7-segment displays the characters as a combination of line segments. These make the task quite complicated when the dataset is diverse.

What is Tesseract?

Python Tesseract, aka pytesseract, is a Python package used for OCR based text recognition in the images. The function used for extracting the text embedded in an image is pytesseract.image_to_string(), whose argument is an input image. This works pretty good for the normal text form. However, as said before it fails to recognize dot matrix characters.

Problem: OCR of Characters in Dot Matrix form

Solution: We apply some image preprocessing techniques to solve the problem.

Steps:

Image Resizing & ROI Extraction Thresholding Blurring Morphological Operators viz., Erosion & Dilation Call OCR Function

Applications of OCR

Railway Ticket Checking System (which is manual today), Digitalizing Medical Prescription, Expiry Date Recognition, Bank Cheque Details Extraction, and many more.
影像雜訊去除 — 平滑法（Smoothing Method）
By: Ken Huang
Tags: Image Processing, Computer Vision, Noise Reduction, Opencv, Noise Removal

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore
Image Processing Best Practices — C++ Part 2
By: Soubhi Hadri
Tags: Image Processing, Computer Vision, Interview, Opencv, Cpp

It took me a lot of time to decide what is the best intro for this article. I should have published this article more than a year ago and I just want to say:

This article is a continuation to the first one. Please go back and check it out if you have not already, since it heavily depends on it.

We are going to cover the following in this article:

1. Implementation for Sobel filter through X axis (Vertically).

2. Implementation for Sobel filter through Y axis (Horizontally).

3.Implementation for Sobel filter through X and Y together.
Why does your garbage look like that?
By: Carrera Caldwell
Tags: Climate Action, Compost, No Waste, Garbage

I live with my mom in a 1-bedroom apartment and or garbage is a mess.

It looks like two, blue recycling bins side-by-side with a smaller bin inside that is lined with a plastic grocery bag. As I like to think most households get a little messy from time to time, I’ll admit it does reach a point where the bins become one giant mound of containers, paper, plastic, compost and garbage of all sorts. These overflowing bins out in the open and visible to all are an obvious eye sore when we have company. But I like it.

Everything is out in the open instead of tucked away in neat, black, little bags where people like to pretend it no longer exists after putting an item inside. I am aware of what I am throwing away and even if I do so unconsciously in the moment, I am reminded when I take it down to the sorting room in the apartment building.

The disposal room has different bins for almost everything which I love. It has ones for paper, containers, glass, cardboard, compost, and waste to be precise. When I make the trip to take it all out, I meticulously sort through every piece into the appropriate bin and in doing so, analyze:

What it is and why I am throwing it away; and if it could have been avoided.

I know it sounds like a lot of effort but so is self-awareness. There’s a reason they say ignorance is bliss but you can only check-out for so long before it catches up to you.
What You Can Do To Bring Your Sustainable Living To The Next Level
By: Caren D.P.
Tags: Eco Friendly, Climate Action, Conscious Living, Guidelines, Sustainability

3. Shop second-hand and sustainably.

The fast-fashion industry is unfortunately one of the biggest polluters in the world. Not to mention, the unthinkable and inhumane working conditions companies maintain for their workers. So before buying your next item, please make sure you are at least aware of where it comes from, and how and who made it.

From budget-friendly second-hand and vintage shops to zero-waste stores, sustainable and ethical brands, the choice is out there waiting for you. Second-hand shopping is obviously the most effective and planet-saving way to shop. You will re-use and give a new life to a garment/item that still has much to give instead of contributing to creating a more unnecessary product. If this option is not available for you or you will need something different from what you can find in vintage shops, check out eco-friendly and sustainable shops.

If you are not aware of where to find this information, I wanted to bring your attention to some great pages and guides which not only rate popular brands on their sustainability efforts but also provide great alternatives.

Goodonyou storiesbehindthings (on Instagram)

Goodonyou is a project which rates thousands of brands on their ethical and sustainable approaches. Their ratings look into the brand’s approaches towards the environment, people, and animals. Brands are rated from 1 (We Avoid) to 5 (Great). Discover the best and the worst of brands you usually shop from and why.

Stories Behind Things brands itself as ‘a storytelling platform for sustainable consumption & daily activism’. You can find great links to sustainable and ethical brands as well as important discussions. They also created on their website ‘The Seasonal Shop”, a shopping experience that brings to the forefront a listing of what they consider sustainable brands and projects.
5 Looming Environmental Crises That Rival Climate Change
By: Dustin T. Cox
Tags: Climate Action, World, Science, Society, Climate Change

Biodiversity Loss

Biodiversity is the variety of life on earth. Human beings rely on a host of organisms for food, medicine, shelter, and clothing; as biodiversity diminishes, so do our basic necessities. Fostering biodiverse biomes is, therefore, a fundamental human concern.

Numerous human activities daily erode biodiversity on earth. Deforestation is a principal contributor to biodiversity loss; human demand for land development, fossil and wood fuels, and building materials result in the loss of 18 million square acres of forest each year. Many animal species rely on old-growth forest habitats for survival and gradually die out in the aftermath of forest consumption by humans.

Experts estimate that the human-caused species extinction rate is up to 10,000 times greater than the natural background extinction rate; ironically, the more forests that humans convert to farmland, the more the pool of available resources shrinks. In 2019, the Intergovernmental Science-Policy Platform on Biodiversity and Ecosystem Services reported that up to one million plant and animal species are facing extinction due to human activity.

Overexploitation — such as overfishing, overhunting, and over-harvesting — also threatens the earth’s biodiversity. So too do pollution and human introduction of invasive species. Infectious disease, nutritional decline, and medicine shortages are all consequences of biodiversity loss for humans, and that is before we even calculate the impact of those losses on global warming.
Life on a Dying Planet
By: Karlee Pryor Thompson
Tags: Environmental Impact, Mother Nature, Climate Action, Climate Change

Life on a Dying Planet

The planet we are living on is a beautiful place, as many of you will agree. It is home to oceans and forests, mountain ranges and deserts, wetlands and arctic plains. But the sights of our great Earth are deteriorating, fast. Climate change is making it increasingly difficult to sustain our global environment, and maintain its biodiversity.

In the north and south poles, it is steadily getting warmer, melting the snow and ice that the wildlife is innately accustomed to. The intense heat in the most beautiful forests in the world is causing them to ignite and burn until there is almost nothing left. Just within the months that our people endured a horrific pandemic, Mother Earth was healing. For the first time in years, China had reduced its air pollution so drastically that the blue of the sky was actually visible over Hong Kong. If people would continue to treat our home as well as they have been treating themselves, we could exponentially increase the amount of time that our precious planet has left.

This planet has been home to us for billions of years. It has given us life, and provided us with food and natural means of shelter and survival before we were civilized enough to create them for ourselves. The least we could do is show a little compassion to our literal and figurative roots. What keeps us alive needs to be kept alive, too.
Agoracte
By: Marie-Cécile De La Taille
Tags: Agoracte, Climate Action

Learn more. Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Make Medium yours. Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore