Image recognition API

Hi,

We’re trying to program an Image recognition software and we’re running into a problem as some(most) of the classes used in the Circle Tracker Demo don’t have proper(any) documentation in the WPIlib API. If anyone knows of the documentation of the classes used in the Demo we’d highly appreciate knowing of it.

Many Thanks :slight_smile:

~Kenneth
The Spikes #2212

The classes mirror the NI Vision library. There’s a windows help file for it in the National Instruments folder:

C:\Program Files\National Instruments\Vision\Documentation\NIVisionCVI.chm

Look under imaqDetectEllipses in the index.

Thanks that helped. I’ve got another question though what are the variables m_score,m_rawScore and m_xMax representing?

I haven’t found any documentation about these, but here’s my stab at it based on the sample target code:

m_xMax - the width of the image put into the same units as the height. The one line of documentation in the java Target code talks about dividing everything by the height to get things in the same units.

m_rawScore - the score value sent back by the NIVision code. It appears to be a value between 0 and 1000 describing how “ellipse-like” the ellipse it detected is (with 0 being not at all and 1000 being perfect).

m_score - this is a calculation based on the size of the ellipse and the m_rawScore defined above. Large ellipse and high raw score will lead to a high m_score.

  • It multiplies the major radius and minor radius (so bigger size will result in a bigger value)
  • It divides by (1001 - m_rawScore). A perfect raw score would lead to it being divided by 1, but the less perfect it is, the larger the divisor.
  • It is then divided by the area of the image to make it a percentage of the total image size.

Hope that helps.