MATLAB: I want to crop an image accoording to shape created by laser (imcrop)

auto shapeImage Processing Toolboximcroprectengularred line

Hello, I want to crop an image according to rectengular shape created by laser light.I would read a serial number from this cropped image.

Best Answer

Three things to try
Try hough or houghlines.
Color segmentation doesn't seem to work well because the line is both red and white. But maybe you could use the color thresholder to get the brightest white pixels and then use RANSAC on them to find the lines.
Or perhaps you could use radon to find the lines. This gives a projection of the image along the angles you specify. At certain angles, those aligned with the laser lines, the projection will be brightest.
Related Question