using System;
using System.Collections;
namespace HalconTools
{
public delegate void StatisticsDelegate(int val);
///
/// This class and its derived classes MatchingOptSpeed and
/// MatchingOptStatistics implement the optimization process for the
/// matching parameters in terms of the recognition speed and the
/// recognition rate. Similar to the processing in HDevelop, a timer
/// is used to be able to abort the processing during a run.
///
public class MatchingOpt
{
///
/// Delegate to notify about the state of the optimization process
///
public StatisticsDelegate NotifyStatisticsObserver;
///
/// Information about the optimization process
/// (e.g. Success or Failure) to be displayed in the GUI
///
public string statusString;
///
/// Statistics for the parameter optimization
///
public string [] recogTabOptimizationData = new string[8];
///
/// Statistics for the recognition rate
///
public string [] inspectTabRecogRateData = new string[5];
///
/// Statistics of detection results for the optimal
/// recognition rate
///
public string [] inspectTabStatisticsData = new string[21];
///
/// Reference to instance of MatchingAssistant,
/// which triggers the optimization performance.
///
public MatchingAssistant mAssistant;
///
/// Result of detection
///
public MatchingResult mResults;
///
/// Set of matching parameters
///
public MatchingParam mParams;
///
/// Number of all test images to be inspected
///
public int tImageCount;
///
/// Index of test image, being inspected currently
///
public int mCurrentIndex;
///
/// Flag, indicating success or failure of optimization process
///
public bool mOptSuccess;
public IEnumerator iterator;
///
/// Constant describing a change in the status line
///
public const int UPDATE_RECOG_STATISTICS_STATUS= 21;
///
/// Constant describing a change in the statistics of
/// the last recognition run
///
public const int UPDATE_RECOG_UPDATE_VALS = 22;
///
/// Constant describing a change in the statistics of
/// the optimal recognition run
///
public const int UPDATE_RECOG_OPTIMUM_VALS = 23;
///
/// Constant describing an error during the optimization
/// run, concerning the test image data or matching model
///
public const int UPDATE_TEST_ERR = 24;
///
/// Constant describing an error, which says that there is
/// no possible combination of matching parameters to obtain
/// a detection result
///
public const int UPDATE_RECOG_ERR = 25;
///
/// Constant describing a change in the statistics of
/// the recognition rate
///
public const int UPDATE_INSP_RECOGRATE = 26;
///
/// Constant describing a change in the statics of
/// the average recognition results
///
public const int UPDATE_INSP_STATISTICS = 27;
///
/// Constant describing an update of the
/// detection results
///
public const int UPDATE_TESTVIEW = 28;
///
/// Constant describing the success of the optimization
/// process and triggering the adjustment of the GUI
/// components to the optimal parameter setting
///
public const int RUN_SUCCESSFUL = 29;
///
/// Constant describing the failure of the optimization
/// process and reseting the matching parameters to the
/// initial setup
///
public const int RUN_FAILED = 30;
///
/// Constructor
///
public MatchingOpt(){}
///
/// Performs an optimization step.
///
public virtual bool ExecuteStep(){ return true; }
///
/// Resets all parameters for evaluating the performance to their initial values.
///
public virtual void reset(){}
///
///
///
public virtual void stop(){}
public void dummy(int val) { }
}//class
}//end of namespace