View Single Post
  #11   Spotlight this post!  
Unread 07-03-2012, 01:29
Method's Avatar
Method Method is offline
Registered User
no team
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Ca
Posts: 38
Method is an unknown quantity at this point
Re: Camera code stops recieving images

The primary differences between the two files are

Code:
				centerX = reports->at(highParticle).center_mass_x_normalized;
and

Code:
				for (unsigned int i = 0; i < reports->size(); i++)
				{
					if(reports->at(i).center_mass_y > reports->at(highParticle).center_mass_y)
					{
						highParticle = i;
					}
				}
				for (unsigned int i = 0; i < reports->size(); i++)
				{
					if(reports->at(i).center_mass_y < reports->at(lowParticle).center_mass_y)
					{
						lowParticle = i;
					}
				}
Also, your assumption is correct. The working one does not stop while the other, (with the above changes), does after working briefly.

I commented out these lines and the code began to work again.
I also tried to make particle analysis report pointers like in the other file to compare results but that works in a similar fashion with the exception that when the code stops working instead of the CPU usage flat-lining it spikes and does not come down and the code stops as with the other way.

I apologize for any distracting extraneous code or any bugs in the 'working' version. It is a save from when I got the camera to work as I intended (my lesson learned- this being the second time)

Once again, thankyou.
Reply With Quote