Laser line guided vision

Added by Anders Stenhammar 29 days ago

I am trying to determine the position of an object with very little "hue". It is made of an 1000mm x 1000mm aluminium sheet with a black plastic frame around it. The frame is about 10mm thicker than the sheet. I`m thinking about using different colored laser lines modules together with Pixy. If i point the laser module with an angle against the object, the line will look like this: - _ - , with an center line and two stub lines, at the point where the sheet and frame meets because of the height difference. So the big question is, can pixy determine the lenght and position if the center line? This will determine the objects lenght. If so, I will add another line with a different color parallel to the first line to make a color code. This is to determine the objects Y position and the angle of the objekt. If that works, I will add an third and fourth line crosswise to be able to determine the X position. There will total of 4 different laser colored lines on the object, overlapping each other. Can Pixy track all of those lines and CC-objects? As an bonus, I would also like to determina the objects distanse from the camera. I guess it will be possible just by measuring how the lines get smaller further away the object is from the camera. Also, the lines will separate more when the distance is larger.
See the attached file for how I am imaging this would work. I have not yet been able to test it IRL. I will use an Arduino for this.

Laser matrix.png - Trying to determine an low hue object with disturbed laser lines (86.9 kB)

Replies (5)

RE: Laser line guided vision - Added by Jesse French 26 days ago

Hey Anders,

interesting question. Pixy is good at detecting contiguous blocks of color - lines are a little challenging, depending on how thin they are. That said, if Pixy is close enough, it should be able to detect them - the minimum size is 4x1 pixels in the camera sensor.

Once Pixy is detecting objects, it will report X-Y coordinates as well as area of regular objects. It will also report the angle of color-code objects. You can do some math in your code to work out distance, although it may not be very robust.

Worth a shot, I'd say!

Hope this helps,

RE: Laser line guided vision - Added by Anders Stenhammar 25 days ago

Hello .
Thanks a lot for your answer!
I have managet to detect two lines now in the default mode, but not in cooked mode. why is it like that? see attached photo.
I can not get a color code out of the lines when they are not next to each other, is there a way around this?

s1 s2 cooced.PNG (59.7 kB)

s1 s2.PNG (1.7 kB)

RE: Laser line guided vision - Added by Edward Getz 23 days ago

Hi Anders,
Cooked mode is actually half-resolution of default mode. Usually this doesn't matter much, as cooked mode is used mostly for debugging, but it looks like you found a good example of where cooked and default differ significantly/functionally. :)


RE: Laser line guided vision - Added by Anders Stenhammar 6 days ago

Some update on the project.
I have successfully detected a red laser cross line, a specially if i adjust the lens out of focus. My aluminium object is reflecting the laser lines quite well. The line needs to be quite thick to get a secure reading. I either adjust the pixy to see the laser line be exposed all over the aluminuim object, or just to see the cross. Anyway, I now get the objects x and y position and area. I will try it out further.

RE: Laser line guided vision - Added by Edward Getz 5 days ago

Hi Anders,
Looks interesting! Reducing the camera brightness helps as well. Laser light tends to overexpose the sensor, leading to saturation. Using a low brightness (exposure) will allow the camera to get a good hue value (red) without saturation, which can distort the hue (orange, yellow, white, instead of red)