Archive

Posts Tagged ‘image processing’

Convert images to data with Plot Digitizer

May 30th, 2011 2 comments

You’re scouring the internet for data to prove your point…
After hours of searching, you finally found it!
One problem – it’s a chart in a pdf…

Charts are better than nothing, but you really want to have the numbers in Excel or Matlab so you can do analysis and get big insights (or at least make a nicer-looking chart).

The answer is Plot Digitizer

   Click to continue →

RSS Feeds for Scientific Journals

July 14th, 2009 1 comment

Knowing about new research in my field helps keep my work informed and relevant. However, I rarely remember to log into IEEE Xplore, Springer, or Science Direct to see what’s new in top computer vision journals. Recently, I saw mention of using RSS to keep up with research on Productive Scholar.

It took a bit of searching, but eventually I found RSS feeds for many of the journals I’m interested in and loaded them into google reader. It is now quick to scroll through new abstracts as papers appear on-line prior to publication. Below are links to RSS feeds for some computer vision journals I’m keeping up with.

RSS Feeds for Computer Vision Journals

Finding RSS Feeds for Other Journals

It takes a bit of hunting sometimes, but I can’t imagine that a journal would not have RSS these days. IEEE Journals are easy to find, and I found that inezha.com was a good resource for finding some of the other ones I have listed.

Any good feeds I missed?
Other good ideas for keeping current?

Leave them in the comments.

Median Filter and Morphological Dilation in Python

May 1st, 2008 No comments

Python is a very nice programming language. Fast. Simple. Free. I recently spent some time learning it for a class on computer vision. I was using the PIL and numpy packages to make Python feel more like my old friend Matlab.

The two functions that I couldn’t find, and missed the most (especially when writing hack-y code for class projects) were median filtering and morphological dilation. So, in hopes of sparing other the pain of writing them… here they are! The function medfilt_dilate.py has both functions.

medfilt_dilate.py

The medfilt() function uses the PIL filtering code. The dilate() function was written from scratch with NumPy.

Categories: Matlab, Vision Tags: ,

Selective Mode filter in Matlab

April 12th, 2008 3 comments

The median filter is a well-known image processing filter. It provides a very nice way to smooth an image while preserving edges. The median filter replaces each pixel in the image with the median value of its neighboring pixels. A similar non-linear filter with slightly different properties is the mode filter which replaces each pixel with the mode of its neighboring pixels. I additionally make a slight modification so that “bad” pixels are ignored entirely in the computation of the mode.

This idea arose when I was trying to de-noise some images as well as do some in-painting of “bad” pixels (that have no value). Consider the image below. The darkest-blue areas are bad pixels. We have no information for those pixels. The other pixels are colored to show how far that pixel is from the camera. (see the post on Stereo Vision) However, some of the good pixels still have the wrong value. These are the noise pixels.


original data
[Initial Image]

In the rest this post I talk about how we use a selective mode filter to convert the above image into the one below. (There’s also download-able Matlab/C++ code)


selective modefilt
[Final Result of Selective Mode Filter]

   Click to continue →

Categories: Matlab, Vision Tags: ,

PIL in OSX, The Easy Way

February 5th, 2008 3 comments

After spending about an hour fighting with PIL (Python Imaging Library) and trying to get it to install properly with all of its dependencies I discovered that some wonderful person posted a ready-made pil installer for osx. This worked like a charm. First try. No problems.

God I love it when people do stuff like this. Now, hang on as I learn to do image processing with Python on my mac.

Mean Shift Segmentation in Matlab

November 16th, 2007 75 comments

Background

Recently I have decided to explore tracking from 3D point clouds extracted from stereo vision cameras. Step 1: Extract 3D point cloud from stereo vision cameras. So right now I’m implementing Segment-Based Stereo Matching Using Belief Propogation and Self-Adapting Dissimilarity Measure” by Klaus, Sormann, and Karner. This paper is defined by the source on stereo vision to be the best one around. This paper has two parts. Part 1: Segment the image. Part 2: Compute disparity (and depth) from the segments. Well, today I finished Part 1.

Stereo Cameras

First Try

The authors refer to a mean-shift segmentation algorithm presented in Mean Shift: A Robust Approach Toward Feature Space Analysis” [pdf] by Comaniciu and Meer to do the image segmentation. This paper (unlike some of my own previous work) leans towards oversegmentation of an image. Meaning that you prefer to get lots of little bits rather than the “right object” after the algorithm has run.

Well, after looking over the paper and getting a grasp for the mathematics, I took a crack at implementing it. Easily done… HOWEVER, my first attempt, written in Matlab, was painfully slow. (For a simple image it took 6 hours to run!) So, I got on the internet and came up with a better solution!

The Solution

Some great guys at Rutgers University implemented this paper in C++ and made the code available to the public under the name EDISON. (there’s also a nice GUI that goes along with this if you want to just play to see if these codes will work for you). Okay, so I had C++ codes that worked well (only 2 sec to do an image rather than 6 hours). The next step was to bring the code into Matlab.

Mean Shift Segmentation Results
These were the type of results I was trying for

I cracked my knuckles and got ready to write a MEX wrapper for this EDISON code. Then I said to myself, “Self, maybe you should check the ‘net first.” Turns out I had a good point. I found the website of Shai Bagon. Mr. Bagon had already made the MEX wrapper! Awesome.

I downloaded the codes and put them together. Mr. Bagon’s stuff worked right out of the box, although it would have saved me about an hour if I would have had this information (alternative readme.txt for Matlab Interface for EDISON). I also wrote my own wrapper-wrapper so that I could process grayscale images, and do simpler calls to accomplish what I wanted. If you’d like the code, download my wrapper-wrapper here (msseg.m).

Results

Here is a sample of the output of this algorithm. The first image is a regular photo of some posed objects. The second image is the segmented version. Notice how the regions of the image are much, much more constant. This image has been broken into “tiles” of constant color.

Left Image
The original image (part of a standard pair of test images).
segmented image
The segmented image (ready to be processed in step 2)

Conclusion

Don’t re-invent the wheel. Taking a first crack at the implementation was good, and it helped me understand the algorithm. However, there was no need for me to spend a week tweaking it to be super-fast or two days getting the Matlab interface working. These things had already been done! It feels nice to knock out a task that you thought was going to take a week in a few hours : ) Stay tuned for the stereo part of this paper coming soon. Then maybe people will be writing about my page!