Announcement

Collapse
No announcement yet.

Sensing Minerals with Color Sensor

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sensing Minerals with Color Sensor

    We are having challenges with sensing the difference between cubes and balls with our REV Color Sensor. When the robot is closer to the mineral, the RGB values of the ball are higher and when we are farther away from the minerals, the cube RGB values are higher. Does anyone have any suggestions on how to sense the minerals accurately no matter how far the robot is away from the minerals in sampling in autonomous.

  • #2
    It will be tough as I think rgb values is combination of all the colors that color sensor can see in its field of vision. You can try HSV or design some kind of an arm that can extend and sense color. I wish Vuforia object scanner works but there are challenges in that too. We tried Pixy and it works fine but we need to test with different lighting conditions. Best option is OpenCV with GRIP ( FRC) or DogeCV

    Comment


    • #3
      We used the color sensor last season but our experience is the sensor has to be very close to the object, even 2 inches away could be too far. I agree with FTC12676, it'll be hard to use.

      Comment


      • #4
        It's difficult with color sensor. But if you can get close enough you can use the distance sensor from the REV color sensor to know it's close enough before measuring the color. Like what other people mentioned above, HSV is a better way to go.

        Comment


        • #5
          What is HSV? I tried searching the site, but only came up with this thread. We are at the discussion stage on our sampling, and were thinking of using the color sensor route. If HSV is better, perhaps we should start there. I did see another discussion about DogeCV. It looks like it uses the phone. Does HSV also use the phone?

          Comment


          • #6

            Comment


            • #7
              We're going to give the color sensor a try tomorrow, but we're also hopeful that the TensorFlow example code just released in v4.3 will do the trick.
              For the color sensor, I would expect we have to be close to work. However, this can be improved if you calibrate your sensor:
              https://ftc-tricks.com/color-sensor-calibration/ It still won't be too far.

              The HSV color model is a good idea, but another perspective is to work with the RGB channels. On the white ball, I'd expect the RGB values to be about equal, while on the yellow cube, I'd expect the blue channel to be the weakest, while the red and green channels are about equal. Something like float goldness = (Red + Green - 2*Blue ) might work, being maximum when you are on something yellowish, zero on something white, and negative on something blue. Get some telemetry with a similar calculation on your phone and see if it is indicative of anything useful.

              Comment


              • #8
                ajtrowell's idea is a good one and is essentially a "poor man's unnormalized Saturation."

                In the HSV model, S=Saturation = (Max(R,G,B) - Min(R,G,B)) / Max(R,G,B). As noted, for white, R, G, and B are about the same and S=0, while for gold, B will be much less than the R and G values so S will be close to 1. Using this simple calculation can be a good quick way to detect white vs. gold, assuming you are close enough to the mineral to get reasonable readings. Using S also auto-normalizes for brightness, while ajtrowell's goldness value will vary depending on how bright the sensed colors are. Normalizing the proposed goldness value will result in a variable very similar to S.
                CHEER4FTC website and facebook online FTC resources.
                Providing support for FTC Teams in the Charlottesville, VA area and beyond.

                Comment

                Working...
                X