Matlab for image processing?

"Please leave a message at the beep, we will get back to you when your support contract expires."

Moderators: phlip, Moderators General, Prelates

ErrantVenture
Posts: 1
Joined: Mon Jun 13, 2011 2:54 pm UTC

Matlab for image processing?

Postby ErrantVenture » Mon Jun 13, 2011 5:11 pm UTC

Heya all. I'm doing a geophysics internship this summer studying upper mantle plumes and island formation. Basically we're modeling these plumes using a 70 gallon tank of corn syrup and a heat pump to generate the plume. Using a green LED laser and some special camera settings we can light up the plume (to some degree) and get a bunch of time-lapse photographs while the run goes (usually lasts 4-6 hours). Here's an image of what's going on (http://img819.imageshack.us/img819/7558/testmnk.jpg). The problem is, evening with the room as dark as it can be, the laser highlighting, and the special camera settings, the plume is still pretty hard to see against the background of the rest of the tank. What I'd like to do is make it more visible, either by tracing the outline of the plume or by identifying the plume in a grayscale of the image and just turning all the pixels inside of it to white or black. So far I've tried some of the edge detection functions in matlab (specifically the canny and sobel algorithms) and I haven't had much luck. After converting the image to grayscale and running the canny algorithm i just get crap out (http://img21.imageshack.us/img21/6787/canny.jpg). Have you guys got any other ideas on how to make this work?

yewbie
Posts: 208
Joined: Mon Sep 13, 2010 6:35 pm UTC

Re: Matlab for image processing?

Postby yewbie » Tue Jun 14, 2011 3:39 pm UTC

Cranking the brightness and contrast by hand I was able to obtain this, but I don't think there is enough information in the image to get anything meaningful out of it.
Attachments
testmnk.jpg

User avatar
SlyReaper
inflatable
Posts: 8015
Joined: Mon Dec 31, 2007 11:09 pm UTC
Location: Bristol, Old Blighty

Re: Matlab for image processing?

Postby SlyReaper » Tue Jun 14, 2011 4:17 pm UTC

My instinct would be to try a difference of gaussians on the image and see if that outputs anything useful. I'm not sure how effective it would be, given how indistinct the plume is, but it could be worth a try. Failing that, I notice that the shape of your plume can sort of be made out in your canny image. Maybe thresholding a particular density of white points could yield a result? You'd have to play around a lot with your threshold level to get something useful, and that threshold might not work on subsequent images, but again, it might be worth a try.
Image
What would Baron Harkonnen do?

yewbie
Posts: 208
Joined: Mon Sep 13, 2010 6:35 pm UTC

Re: Matlab for image processing?

Postby yewbie » Tue Jun 14, 2011 4:34 pm UTC

Just a thought, but if you covered up where the laser hits it might make the image your taking come out better.
Like put a square of cardboard in front of it.
and maybe some more ambient light.
Last edited by yewbie on Tue Jun 14, 2011 6:18 pm UTC, edited 1 time in total.

User avatar
Wnderer
Posts: 640
Joined: Wed Feb 03, 2010 9:10 pm UTC

Re: Matlab for image processing?

Postby Wnderer » Tue Jun 14, 2011 5:57 pm UTC

I did this with Lview Pro. Mostly gamma correction, contrast adjustment and SinH enhancement.

http://download.cnet.com/LView-Pro/3000 ... 56490.html
testmnk2.jpg
.

You might want to try shining multiple lasers. I'm not sure if the most interesting part is the light parts or the dark mottled parts.

User avatar
zed0
Posts: 179
Joined: Sun Dec 17, 2006 11:00 pm UTC

Re: Matlab for image processing?

Postby zed0 » Tue Jun 14, 2011 7:41 pm UTC

I've been doing a project fairly similar to this on a jet engine recently; our flow is seeded with particles which reflect the laser light preferentially towards the camera, as you might expect with a jet we're taking images at a rather higher frequency (~15us between frames).
With a seeded flow this is called Particle Image Velocimetry (PIV), as you cross correlate the successive images to determine flow's velocity between the two frames.

My main advice would be to black out all surfaces that the laser is likely to reflect off (we've been having problems with ours reflecting off the ceiling), keep your exposure settings as short as possible (although presumably your laser is the only illumination in the room) and make sure that the camera is exactly focused on the light sheet.

Out of interest what are you using this for? Would adding particles be a possibility or is it likely to affect the flow sufficiently for it not to be viable? (I can't imagine so with corn syrup)
I don't know which cameras you're using but most of the cameras I've seen used for this sort of purpose will take images at 16 bits; if you want to save at 8 bits you can select the limits on a histogram; tightening these limits can make a huge difference to the quality of images produced.

There are various programs for dealing with the outputs of these images, the two that come to mind are DaVis (which we are using, but costs thousands pounds for a license) and Open PIV. I believe that both of these contain functions for raising the contrast of your images.

An example of what we've been getting is here: http://zed0.uwcs.co.uk/Misc/ring2_0004.png Note that this isn't actually that great an image, it's out of focus so the particles appear blurred, however you can clearly see the cross section of the flow.

User avatar
Izawwlgood
WINNING
Posts: 18686
Joined: Mon Nov 19, 2007 3:55 pm UTC
Location: There may be lovelier lovelies...

Re: Matlab for image processing?

Postby Izawwlgood » Tue Jun 14, 2011 7:49 pm UTC

What's going on with the left of the image? That background is pretty severe. If you can create a mask, or just manually delete that portion of the image, you might have some luck binarizing the image with a threshold and doing a simple subtraction. I presume you just want the area of the plume, and not something else , like the eccentricity or whatnot?
... with gigantic melancholies and gigantic mirth, to tread the jeweled thrones of the Earth under his sandalled feet.

User avatar
Mokele
Posts: 775
Joined: Fri Aug 21, 2009 8:18 pm UTC
Location: Atlanta, GA

Re: Matlab for image processing?

Postby Mokele » Tue Jun 14, 2011 10:31 pm UTC

Have you tried applying histogram equalization to cropped versions of the image?

If it's an RGB image, you should be able to separate out each of those fields, and then play around with just the green one.

There's also a free software package called ImageJ put out by the NIH that can do a lot of tweaks, if you want.
"With malleus aforethought, mammals got an earful of their ancestor's jaw" - J. Burns, Biograffiti

User avatar
Izawwlgood
WINNING
Posts: 18686
Joined: Mon Nov 19, 2007 3:55 pm UTC
Location: There may be lovelier lovelies...

Re: Matlab for image processing?

Postby Izawwlgood » Wed Jun 15, 2011 1:03 am UTC

So, for a crappy matlab course I took, I did some rudimentary image processing on data collected in one of my rotations.

http://www.youtube.com/watch?v=jKFfFk8wJ9A

In short, the images were three color channels, with green being a transfection (treatment) marker, blue being a myocyte marker, and red being a neuronal marker. The idea was to look at the difference in neuron cell coverage over cells that had been transfected vs cells that hadn't been. ImageJ has pretty robust thresholding capabilities that would have worked, but I wanted to try and do it manually, potentially to process a large body of data rapidly. I only got as far as processing a slide, but feasibly you could just rapid fire a bunch of slides through the script, which wasn't doing anything particularly complex beyond image subtraction and thresholding.
... with gigantic melancholies and gigantic mirth, to tread the jeweled thrones of the Earth under his sandalled feet.


Return to “The Help Desk”

Who is online

Users browsing this forum: No registered users and 7 guests