Go to Post While youth is wasted on the young, in FRC knowledge can be wasted on those a bit older. - IKE [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-01-2009, 18:28
nickmagus's Avatar
nickmagus nickmagus is offline
Registered User
AKA: Nick Clayton
FRC #0008 (Paly Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Palo Alto, Califorinia
Posts: 56
nickmagus is an unknown quantity at this point
Send a message via AIM to nickmagus
NiVision.cpp

does anybody know where I can find nivision.cpp? I want to tinker with the blob finding algorithm to make it faster but all I can find is nivision.h.
  #2   Spotlight this post!  
Unread 25-01-2009, 01:24
wt200999's Avatar
wt200999 wt200999 is offline
Texas Instruments
AKA: Will Toth
FRC #3005 (Robochargers)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Dallas, Texas
Posts: 323
wt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud ofwt200999 has much to be proud of
Send a message via MSN to wt200999
Re: NiVision.cpp

The NiVision is proprietary, so you can't.
__________________
Programming in LabVIEW? Try VI Snippets!

FIRST LEGO League 2004 - 2005
FRC Team 870 Student 2006 - 2009
FRC Team 3005 Mentor 2013 -
  #3   Spotlight this post!  
Unread 25-01-2009, 08:33
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,750
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: NiVision.cpp

The NIVision source file is one of several hundred that make up the nivison.out and nivissvc.out binary files. The blob stuff has been around a loooong time, and is very optimized already.

What sorts of things seem slow, or inefficient to you.

Greg McKaskle
  #4   Spotlight this post!  
Unread 26-01-2009, 00:04
nickmagus's Avatar
nickmagus nickmagus is offline
Registered User
AKA: Nick Clayton
FRC #0008 (Paly Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Palo Alto, Califorinia
Posts: 56
nickmagus is an unknown quantity at this point
Send a message via AIM to nickmagus
Re: NiVision.cpp

the color threshold takes a while (relatively) even on the lowest resolution.
  #5   Spotlight this post!  
Unread 26-01-2009, 08:55
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,750
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: NiVision.cpp

The way the color threshold is being used, we are sending in an RGB image, and asking it to do HSL comparisons. To do this, it converts the pixels to HSL as needed. The largest cost is the hue calculation, so this is done only when the other stuff passes. So in fact, the threshold is doing quite a bit of work. But it is still necessary and fast.

There are of course ways to speed it up. There are functions in the WPI and in the nivision libs for subsetting the image. You can extract a stripe or rect of the image to further limit what the threshold needs to process, and you can decimate the image to grab only every Nth pixel. The speed gain for the threshold call will be directly affected by the number of pixels being processed.

The LV example demonstrates this by using the extract subVI. The trick is to fix up the coordinates on your results. Decimating shrinks the returned coordinates, and subsetting shifts them. So if you implement this in C, it may be useful to look at the LV one for comparison.

Also note that the content of the image and the settings of the Lum and Sat parameters will affect the timings you take. For consistency, take a realistic image, and use it as your test case using a JPG read. The lum and sat speed up the algorithm, because the more pixels that can be excluded with lum and sat, the fewer hue calculations are needed.

Greg McKaskle
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fatal Error: Cannot access Resource.cpp darkdwarven FRC Control System 2 26-01-2009 18:50


All times are GMT -5. The time now is 17:30.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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