Watershed

In this post we continue exploring and experimenting with topics from the PluralSight course Building Image Processing Applications Using scikit-image by Janani Ravi. The topic for this post is Watershed.

In image processing, a watershed (image processing) is a transformation defined on a grayscale image. The name refers metaphorically to a geological watershed, or drainage divide, which separates adjacent drainage basins. The watershed transformation treats the image it operates upon like a topographic map, with the brightness of each point representing its height, and finds the lines that run along the tops of ridges. These lines are then used to segment the image into regions. Continue reading “Watershed”

RAG Thresholding

This morning I read some news from different sources. I am amazed how facts are edited to provide some information but with a lot of bias in favor of the group reporting.

The first one was regarding how 50% of animal species have been decimated. The actual news mentioned that about 50% of species in the world are in decline. Yet some 3% are flourishing. 

On a different set of news, wildfires are out of control in Canada. The effects on the weather in different states in the USA is being felt including in Minnesota. For the past week or so we have had high values in the air quality which indicate many pollutants coming from the fires in Canada. The news stated that this is all due to global warming. Continue reading “RAG Thresholding”

Thresholding

In this post we will experiment applying global (histogram based) and local (considering values of neighboring pixels) thresholding to images.

This post is based on the PluralSight course Building Image Processing Applications Using scikit-image by Janani Ravi. She uses the Jupyter notebook for the exercises. I decided to use the VSCode IDE to experiment with GitHub Copilot. At this point in time such a feature does not seem to be available.

I would like to disclose that I am a Microsoft employee and have been using VSCode and Visual Studio IDEs for many years. Like to follow the KISS principle (https://en.wikipedia.org/wiki/KISS_principle) and when needed, challenge common assumptions that do not make sense to me i.e., this is how we always do it, or this is how it is done. Continue reading “Thresholding”

Erosion Dilation to Fill Holes and Find Peaks

In this post we will experiment with the contents of the section on Filling Holes and Finding Peaks Using Erosion and Dilation of the PluralSight course Building Image Processing Applications Using scikit-image by Janani Ravi.

It seems that this as most of the other sections stand on its own. The idea is to find out that such a library exists, what it is used for, experiment with it, and if the need arises in the future, you will have a basic understanding of how to use the feature. Continue reading “Erosion Dilation to Fill Holes and Find Peaks”

Denoising

Good morning. Similar to yesterday’s weather here in the Twin CIties of Minneapolis and St. Paul, our high temperature for the day is forecasted to be 90F. We are still in spring but it is starting to feel like summer.

Yesterday my wife and I were planning to walk for about ten miles. Due to the temperature and humidity we decided to cut it short to just five. Today we are just planning on five miles.

Today we will experiment with denoising images. This post is based on the contents of a section in the PluralSight course Building Image Processing Applications Using scikit-image by Janani Ravi. Continue reading “Denoising”

Corner Detection

It is a summer Saturday morning in the Twin Cities of Minneapolis and St. Paul in Minnesota. The temperature will go up to 87F. Around 10:00 AM, before it gets too hot, my wife and I will go out for a leisure walk of 10 miles. Last night I had a hard time sleeping so hopefully the mild exercise will help this evening.

In this post we continue to watch the PluralSight course Building Image Processing Applications Using scikit-image by Janani Ravi. She uses a Jupyter notebook. In this post we will use VSCode with GitHub Copilot. I should disclose that I am a Microsoft employee and have been using VSCode for a few years. When possible I like to follow the KISS principle so I prefer to use the minimum number of IDEs that support all the programming languages I wish to use. Why complicate life using as many IDEs as one can find and never become proficient on all of them. Continue reading “Corner Detection”

Convex Hull

In this post we will learn a few things about a convex hull.

Before we get into the main subject I would like to chat for a few on a different subject. Currently I continue to read Natural Language Processing by Ekaterina Kockmar. Earlier this morning I was reading the section 3.2.2 Matching forms of the same word: Morphological processing. In the current chapter we are trying to develop an information retrieval system. In a nutshell we have a set of documents of interest and a set of queries. The idea is that given a query we want to return relevant documents in descending order. Sounds very much like what Google search does. Of course the objectives are not to write something to compete with searches on web browsers, but to give us an idea of the general steps needed to perform such a task.

In particular I was reading about Stemming. The idea is that when you have words in a query and wish to map them to words on a document, the forms of a word may be different. A simple word match would not work (e.g., continue and continuation) because for a computer the words are different. If we implement an algorithm using stemming we will be able to match the words.

As I was reading the section an old Spanish saying (https://en.wikipedia.org/wiki/Saying) “The devil knows more through being old than through being a  devil.” If you stop for a few and think about the Spanish saying you should reach the conclusion that it is wrong. In general if you do not reflect on what happened, the good and bad decisions you made, you will not learn and therefore you will not become wiser. For the Spanish saying to be true one must assume that the devil reflects on past events. Since the devil is a personification of evil and not a being like us, the saying is just a saying. Continue reading “Convex Hull”

Contours

In this post we will experiment with drawing contours on shapes. This post is based on the PluralSight course by Janani Ravi.

We will use The Marching Squares algorithm to draw contours. The algorithm is easy-to-implement, is an embarrassingly parallel algorithm that generates contours for a two-dimensional (rectangular) array. Continue reading “Contours”

Block Views and Pooling Operations

In this post we will continue reading and experimenting with the contents of the PluralSight course “Building Image Processing Applications Using scikit-image” by Janani Ravi.

Please note that the course uses the Jupyter notebook to hold the code and results. In this post we will write modified code using the VSCode IDE and a Python script using GitHub Copilot. I would like to disclose that I am a Microsoft employee and have been using VSCode and Python for several years. Continue reading “Block Views and Pooling Operations”

Days in Month – Java

In this post we will compute the number of hours in the specified month and year. This could be used to determine the cost for a feature if enabled every day for a specified month and year.

If one rounds up all months to have a fixed set of days, the result would not be correct. For example, a year has 12 months. Most months have a fixed set of days e.g., Jan, Mar, May, Jul, Aug, Oct, and Dec always have 31 days while Apr, Jun, Aug and Nov always have 30 days. This is not the case with Feb which on regular years it holds 28 days but on leap years it holds 29 days. Continue reading “Days in Month – Java”