K-Means Clustering for Image Classification Using OpenCV

In a previous tutorial, we have explored the use of the k-means clustering algorithm as an unsupervised machine learning technique that seeks to group similar data into distinct clusters, to uncover patterns in the data.  We have, so far, seen how to apply the k-means clustering algorithm to a simple two-dimensional dataset containing distinct clusters, …

How to Transform Images and Create Video with OpenCV

When you work with OpenCV, you most often work with images. However, you may find it useful to create animation from multiple images. Chances are that showing images in rapid succession may give you different insight or it is easier to visualize your work by introducing a time axis. In this post, you will see …

K-Means Clustering in OpenCV and Application for Color Quantization

The k-means clustering algorithm is an unsupervised machine learning technique that seeks to group similar data into distinct clusters, with the aim of uncovering patterns in the data that may not be apparent to the naked eye.  It is possibly the most widely known algorithm for data clustering, and it comes implemented in the OpenCV …

How to Read and Display Videos Using OpenCV

Digital videos are close relatives of digital images because they are, indeed, made up of many digital images that are sequentially displayed in rapid succession to create the effect of moving visual data.  The OpenCV library provides several methods to work with videos, such as reading video data from different sources as well as accessing …

How to Read, Write, Display Images in OpenCV and Converting Color Spaces

When working with images, some of the most basic operations that are essential to get a grip on include reading the images from disk, displaying them, accessing their pixel values, and converting them from one color space to another. This tutorial explains these basic operations, starting first with a description of how a digital image …

A Gentle Introduction to OpenCV: An Open Source Library for Computer Vision and Machine Learning

If you are interested in working with images and video and would like to introduce machine learning into your computer vision applications, then OpenCV is a library that you will need to get hold of.  OpenCV is a huge open source library that can interface with various programming languages, including Python, and which is extensively …

thumbnail

Goal Representations for Instruction Following

Goal Representations for Instruction Following A longstanding goal of the field of robot learning has been to create generalist agents that can perform tasks for humans. Natural language has the potential to be an easy-to-use interface for humans to specify arbitrary tasks, but it is difficult to train robots to follow language instructions. Approaches like …

pipeline h

Rethinking the Role of PPO in RLHF

Rethinking the Role of PPO in RLHF TL;DR: In RLHF, there’s tension between the reward learning phase, which uses human preference in the form of comparisons, and the RL fine-tuning phase, which optimizes a single, non-comparative reward. What if we performed RL in a comparative way? Figure 1: This diagram illustrates the difference between reinforcement …

Using ggplot2 for Visualization in R

Last Updated on September 26, 2023 One of the most popular plotting libraries in R is not the plotting function in R base, but the ggplot2 library. People use that because it is flexible. This library also works using the philosophy of “grammar of graphics”, which is not to generate a visualization upon a function …