Go to Post Experience...you can't buy it, you might be able to get some for free by reading CD a lot, but usually you have to earn it, and it's not always fun. - MrForbes [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 18-02-2010, 16:59
TPNigl TPNigl is offline
Registered User
FRC #0069 (Team HYPER)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Quincy, MA
Posts: 94
TPNigl is an unknown quantity at this point
Camera particleToImagePercent not working

So what we are trying to do currently is get a feed from the camera stating the percentage of the area of the soccer ball is compared to the whole camera image. I am getting odd numbers though. They have ranged from .0075 to 11.86. I have no clue how to read these and I haven't been able to find it. Also, we keep getting a watchdog error with the following code in teleopContinuous. Any ideas? Thanks everybody!

Code:
Watchdog.getInstance().feed();
         Timer.delay(10.0);
         int numParticle = 0;
         
         m_autoPeriodicLoops++;
         numParticle = 0;

         try
         {
            if (cam.freshImage())
            {
                colorImage = cam.getImage();
                binaryImage = colorImage.thresholdRGB(80, 110, 150, 180, 80, 110);
                ParticleAnalysisReport[] par = binaryImage.getOrderedParticleAnalysisReports();
                ParticleAnalysisReport par2 = par[0];

                double percentageSum, soccerBallPercentage;

                m_DriverStationLCD.println(DriverStationLCD.Line.kUser3,1,"" + par[numParticle].particleToImagePercent);
                numParticle++;

                /*for (int i=0; i<par.length-1; i++)
                 {

                    percentageSum = par2.particleToImagePercent;
                    soccerBallPercentage = percentageSum/par.length;
                 }*/
            }
         }

         catch (AxisCameraException ex)
         {
            ex.printStackTrace();
         }

         catch (NIVisionException ex)
         {
            ex.printStackTrace();
         }
__________________


2011 Pit Crew:
2011 CT Xerox Creativity Award

HYPER Alumni
  #2   Spotlight this post!  
Unread 19-02-2010, 07: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,748
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: Camera particleToImagePercent not working

Have you tried to do this with vision asst? Often, you need to explore a handful of images looking for the right numbers, perhaps run a filter over the image first, etc.

Figuring out these steps with nothing but printf can be quite difficult.

Greg McKaskle
  #3   Spotlight this post!  
Unread 19-02-2010, 13:16
TPNigl TPNigl is offline
Registered User
FRC #0069 (Team HYPER)
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2007
Location: Quincy, MA
Posts: 94
TPNigl is an unknown quantity at this point
Re: Camera particleToImagePercent not working

We don't have Vision Assistant. Is there a free download for it?
__________________


2011 Pit Crew:
2011 CT Xerox Creativity Award

HYPER Alumni
  #4   Spotlight this post!  
Unread 19-02-2010, 14:53
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Camera particleToImagePercent not working

its in the labview install (first CD)
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
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
Camera not working... AG-chadd Programming 4 04-02-2009 22:10
Camera Tracking not working? NinJA999 C/C++ 0 25-01-2009 15:28
Camera not working LinuxMercedes Programming 10 13-01-2009 10:18
Camera not working st1nkm4n Programming 7 02-02-2006 08:22
Camera not working st1nkm4n Programming 0 31-01-2006 19:23


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

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