Go to Post The world isn't changed by people playing it safe. - Andrew Y. [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #16   Spotlight this post!  
Unread 04-02-2012, 08:04
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,753
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: Particle Analysis Report Problems

I looked through the documentation, but couldn't find specifics. At least for the LV entry points the API is pretty forgiving and pretty intelligent. The underlying call to imaqColorThreshold takes in Range* datatypes for the three color specifications. A Range is two ints, which can encode 32 bit ints. I tested the LV entry points and they pin the ints into a reasonable range, so 256 is the same as 255. I'd expect the C functions to do the same. I don't have the signature for the RGBThreshold wrapper in WPILib, but as long as it uses ints and not int8s, there shouldn't be a problem, and even then, it would depend a bit on the ABI and implementation details.

Greg McKaskle
Reply With Quote
  #17   Spotlight this post!  
Unread 04-02-2012, 09:43
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 158
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: Particle Analysis Report Problems

I can see your point, but the reality is that these images are 24-bit HSL or 24-bit RGB ... 8 bits for each of H,S,L or 8-bits for each of R,G,B... so when you filter against them, you are filtering these exact 8-bit values in or out. So even though the API may take larger than 8-bit numbers, the max value you want to put in your filter is 255.

Thanks,
bob
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote
  #18   Spotlight this post!  
Unread 04-02-2012, 12:32
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,753
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: Particle Analysis Report Problems

I completely agree. It is confusing and possibly brittle to use a number that won't fit into an int8, but as long as the RGBThreshold wrapper doesn't cause it to be cast, the underlying IMAQ functions appear not to treat 256 as 0, but instead treat 256 as 255. In other words, they pin the input number into range rather than cast it.

Again, I'm basing that on the behavior of the LV entry points, and the C version could be different.

Also, the IMAQ analysis functions also support int16 monochrome, float monochrome, and even RGB64 images, so the pinning is useful for those cases as well.

Greg McKaskle
Reply With Quote
  #19   Spotlight this post!  
Unread 09-02-2012, 18:43
xraymypanda's Avatar
xraymypanda xraymypanda is offline
Cowboy programmer
AKA: Chris M
FRC #0599 (RoboDox)
Team Role: Programmer
 
Join Date: Dec 2011
Rookie Year: 2011
Location: Granada Hills,CA
Posts: 82
xraymypanda has a spectacular aura aboutxraymypanda has a spectacular aura about
Re: Particle Analysis Report Problems

Hi, why do you use a for loop in your function? We have been trying to get the particle analysis working so we can use the FindColor function of TrackAPI.
__________________

2011: Head Scout
2012: (figure)Head Programmer
2013: Head Programmer, Chief Strategist, Outreach Executive, and Driver
Reply With Quote
Reply


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


All times are GMT -5. The time now is 13:39.

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