TXT 4.0 Camera and color detection
Forumsregeln
Bitte beachte die Forumsregeln!
Bitte beachte die Forumsregeln!
TXT 4.0 Camera and color detection
I've a problem with the color detection with the camera on the new TXT 4.0 Controller.
When I run the program 'camera_detect_color' there is no color detection at all.
It doesn't matter if use a red, green or yellow plate, the RGB-value is constantly fluctuating, random it seems.
See this video.
Is there anyone who has this working?
When I run the program 'camera_detect_color' there is no color detection at all.
It doesn't matter if use a red, green or yellow plate, the RGB-value is constantly fluctuating, random it seems.
See this video.
Is there anyone who has this working?
- Dirk Fox
- ft:pedia-Herausgeber
- Beiträge: 1833
- Registriert: 01 Nov 2010, 00:49
- Wohnort: Karlsruhe
- Kontaktdaten:
Re: TXT 4.0 Camera and color detection
Hi Hans,
I just had a look at the code. The color detection is configured with a "hue tolerance" of one degree.
The hue coding converts the RGB color code into a 360° color circle position.
To meet the right color with only one degree tolerance is challenging... especially with artificial light.
Try to increase the tolerance (up to 30° should be possible), and the color recognition should work perfectly.
Regards,
Dirk
I just had a look at the code. The color detection is configured with a "hue tolerance" of one degree.
The hue coding converts the RGB color code into a 360° color circle position.
To meet the right color with only one degree tolerance is challenging... especially with artificial light.
Try to increase the tolerance (up to 30° should be possible), and the color recognition should work perfectly.
Regards,
Dirk
- Dirk Fox
- ft:pedia-Herausgeber
- Beiträge: 1833
- Registriert: 01 Nov 2010, 00:49
- Wohnort: Karlsruhe
- Kontaktdaten:
Re: TXT 4.0 Camera and color detection
Hi Hans,
For more details, see fischertechnik Robotics: Topic Introduction ("How does RGB colour code work?").
Regards,
Dirk
that's unavoidable (and normal): with RGB coding it is nearly impossible to identify the color (because there is a great range of valid combinations of R, G and B). That's why fischertechnik converts the RGB code into hue.
For more details, see fischertechnik Robotics: Topic Introduction ("How does RGB colour code work?").
Regards,
Dirk
Re: TXT 4.0 Camera and color detection
Hello Dirk,
Thank you for your answer(s)!
I've tried your advise to increase the HUE tolerance to 30°.
But it's still not working.
I tried a different camera, no result.
I enlarged the camera reach to the maximum, no result.
I build in some wait time in de program loop, no result.
And finaly I build in another dectection color : black (#000000) with a hue tolerance of 30°.
If black is detected, all status indicators will be active.
And indeed if the camera is covered completely the RGB = #000000 and de status indicators are active.
But when there is the slightest light: RGB is #010000 or #000001 or whatever the color black is not recognised.
So I think the conclusion is: The hue-function doesn't work at all!!
Regards,
Hans
Thank you for your answer(s)!
I've tried your advise to increase the HUE tolerance to 30°.
But it's still not working.
I tried a different camera, no result.
I enlarged the camera reach to the maximum, no result.
I build in some wait time in de program loop, no result.
And finaly I build in another dectection color : black (#000000) with a hue tolerance of 30°.
If black is detected, all status indicators will be active.
And indeed if the camera is covered completely the RGB = #000000 and de status indicators are active.
But when there is the slightest light: RGB is #010000 or #000001 or whatever the color black is not recognised.
So I think the conclusion is: The hue-function doesn't work at all!!
Regards,
Hans
- Dirk Fox
- ft:pedia-Herausgeber
- Beiträge: 1833
- Registriert: 01 Nov 2010, 00:49
- Wohnort: Karlsruhe
- Kontaktdaten:
Re: TXT 4.0 Camera and color detection
Hi Hans,
you are right! I tested it yesterday evening, with the same result... There must be a problem with the color (hue) calculation.
It worked some month ago, but I suppose they changed something and didn't test it again.
I am in contact with fischertechnik and will report the error.
Regards,
Dirk
you are right! I tested it yesterday evening, with the same result... There must be a problem with the color (hue) calculation.
It worked some month ago, but I suppose they changed something and didn't test it again.
I am in contact with fischertechnik and will report the error.
Regards,
Dirk
- Dirk Fox
- ft:pedia-Herausgeber
- Beiträge: 1833
- Registriert: 01 Nov 2010, 00:49
- Wohnort: Karlsruhe
- Kontaktdaten:
Re: TXT 4.0 Camera and color detection
Hi Hans,
here is my solution - hue calculation "by hand". I implemented it for the "fischertechnik education base set".
I just tested it - it is (still) working.
Regards,
Dirk
here is my solution - hue calculation "by hand". I implemented it for the "fischertechnik education base set".
I just tested it - it is (still) working.
Regards,
Dirk
- MasterOfGizmo
- Beiträge: 2720
- Registriert: 30 Nov 2014, 07:44
Re: TXT 4.0 Camera and color detection
Fischer will soon release the TXT-4.0"s full source code to comply with the licenses. We can then simply take a look ourselves and see where the problem is and how to fix it
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32
- Dirk Fox
- ft:pedia-Herausgeber
- Beiträge: 1833
- Registriert: 01 Nov 2010, 00:49
- Wohnort: Karlsruhe
- Kontaktdaten:
Re: TXT 4.0 Camera and color detection
And here is the appropriate display configuration:
Regards,
Dirk
Regards,
Dirk
Re: TXT 4.0 Camera and color detection
Hello Dirk,
I implemented your solution - hue calculation "by hand" and it's working fine.
Thank you.
Regards,
Hans
I implemented your solution - hue calculation "by hand" and it's working fine.
Thank you.
Regards,
Hans
- Dirk Fox
- ft:pedia-Herausgeber
- Beiträge: 1833
- Registriert: 01 Nov 2010, 00:49
- Wohnort: Karlsruhe
- Kontaktdaten:
Re: TXT 4.0 Camera and color detection
Hi Hans,
in my solution I did not separately distinguish the "colors" white and black. It's easy to add this, if you need it: For black, all three RGB values are significantly smaller than 50, for white, they are all bigger than 200. The exact (or best) value depends on the general brightness.
Regards,
Dirk
in my solution I did not separately distinguish the "colors" white and black. It's easy to add this, if you need it: For black, all three RGB values are significantly smaller than 50, for white, they are all bigger than 200. The exact (or best) value depends on the general brightness.
Regards,
Dirk
Re: TXT 4.0 Camera and color detection
Till,
da ich im anderen Thread nicht schreiben kann. Ich bin mal auf die Antwort von fischer gespannt wg. dem Sourcecode gespannt.
Hast du diese auch direkt wegen der Lizenzverletzung kontaktiert?
da ich im anderen Thread nicht schreiben kann. Ich bin mal auf die Antwort von fischer gespannt wg. dem Sourcecode gespannt.
Hast du diese auch direkt wegen der Lizenzverletzung kontaktiert?
https://gundermann-software.de/shop/
Der Shop für viele Community Projekte
Der Shop für viele Community Projekte
- MasterOfGizmo
- Beiträge: 2720
- Registriert: 30 Nov 2014, 07:44
Re: TXT 4.0 Camera and color detection
Nö ... sollte ich sie direkt kontaktieren? Ich wüsste nicht wen dort. Ich kenne keinen aus deren Rechtsabteilung. Auf diesem Weg klappt das bestimmt auch.
Arduino für fischertechnik: ftDuino http://ftduino.de, ftDuino32 http://ftduino.de/32
Re: TXT 4.0 Camera and color detection
Da reicht notfalls die Geschäftsleitung....
Aber das Sie diese Posts nicht lesen würden können Sie allerdings auch nicht behaupten
Aber das Sie diese Posts nicht lesen würden können Sie allerdings auch nicht behaupten
https://gundermann-software.de/shop/
Der Shop für viele Community Projekte
Der Shop für viele Community Projekte