1

I'm writing a program that can detect veins(the dark lines) on an arm.

When looking at the image at full size, you can easily make out where they are.

arm veins

But when zoomed in around a vein I get something ambiguous which doesn't seem to have edges anymore.

vein patch

I've tried edge detection but it doesn't work well since the apparent 'edges' aren't actually edges when viewed close up.


Took me a while to learn all the necessary mathematics, but I've managed to write a ridge detection algorithm as suggested by Rethunk. This question helped alot.

It works quite well. enter image description here

Still needs improvement though, probably using scale space image processing as suggested by Fat32.

Quevun
  • 65
  • 4
  • Do you have to zoom in to detect the edges? You can detect them at any scale you want. Morveover, you can perform some pre-processing operations such as brightness equalization, gray level stretch, highpass filter etc to improve the image before a usual detection. And remember, your vision and machine vision have different characteristics and capabilities. – Fat32 Jun 11 '16 at 10:19
  • I thought that since edge detection uses the gradient image, the rate of change of pixel intensity in a small neighborhood is what matters. So I zoomed in to examine the individual pixels. And it turned out that the gradients around the veins are not much different from gradients everywhere else. – Quevun Jun 11 '16 at 12:10
  • As I said, you can process the image to improve the gradients. At least a small scale image will have a steeper gradient per pixel... – Fat32 Jun 11 '16 at 12:22
  • ok, so I've tried to scale down the image by repeatedly applying a gaussian filter. But after the second filter, contour-like ripples appear and the image stops getting blurrier for some reason. – Quevun Jun 11 '16 at 13:31
  • by scale down, I mean a smaller image... it will be sharper and you can detect the edges in this sharper image... – Fat32 Jun 11 '16 at 13:40
  • To scale an image like this, use an edge-preserving filter. The Kuwahara filter is a good place to start. As long as your resolution (mm/pixel) is consistent, you can also try using a "stretched" edge-finding kernel that compares intensities many pixels apart. That is, for edge finding you don't need to compare only neighboring pixels. Image processing for human skin gets tricky, given the variety. Also consider imaging light at a different wavelength. A tough problem in visible light can become a trivial problem in thermal IR, for example. – Rethunk Jun 11 '16 at 13:46
  • Also, look into the Stroke Width Transform. If you look for edge gradients that point at each other, and if the stronger transitions are a relatively consistent distance apart--that is, the width range of visible veins--then you should be able to find veins even in this low contrast image. Also, search for "ridge" finding algorithms rather than just edges. An edge is one transition; a ridge is light-dark-light or dark-light-dark. – Rethunk Jun 11 '16 at 13:54

0 Answers0