Detect laser line profile in an image

4 views (last 30 days)
Omid
Omid on 9 Sep 2014
Commented: Walter Roberson on 1 Aug 2016
Hi all,
I am trying to extract profile of a laser line from an image. I have implemented many methods including edge detection, image filtering, binary morphological operations, etc. but none of them gave me a neat curve profile.
The original image can be found here:
When I am trying to convert the the red part of the RGB data to binary image the problem rises. If I want to keep the whole data, I will have a lot of noise in the binary image but if I reduce the noises by increasing the threshold, I will lose some part of data. Two binary image with 0.1 and 0.4 threshold can be found in following links:
When I try to perform morphological thinning
bwmorph(binImg_01,'thin')
end then the image with a lot of noises (0.1 threshold) would look like this: http://s4.postimg.org/6ntvwe0rx/thinned_binary_0_1.jpg
and the thinned data for the higher threshold (0.4)
bwmorph(binImg_04,'thin')
I have tried other threshold values and even data fitting to recover the lost part of data for higher threshold values but with no achievement! Data/Curve fitting does not help because the for a particular "x" value there might be several "y" values and vice versa unless you want to process the data piece-by-piece which I assume would not be a wise decision.
I even tried filtering the data first using wiener2 function and then converting it to binary image but it did not work either because filtering in addition to binary conversion does not increase the efficiency of noise reduction that much. In other words, binary conversion is a noise reduction method itself ... well, pretty basic but still it reduces the noise.
Also, edge detection of various methods did not help much but I am open to any suggestion on this as well. Even I tried other morphological operations before/after thinning but it had no results other than loosing more data.
Although the background looks perfect for this type of image processing task but I think the non-uniform distribution of data throughout the laser line profile causes above issues. Some part has less noises but less intensity and concentration of data points and it is exactly opposite for another part of the image.
Any help/advice at this point would much appreciated as I am getting to the point to manually divide the image into two parts and process each part individually that I know would not sound professional.
If any extra data/image is needed for you to be able to give advice or you have any question, please let me know and I will do my best to provide the requested information.
Thanks all
  3 Comments
Image Analyst
Image Analyst on 1 Aug 2016
Why don't you start your own question and then I could show you how you might use regression to fit a curve?
Walter Roberson
Walter Roberson on 1 Aug 2016
Don't use JPEG for scientific analysis: you end up fighting the way JPEG messes up sharp edges instead of being able to concentrate on the real task.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!