Engine
Engine

Reputation: 5420

Detecting deformed lines

I've already asked this question on https://dsp.stackexchange.com/ but didn't get any answer! hope to get any suggestion here:

I have a project in which I have to recognize 2 lines in different "position", the lines are orthogonal but can be projected on different surfaces. I'm using opencv.

The intersection can be anywhere on the frame. The lines are red (the images show just the gray scale).

UPDATE

-I'll be using a gray scale camera !!!!!!!!!

-the background and objects on which the lines will be projected can change
ilnes on straight surface

deformed lines

I'm not asking for code, but only for hints about how can I solve this? I tried houghlines function but it works only for straight surfaces. thanks in advance !

Upvotes: 3

Views: 805

Answers (4)

William
William

Reputation: 26

Perhaps subtracting the grayscale image from the red channel would help to highlight the red. I'd post this as a comment but cannot do so yet.

Upvotes: 0

r3mainer
r3mainer

Reputation: 24547

Here's the result of subtracting the output of a median filter (r=6):

result of subtracting a median-filtered image

You might be able to improve things a bit by adjusting the median filter radius, but these wavy, discontinuous lines are going to be difficult to detect reliably.

You really need better source images. Here are a few suggestions:

  1. A colour camera would help enormously. Apply a high-pass filter to the red and green channels, and calculate the difference between the two. The red lines will stand out much better then.

  2. Can you make the light source brighter?

  3. Have you tried putting a red filter over the camera lens? Ideally you want one with a pass band that matches the light source's wavelength as closely as possible — if the light is coming from a laser, then a suitable dichroic filter should give good results. But even a sheet of red plastic would be better than nothing. (Have you got an old pair of red/blue 3D glasses sitting around somewhere?)

Upvotes: 0

Andrey  Smorodov
Andrey Smorodov

Reputation: 10852

I think AMI's idea is good.

You can also think about using controled laser source. In that case you can get image pair one with laser turned on and one with turned off, then find difference.

It can be interesting for you: http://www.instructables.com/id/3-D-Laser-Scanner/

Upvotes: 1

AMY
AMY

Reputation: 248

This is not that difficult task as it include straight line. I have done similar kind of project.

  1. First of all if your image is colored covert it to gray scale.
  2. Then use a calibrated median filter to blur the image.
  3. Now subtract the blurred image from the gray scale image.
  4. After step 3 if you look at the image you will see that the on the places of lines the intensity is higher than the other parts of image because these line are contrasted and when we apply median filter the subtracted value is more than the rest of image.
  5. to get a cleaner distinction you need to use create a binary image ie. only black and white with a particular thresh hold. 6.Finally you got yu lines if their is noise you can use top hat filtering after step 4 and gaussian filtering after step 5.

You can take help from this paper on crack detection

Upvotes: 4

Related Questions