Camera

7 replies [Last post]
amehta
Title: NooBot
Joined: 07/18/2011
Posts:
BotPoints: 136
User offline. Last seen 35 weeks 5 days ago.

So for some reason I am having difficulty using the camera. Our LINK detects color blobs perfectly well during the time that we test it under the Channels section, but when we actually run a program, it doesn't recognize any objects. I used the workshop code just to make sure it wasn't me, it still didn't work even though I put the object right in plain view of the camera.

I tried different cameras and both ports, not sure what the problem is. Any suggestions?

(Here's the code:)

  1. int x, y;
  2. camera_open(LOW_RES);
  3. camera_update();
  4. printf("\n\n%d\n\n", get_object_count(0));
  5. camera_close();
  6. while (b_button() == 0)
  7. { // run till B button is pressed
  8. camera_update(); // process the most recent image
  9. if (get_object_count(0) > 0)
  10. {
  11. //get x, y for the biggest blob the channel sees
  12. x = get_object_center(0,0).x;
  13. y = get_object_center(0,0).y;
  14. printf("Biggest blob at (%i,%i)\n",x,y);
  15. }
  16. else
  17. {
  18. printf("No color match in Frame\n");
  19. }
  20. msleep(200); // give user time to read
  21. }

-amehta (Andrew Mehta)

Jeremy Rand
Jeremy Rand's picture
Title: Botball Youth Advisory Council
Joined: 04/03/2009
Posts:
BotPoints: 1168
User offline. Last seen 2 years 22 weeks ago.

I haven't used the Link's vision libs yet, but is there a reason why you're calling camera_close() before calling other camera functions?

-Jeremy Rand
Senior Programmer, Team SNARC (2012-2013), Norman Advanced (2010-2011), Norman HS (2008-2009), Norman North (2005-2007), Whittier MS (2003-2004)
2012-2013 VP of Tech, 2011 President, Botball YAC (2009-2013)
Mentor, Alcott and Whittier MS

TBTF
TBTF's picture
Title: NooBot
Joined: 07/11/2010
Posts:
BotPoints: 25
User offline. Last seen 4 years 15 weeks ago.

There are three reasons I can see that your robot would be doing this:

First, you need to make sure that one of the camera configurations on the Kovan is selected as the default configuration, otherwise camera_open(LOW_RES) won't open any configuration, and no blobs will be seen. Selecting the default configuration is done on the screen that shows a list of all the .config files you've created. The current default configuration (if there is one) will have a star by it.

Second, camera_close() should only be called if you aren't going to use the camera anymore or if you intend to reopen it with a different resolution like MED_RES or HIGH_RES. As a result, any camera function called after you close the camera won't work.

Third, there was a bug on older firmwares where camera_update() didn't retrieve the most recent frame until the third or fourth call. I'm not sure if this still happens on the newer firmwares. Other than that you're code should be fine.

Norman Advanced Robotics
#YOLOSWAG

Ponivnret
Title: NooBot
Joined: 07/29/2016
Posts:
BotPoints: 22
User offline. Last seen 1 year 11 weeks ago.

Thanks a lot for sharing. You have done a brilliant job. Your article is truly relevant to my study at this moment, and I am really happy I discovered your website.
get help with file explorer in windows 10

panistefanin
Title: NooBot
Joined: 05/29/2017
Posts:
BotPoints: 22
User offline. Last seen 20 weeks 5 days ago.

Hello! Very interesting topic, thank you raised it
sprint corporate

lionel
Title: NooBot
Joined: 04/28/2017
Posts:
BotPoints: 12
User offline. Last seen 6 weeks 2 days ago.

Programming with similar devices is a very complex task and I don’t think it is better to try and repair it by ourselves. The best way is to ask the help of experts regarding the issue. Please stay updated with the details. online computer support service

Beni
Title: NooBot
Joined: 08/04/2017
Posts:
BotPoints: 6
User offline. Last seen 11 weeks 1 day ago.

Try something new and safe for your devices. itpcexpert.com/icloud-unlock Great solution for iPhone users.

ankit121
Title: NooBot
Joined: 10/04/2017
Posts:
BotPoints: 10
User offline. Last seen 1 week 1 day ago.

Papas sushiria is a new crazy for online gamer papa games free and every new gamer want to connect with it .Guys papa sushiria is very popular gaining website .Thanks a lot