protected boolean hypothesisFusion( boolean trackingWorked , boolean detectionWorked ) {

		valid = false;

		boolean uniqueDetection = detectionWorked && !detection.isAmbiguous();
		TldRegion detectedRegion = detection.getBest();

		double confidenceTarget;

		if( trackingWorked ) {

			// get the scores from tracking and detection
			double scoreTrack = template.computeConfidence(trackerRegion_I32);
			double scoreDetected = 0;

			if( uniqueDetection ) {
				scoreDetected = detectedRegion.confidence;
			}

			double adjustment = strongMatch ? 0.07 : 0.02;

			if( uniqueDetection && scoreDetected > scoreTrack + adjustment ) {
				// if there is a unique detection and it has higher confidence than the
				// track region, use the detected region
				TldHelperFunctions.convertRegion(detectedRegion.rect, targetRegion);
				confidenceTarget = detectedRegion.confidence;

				// if it's far away from the current track, re-evaluate if it's a strongMatch
				checkNewTrackStrong(scoreDetected);

			} else {
				// Otherwise use the tracker region
				targetRegion.set(trackerRegion);
				confidenceTarget = scoreTrack;

				strongMatch |= confidenceTarget > config.confidenceThresholdStrong;

				// see if the most likely detected region overlaps the track region
				if( strongMatch && confidenceTarget >= config.confidenceThresholdLower )  {
					valid = true;
				}
			}
		} else if( uniqueDetection ) {
			// just go with the best detected region
			detectedRegion = detection.getBest();
			TldHelperFunctions.convertRegion(detectedRegion.rect, targetRegion);
			confidenceTarget = detectedRegion.confidence;
			strongMatch = confidenceTarget > config.confidenceThresholdStrong;
		} else {
			return false;
		}

		return confidenceTarget >= config.confidenceAccept;
	}
protected boolean hypothesisFusion ( boolean trackingWorked , boolean detectionWorked ) { valid = false ; boolean uniqueDetection = detectionWorked && ! detection . isAmbiguous ( ) ; TldRegion detectedRegion = detection . getBest ( ) ; double confidenceTarget ; if ( trackingWorked ) { double scoreTrack = template . computeConfidence ( trackerRegion_I32 ) ; double scoreDetected = 0 ; if ( uniqueDetection ) { scoreDetected = detectedRegion . confidence ; } double adjustment = strongMatch ? 0.07 : 0.02 ; if ( uniqueDetection && scoreDetected > scoreTrack + adjustment ) { TldHelperFunctions . convertRegion ( detectedRegion . rect , targetRegion ) ; confidenceTarget = detectedRegion . confidence ; checkNewTrackStrong ( scoreDetected ) ; } else { targetRegion . set ( trackerRegion ) ; confidenceTarget = scoreTrack ; strongMatch |= confidenceTarget > config . confidenceThresholdStrong ; if ( strongMatch && confidenceTarget >= config . confidenceThresholdLower ) { valid = true ; } } } else if ( uniqueDetection ) { detectedRegion = detection . getBest ( ) ; TldHelperFunctions . convertRegion ( detectedRegion . rect , targetRegion ) ; confidenceTarget = detectedRegion . confidence ; strongMatch = confidenceTarget > config . confidenceThresholdStrong ; } else { return false ; } return confidenceTarget >= config . confidenceAccept ; }
Combines hypotheses from tracking and detection.

@param trackingWorked If the sequential tracker updated the track region successfully or not
@return true a hypothesis was found, false if it failed to find a hypothesis