Nxt cam V5 How to check the color of the object being tracked

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

smart_app123
New User
Posts: 18
Joined: Thu Jan 11, 2018 11:35 am

Nxt cam V5 How to check the color of the object being tracked

Postby smart_app123 » Mon Feb 05, 2018 12:37 am

nxt Is there any way to get the color of the object being tracked in Cam V5 as an int?

And can I convert setTrackingMode back into LINE_TRACKING mode?

User avatar
gloomyandy
leJOS Team Member
Posts: 6018
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Nxt cam V5 How to check the color of the object being tracked

Postby gloomyandy » Mon Feb 05, 2018 7:05 pm

You pass a parameter into the setTrackingMode method to control the mode see...
http://www.lejos.org/ev3/docs/lejos/har ... Mode-char-

As to getting the colour, well you can use:
http://www.lejos.org/ev3/docs/lejos/har ... Color-int-

This does not give you an actual RGB (or whatever) colour rather it tells you which of the colours you have pre-defined is being tracked. So 0 will be the first, 1 the second etc.

But rather than asking these questions, why not spend some time reading the leJOS documentation and that provided by HiTechnics this does a pretty good job of describing how the camera works, the leJOS implementation is a pretty obvious translation of the HiTechnics documentation. Also just try things out and see how they work.
leJOS news https://lejosnews.wordpress.com/


Return to “EV3 Software”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest