Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Vision Distance Question (http://www.chiefdelphi.com/forums/showthread.php?t=154944)

RoboBucs 08-02-2017 16:52

Vision Distance Question
 
This is the first year we've really tried vision, so if I seem lost, it's because all of vision is pretty much new to me, but I successfully integrated the 2017 vision example code into our vision code for this year. The camera display in vision shows the camera, and is filtering to show only our reflective tape correctly, however, the distance reading comes back as infinite(inf). Any ideas?

aeastet 09-02-2017 08:33

Re: Vision Distance Question
 
Quote:

Originally Posted by RoboBucs (Post 1642141)
This is the first year we've really tried vision, so if I seem lost, it's because all of vision is pretty much new to me, but I successfully integrated the 2017 vision example code into our vision code for this year. The camera display in vision shows the camera, and is filtering to show only our reflective tape correctly, however, the distance reading comes back as infinite(inf). Any ideas?

We your vision finds the target is the box red or green? You can change the threshold value to lower the level and it should turn green. You may also have to look a the code to see what you are not getting. When I went through the code the first time I noticed that it needed four points to calculate the distance. I made my own that only requires the line to get the distance. It seems to work really well. If you can not figure it out let me know and I will send you our distance code.

flemdogmillion 09-02-2017 09:10

Re: Vision Distance Question
 
Try this: https://www.chiefdelphi.com/forums/s...d.php?t=154930

RoboBucs 09-02-2017 12:55

Re: Vision Distance Question
 
It finds it as red currently. I appreciate the replies and links, I'll try changing the threshold later today and update on the results, if that doesn't work I'll give those pdf links a go. Thanks for the replies!

Tom Line 09-02-2017 13:35

Re: Vision Distance Question
 
Red means it doesn't have a valid targst. Try changing the score cutoff.

flemdogmillion 09-02-2017 13:51

Re: Vision Distance Question
 
Quote:

Originally Posted by Tom Line (Post 1642547)
Red means it doesn't have a valid targst. Try changing the score cutoff.

His problem is probably that the line along which it searches for edges is vertical, thus not crossing any stripes. This causes the distance calculation to fail, regardless of score cutoff. The line also needs to extend a few pixels past the overall bounding rectangle on either end.

RoboBucs 09-02-2017 15:56

Re: Vision Distance Question
 
Now I'm getting errors. I changed nothing coming into today but as soon as I connect my driver station started pumping out errors like there was no tomorrow. This was the error: ERROR 1043 Register For Events in Calibration Helper2.vi->Vision Processing.vi->Robot Main.viLabVIEW: The property or method is not supported in this version of LabVIEW. ERROR -1074395152 IMAQ Vision: (Hex 0xBFF607F0) Font file not found. ERROR -1074395152 IMAQ Vision: (Hex 0xBFF607F0) Font file not found. ERROR 1043 Register For Events in Calibration Helper2.vi->Vision Processing.vi->Robot Main.viLabVIEW: The property or method is not supported in this version of LabVIEW.


Any ideas?

flemdogmillion 09-02-2017 19:33

Quote:

Originally Posted by RoboBucs (Post 1642653)
Now I'm getting errors. I changed nothing coming into today but as soon as I connect my driver station started pumping out errors like there was no tomorrow. This was the error: ERROR 1043 Register For Events in Calibration Helper2.vi->Vision Processing.vi->Robot Main.viLabVIEW: The property or method is not supported in this version of LabVIEW. ERROR -1074395152 IMAQ Vision: (Hex 0xBFF607F0) Font file not found. ERROR -1074395152 IMAQ Vision: (Hex 0xBFF607F0) Font file not found. ERROR 1043 Register For Events in Calibration Helper2.vi->Vision Processing.vi->Robot Main.viLabVIEW: The property or method is not supported in this version of LabVIEW.





Any ideas?



Font file not found is okay, it means the font for the scoring numbers that are overlayed on the displayed images in the front panel of vision processing.vi isn't on the RoboRIO.
For the other error, you will need to remove the calibration code (or disable it). When targeting the peg, calibration does pretty much nothing.
Make sure that when you want to save changes to values entered in the front panel, right click -> data operations -> make current value default, then save the VI. Otherwise, it will reset the value on you when you close the VI or try to build the project.

Greg McKaskle 10-02-2017 08:55

Re: Vision Distance Question
 
The errors about the event not being supported are caused by putting desktop code on the roboRIO. There is a call to the calibration helper that passes the reference to the picture control. This lets you click and draw a line on the colored region and it calculates the HSL range settings based on your statistic settings.

But this can't work in a headless RT environment. In that situation, you remove the cal from the roboRIO, and if you still want it, you put it into your dashboard and share the results to the robot.

Greg McKaskle

RoboBucs 10-02-2017 16:33

Re: Vision Distance Question
 
I resolved the errors, thank you for the help on that, but now I'm back to the first problem. I tried lowering the score cutoff and using a horizontal line, but both still come back red with an infinite reading. Any ideas?

flemdogmillion 10-02-2017 20:35

Re: Vision Distance Question
 
Quote:

Originally Posted by RoboBucs (Post 1643084)
I resolved the errors, thank you for the help on that, but now I'm back to the first problem. I tried lowering the score cutoff and using a horizontal line, but both still come back red with an infinite reading. Any ideas?

Increase your line border values, they need to be greater than, say, 2 or 3, and by default they are 6 and 1.

RoboBucs 10-02-2017 21:10

Re: Vision Distance Question
 
Alright, I'm getting readings perfectly now if I put the reflective tape horizontal, rather than vertical, because with the code that I have now, I can't do the mouse drag to calibrate it, and I can't figure out how to make the calibration line horizontal instead of vertical. I tried switching the control for that in the distance calculation subVI, but it had no effect. Where do is the option for it to track horizontally rather than vertically as it does by default?

flemdogmillion 11-02-2017 09:41

Re: Vision Distance Question
 
Quote:

Originally Posted by RoboBucs (Post 1643183)
Alright, I'm getting readings perfectly now if I put the reflective tape horizontal, rather than vertical, because with the code that I have now, I can't do the mouse drag to calibrate it, and I can't figure out how to make the calibration line horizontal instead of vertical. I tried switching the control for that in the distance calculation subVI, but it had no effect. Where do is the option for it to track horizontally rather than vertically as it does by default?

The line isn't a calibration line, it's the distance calculation line. That line is drawn in Rectangle Comparison.vi, near the top of the block diagram. You can't draw that line, the program has to draw the line based on the position of the particles.


All times are GMT -5. The time now is 12:24.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi