February 26, 2010

Analysis of RGB channels in color images

Filed under: image processing/image analysis software, updates — Peter @ 12:46 pm

 

RGB stands for Red, Green, and Blue. These are the “channels” in a color image. Each pixel has 3 numbers between 0 and 255 assigned to it.

  • (255,0,0) red,
  • (0,255,0) blue,
  • (0,0,255) green,
  • (255,255,0) yellow,
  • (255,0,255) magenta,
  • (0,255,255) cyan,
  • (g,g,g) gray, for any g,
  • (0,0,0) black,
  • (255,255,255) white

Every color image has three color channels – red, green and blue – and the image features you are after may be more pronounced with respect to one of them.

The channel-by-channel analysis allows one to consider each channel of the color image as a separate gray scale image and analyze them as needed. In Pixcavator just click a button in the Analysis tab for the channel you want.

In the example below, the circles are of pure red, green, and blue. As a result, the red circle which is (255,0,0) becomes 255 in the red channel. But 255 is equivalent to white in this gray scale image. So the red circle disappears in the red channel. Similarly, the green circle will disappear if you choose the green channel, etc.

This option is important for some applications such as microscopy. Different features are sometimes better revealed in different channels. Below is the original image with two clear, to the human eye, features: red walls and green “cells”.

Image:Epithelial-cells.jpg

Read about analysis of this image here: http://inperc.com/wiki/index.php?title=RGB_channels.

February 22, 2010

Plans for the site

Filed under: computer vision/machine vision/AI, mathematics, site, updates — Peter @ 3:41 pm

Most of the recent content has come from two main sources. First, I have been adding, as before, examples of image analysis from the users of Pixcavator. The second is the course I’ve been teaching since last fall: Introductory algebraic topology. I plan to add more content from the courses that I teach: Vector calculus (this summer), Introductory differential geometry (next fall), and maybe also something of lower level like Calc1 (next winter).

What is the goal? I would like the site to cover a big chunk of the math curriculum, interlinked within and with the computer vision / image analysis topics (see The Mathematics of Computer Vision). Even though the format is identical to Wikipedia the presentation is very different. This is a textbook: more details, more examples, exercises, etc. It can still be used for reference.

The content comes directly from my lectures. I use Tablet PC with Windows Journal. I started doing this last fall and I really love the results: bright, colorful slides, but with the spontaneity and flexibility of a chalkboard. Later I transcribe the lectures into text, put it on the site, and simply copy the illustrations. (Plus, I don’t have to deal with chalk on my shoes, pants, and lungs!) I think this approach has huge advantages over the common practice of simply posting video lectures online: searchability, cross-linking, speed of download, the person can read and work at his own pace, etc.

January 5, 2010

Immunohistochemistry on lung biopsies: an image analysis example

Filed under: image processing/image analysis software, updates — Peter @ 3:24 pm

Q: “Immunohistochemistry was performed on my lung biopsies and now I have to analyse my staining. I would like to get a value for the colour intensity of my staining. … In the output of Pixcavator a mean value for grayness is given, but I don’t think all my brown staining is measured. Even if I adjust the threshold for size, not all objects are captured with a red or green contour.  ”

1. The difference in gray isn’t more pronounced because what is displayed is the average not the weighted average. So, one large dark object is outweighed by smaller, lighter ones. If you hover over objects (or look at the table) one at a time, you see a more noticeable difference. You can also save the data as a spreadsheet and compute the weighted averages. Certainly, if the difference is still too small, contrast enhancement would help.

2. It’s better to choose the green channel (or blue) than red. The features are much more distinct. If you click on “Display channel”, you’ll see the difference.

3. You are interested in dark objects only, red contours. So, the light ones only skew the averages. Click “Unmark light”.

4. The “Size” slider does not seem to reveal the features quite well. I used the simple thresholding instead, i.e., the “Intensity, dark” slider.

A screenshots is below. (This example may be somewhat similar: Measuring staining in the liver.)

More analysis here… 

Other examples of image analysis

December 28, 2009

A course in introductory algebraic topology

Filed under: computer vision/machine vision/AI, mathematics, news, updates — Peter @ 2:28 pm

This fall I have been teaching Topology I (Topology II next spring). I decided to emphasize algebraic topology and in fact started with it rather than point set topology which alone can take two semesters.

Outline
This is an introductory, two semester course on algebraic topology and its applications. It is intended for advanced undergraduate and beginning graduate students.

Part 1. Introduction to algebraic topology
Starts with topological issues in digital image analysis, informal introduction of homology

Part 2. Homology theory
Cubical complexes, their homology, and maps

Part 3. Overview of point-set topology
Minimized to the extreme (still could have cut even more)

Part 4. Homology groups
A more formal, group theory based, exposition

Part 5. Homology and uncertainty
Applications in computer vision, image analysis and data analysis

Part 6. Beyond homology
The fundamental group and cohomology

Also, I ran across this white paper from Hewlett-Packard: Algebraic topology for computer vision. Good review and an honest attempt to convince the practitioners to that this is something that they might need to know (good luck with that!).

December 20, 2009

Counting stained DNA: an image analysis example

Filed under: image processing/image analysis software, updates — Peter @ 1:18 pm

Q: we need to “count cell/dna etc from still microscopic image… Here we stained DNA …S-phase are in red and G-phase is in Blue. We want to count how many red are there and how many blue are there.”

I used Pixcavator and did a bit of experimenting with the first image. The red cells are easy to capture – in the red channel, 71 total.

Now the red cells are so bright that in the blue channel they are also present. So, here you see both red and blue and have to subtract:

 299 - 71 = 228 of the blue ones.

 Using subtraction here isn’t a perfect solution clearly. To separate red and blue one might try to filter the spots based on the size or intensity.

Image processing can help too – I simply removed the red using Photoshop Elements.

The total was 204. 

One day you’ll be able to use the true color analysis.

See examples of image analysis.

November 27, 2009

No web apps, for now

Filed under: image processing/image analysis software, updates — Peter @ 11:15 am

Q. “I was wondering if it is possible to make it as an online service where people could log on to the server and upload their image and obtain the report or csv file.”

A. I have been thinking about a web app for Pixcavator for a while. The idea is certainly very attractive but there are some drawbacks. First, the computations that Pixcavator does are quite CPU and memory intensive. The testing that has been done shows that online computation (short of some kind of supercomputer) wouldn’t be any faster than if it is done on a modern PC. Second, uploading a 1000×1000 bmp file can take as long as the processing itself. Once it becomes common for people to keep their images (and I mean business/research images, not family albums) “in the cloud”, a web application will make more sense. Getting there may take some time but there is no doubt in my mind that this is the future.

September 13, 2009

Site updates

Filed under: mathematics, site, updates — Peter @ 3:11 pm

I added a list of recent customers of ours here.

I also created a page for the course I am teaching: Introductory algebraic topology. The outline is there already and some of the articles have been written. The second one is Homology as a equivalence relation. Consider the question, What is a tunnel? It’s not as simple as it seems. It takes some work to find a good answer, the main part of which is: A tunnel is an equivalence class of closed surves.

Over the following months (it’s a two semester course) I’ll keep adding material as the course progresses.

I am also teaching Advanced calculus and some of this stuff will also find its way into the wiki.

August 31, 2009

Control of electron transport: new research that uses Pixcavator

Filed under: image processing/image analysis software, updates — Peter @ 2:02 am

A new research paper that uses Pixcavator:

Electron mirroring: control of electron transport and understanding of physical processes from SEM images [1] by Marziale Milani, Davide Bigoni, Claudio Savoia (in Proceedings of ITP2009 Interdisciplinary Transport Phenomena VI: Fluid, Thermal, Biological, Materials and Space Sciences October 4-9, 2009, Volterra, Italy.)

From the paper:

“Mirror effects occur when a primary electron beam scans an insulating sample and the charges on its surface accumulate to a high density. When the energy of the electrical field becomes higher than the primary beam one it prevents the charged particles from reaching the sample surface, reflecting them somewhere else in the vacuum chamber whose walls act as a mirror. The inner part of the specimen chamber can be therefore imaged.”

“Video signals were then analyzed as a function of detector bias voltage, i.e. variations in the mirror images due to variations of these parameters have been compared by acquiring (by “Pixcavator” software) the grey levels in selected portion of images and the geometrical shapes of some easily recognizable element in the mirror images.”

Mirror images of polyester samples:

Image:mirror_images_of_polyester_sample.jpg Image:mirror_images_of_polyester_sample_2.jpg

For more papers follow this link.

August 24, 2009

How stereo vision works, in a few pictures

Filed under: computer vision/machine vision/AI, mathematics, updates — Peter @ 4:05 pm

Image:Left.gif Image:Right.gif

Taking two images of the same scene from two slightly different locations and then matching the items in them pairwise gives you the distances to these items.

The image matching part is crucial and less trivial. For example on the right the corner of the cube may be a good pixel to choose. The rest of image is mainly featureless. The geometry is trivial, below.
Suppose we established a match between a pixel P in image I and pixel Q in image J. Let’s find the distance to what the pixels depict.

Two images with a red pixel in each image representing the same thing:

Image:stereo_vision_1.jpg

We need only to consider only the horizontal line through P,Q to find the distance to the object with the red dot. View from above; the eyes are the foci of the cameras. Black lines are the images:

Image:stereo_vision_3.jpg

“Triangulation”: the object lies on the line from the focus of the camera and its mark on the image. Here the big red dot is the actual location of the object:

Image:stereo_vision_4.jpg

The geometry:

Image:stereo_vision_5.jpg

D is what we are looking for.

The pink, and the blue, triangles are similar. So, after a bit of algebra we have:

D = f(L/d-1),

where d=x+y is simply the distance the pixel moves as we switch from one image to the other, called the disparity.

More details in the article.

 

August 20, 2009

Site redesign

Filed under: site, updates — Peter @ 3:34 pm

The site is being restructured right now. The goal is to integrate the Computer Vision wiki (mostly content) with the rest of the site (mostly product information). Virtually all of this content has already moved to the wiki. The only exception will be this blog. The menu at the top of this page will be removed and the pages it links to will be disabled, eventually.

This is the new welcome page of the site.

Please update your bookmarks, links, etc.

August 16, 2009

Wiki updates

Filed under: site, updates — Peter @ 2:57 pm

I updated several articles in the wiki in order to incorporate the new writing and images from my last talk

I updated both Binary images and Gray scale images, as well as their follow-ups: algorithms, pseudocode, and implementation. Also: Topology graph, Graph representation of gray scale imagesTree representation of images, Filtering output data, and some others.

The total is now 193 pages with 584 uploaded files, i.e., illustrations.

July 28, 2009

Circumference of a coral lesion, an image analysis example

Filed under: image processing/image analysis software, updates — Peter @ 6:59 pm
The lesion is the white spot

This came from an environmental researcher: “I need to determine the circumference of a coral lesion with a metric stick in the same picture.” The goal is to “determine how well corals are able to recover from damage or stress”.

This is what I was able to do with Pixcavator in about 10 minutes.

First, I cropped the image to speed up processing time. Then I ran the analysis. To capture the lesion I had to move the first slider almost all way to the right. The green contour then appears to capture the lesion well enough – the first screenshot. (The same result can be obtained using the other sliders.) Then in the table on the right you can see the size (area) of the spot: 19516 pixels. If you want to find the diameter, you can treat the spot as a circle with area 19516. Then the diameter is 2*sqrt(area/Pi) = 158.

lesion captured inside green contour, measurements on the right

Now, this result is in pixels. Pixcavator does not have at this time an automatic calibration feature but it can be done nonetheless. Out of many ways to do it – turn pixels into centimeters – I chose just one. In the second screenshot you can see that I captured two lines on the stick. Their second coordinates are 225 and 258. Then we have 5mm = 258 – 225 = 33 pixels. So the diameter is 158/33*5 = 79 mm which is reasonably close to what you see. If the setup is always the same, the calibration part will have to be done only once.

calibration

July 19, 2009

Topology Based Method of Segmentation of Gray Scale Images – talk

Filed under: computer vision/machine vision/AI, news, updates — Peter @ 4:23 am

I gave a talk at the WORDCOMP conference in Las Vegas, specifically IPCV’09, International Conference on Image Processing, Computer Vision, and Pattern Recognition. Here is the slides with comments. It also makes sense to look at the paper the talk came from.

 

 

April 13, 2009

Pixels are small

Filed under: computer vision/machine vision/AI, mathematics, updates — Peter @ 3:21 pm

I started writing the article for “Pixel” and the word certainly has multiple meanings…

  1. A location within the image: two coordinates.
  2. A location and its value: 0 or 1 for binary, 0-255 for gray scale, 3 numbers for color.
  3. A little square/tile (see Cell decomposition of images).
  4. A unit of length.
  5. A unit of area.

More important is to keep in mind while analyzing images this simple principle:

Pixels are small.

This is important in two ways.

First, as the resolution increases the analysis results should “converge” to the analysis results of the real scene depicted in the image. Because the world is analog (another good principle).

Whatever the “real” (or physical) object is depicted in the image, its area computed as the sum of pixels will be as close as we like to its “true” area as the resolution increases (for more rigorous interpretation [1]). See the pictures below.

This is not that simple with the length. Indeed, increasing the resolution will not reduce the relative error of the measurement. See Lengths of curves.

Second, we need to analyze image in such a way that a single pixel variation of the image would be negligible. In fact, a singple round of erosion or dilation, i.e. adding or removing a layer of pixels from the border of an object, will not dramatically change the area or perimeter of an object. Why? Because pixels are small.

The original image, the effect of dilation, the effect of erosion.

   The original image. The result of dilation. The result of erosion.    

This works fine for geometric measurements (see also Robustness of geometry) if the topology does not change. It’s not so easy for topology. The example on the right shows that adding the red pixel merges three objects and also creates a hole (white object).

Then we can say that these topological features aren’t robust. In fact the robustness can be measured in term of how many dilations and erosions it takes to change the topology. For example,

  • how many erosions does it take to split an object into two or more?
  • how many dilations does it take to create a hole in an object?

  

March 26, 2009

A dozen new image analysis examples

Filed under: image processing/image analysis software, news, updates — Peter @ 2:54 pm

Over the last few months I have been contacted by many individuals and companies asking for help with their image analysis task or to evaluate the suitability of Pixcavator for them. I decided to pull some of these exchanges for my correspondence and present them to the public in the wiki under Case studies. The anonymity of the users is of course protected. There will be more examples.

From other news, I started to use Twitter (ID PeterSaveliev) to announce new posts for this blog as well as some short notes on the same subject. We’ll see how it goes… UPDATE: Boring!

I also decided to change, in part, how this blog is maintained vis-à-vis the wiki. In the past, a blog post would appear first. Then after a while, it would be turned into an article or articles in the wiki. Now I’ll start writing an article first and when it is sufficiently mature, I’ll post it in the blog. The news will appear as before

Next Page »