Ours is a brand-new world of allatonceness. 'Time' has ceased,
'space' has vanished. We now live in a global village ... a
simultaneous happening. ... Electric circuitry profoundly
involves men with one another. Information pours upon us,
instantaneously and continuously. As soon as information is
acquired, it is very rapidly replaced by still newer
information. Our electrically-configured world has forced us
to move from the habit of data classification to the mode of
pattern recognition. We can no longer build serially, block-by-
block, step-by-step, because instant communication insures that
all factors of the environment and of experience co-exist in a
state of active interplay.
The past went that-a-way. When faced with a totally new
situation, we tend always to attach ourselves to the objects,
to the flavor the most recent past. We look at the present
through a rear-view mirror. We march backwards into the future.
Suburbia lives imaginatively in Bonanza-land.
In the name of 'progress', our official culture is striving to
force the new media to do the work of the old.

---Marshall McLuhan      
	
	for ( i = 0; i<=m_FragmentList.GetUpperBound(); i++)
	{
		Mergeable	= FALSE;
		pFragment	= m_FragmentList[i];
		xpos		= pFragment->GetXPosition();
		ypos		= pFragment->GetYPosition();
		size		= pFragment->GetSize();

		if( (xpos + 2 * size ) <= m_SourceWidth )
		{
			if( (ypos + 2 * size ) <= m_SourceHeight )
			{
				//Indizes der Nachbarn ermitteln
				indexB = (int)m_pDestData[ ypos * m_SourceWidth + xpos + size + m_PosOfResultGrow * m_SourceSize];
				indexC = (int)m_pDestData[ ( size + ypos ) * m_SourceWidth + xpos  + m_PosOfResultGrow * m_SourceSize];
				indexD = (int)m_pDestData[ ( size + ypos ) * m_SourceWidth + xpos + size  + m_PosOfResultGrow * m_SourceSize];

				// Haben die Nachbarn die gleiche Größe und sind nicht versetzt ?
				pFragment = m_FragmentList[ indexB ];
				if ( pFragment -> GetSize() == size )
				{
					if ( pFragment -> GetYPosition() == ypos )
					{
						pFragment = m_FragmentList[ indexC ];
						if ( pFragment -> GetSize() == size )
						{
							if ( pFragment -> GetXPosition() == xpos )
							{
								pFragment = m_FragmentList[ indexD ];
								if ( pFragment -> GetSize() == size )
								{
									Mergeable = TRUE;
								}
							}
						}
	
	
	
	float Std		= 0.0f;
	float Mean		= 0.0f;
	int   size		= 0;

	CRegionGrowArea* pFragmentA;
	CRegionGrowArea* pFragmentB;
	CRegionGrowArea* pFragmentC;
	CRegionGrowArea* pFragmentD;

	pFragmentA = m_FragmentList[RegionA];
	pFragmentB = m_FragmentList[RegionB];
	pFragmentC = m_FragmentList[RegionC];
	pFragmentD = m_FragmentList[RegionD];

	// Mittelwert der vergrößerten Area
	size =  pFragmentA -> GetSize();
	size = 4 * size * size;
	Mean =  pFragmentA -> GetSum( m_pSourceData, m_SourceMemWidth );
	Mean += pFragmentB -> GetSum( m_pSourceData, m_SourceMemWidth );
	Mean += pFragmentC -> GetSum( m_pSourceData, m_SourceMemWidth );
	Mean += pFragmentD -> GetSum( m_pSourceData, m_SourceMemWidth );
	Mean /= size;
	// Varianz der vergrößerten Area
	Std	=  pFragmentA -> CalcSquaredSum( m_pSourceData, m_SourceMemWidth, Mean );
	Std	+= pFragmentB -> CalcSquaredSum( m_pSourceData, m_SourceMemWidth, Mean );
	Std	+= pFragmentC -> CalcSquaredSum( m_pSourceData, m_SourceMemWidth, Mean );
	Std	+= pFragmentD -> CalcSquaredSum( m_pSourceData, m_SourceMemWidth, Mean );
	Std	= (float)( Std / size );
	return (float)( sqrt( Std ) );
	
	
	
	if ( xpos + size < m_SourceWidth ) // Sonst keine rechten Nachbarn
	{
		altindex = (int)m_pDestData[ ypos * m_SourceWidth + xpos + size  + m_PosOfResultGrow * m_SourceSize];
		m_NeighbourList.Add( altindex );

		for ( y = ypos + 1; y <= ypos + size - 1; y++ )
		{
			index = (int)m_pDestData[ y * m_SourceWidth + xpos + size  + m_PosOfResultGrow * m_SourceSize];
			if ( index != altindex )
			{
				m_NeighbourList.Add( index );
				altindex = index;
			}
		}
	}

	if ( ypos + size < m_SourceHeight ) // Sonst keine unterer Nachbarn
	{
		altindex = (int)m_pDestData[ ( ypos + size ) * m_SourceWidth + xpos  + m_PosOfResultGrow * m_SourceSize];
		m_NeighbourList.Add( altindex );

		for ( x = xpos + 1; x <= xpos + size - 1; x++ )
		{
			index = (int)m_pDestData[ ( ypos + size ) * m_SourceWidth + x + m_PosOfResultGrow * m_SourceSize ];
			if ( index != altindex )
			{
				m_NeighbourList.Add( index );
				altindex = index;
			}
		}
	}
	
	
	
	int i					= 0;
	int j					= 0;
	int l					= 0;
	int x					= 0;
	int y					= 0;
	int xpos				= 0;
	int ypos				= 0;
	int size				= 0;
	int index				= 0;
	int altindex			= 0;
	int MembershipCounter	= 0;
	float RegionSum			= 0.0f;
	float Meanvalue			= 0.0f;
	int Regionsize			= 0;
	float RegionSumBuf		= 0.0f;
	float VarianzBuf		= 0.0f;
	float mean				= 0.0f;
	int	RegionsizeBuf		= 0;
	int SquaredSize			= 0;
	float RegionMean		= 0.0f;
	float DeltaMean			= 0.0f;
	int RegionEnd			= 0;
	int NeighbourIndex		= 0;
	int StartOld			= 0;
	BOOLEAN Exit			= FALSE;
	CRegionGrowArea* pFragment;
	int EndofList			= 0;
	int MaxGray				= m_PropertyMaxGray;
	int MinSize				= m_PropertyMinSize;
	int MaximumRange		= m_PropertyMaxRange;
	int Groupgrenze			= m_PropertyThreshold;
	int	membership			= 0;
	float RegionColor		= 0.0f;
	int	NumberOfFragments	= 0;
	int Base				= 0;
	int cogx				= 0;
	int cogy				= 0;
	int count				= 0;
	BOOLEAN RadiusEnde		= FALSE;
	float m					= 0.0f;
	float pi				= 3.141592f;
	float xk				= 0.0f;
	float yk				= 0.0f;
	int Masksize			= m_PropertyFilterSize;
	int ConvSumme			= 0;
	int Distarray[120];
	int LongDistarray[140];
	int Resultarray[140];
	int FilteredX[121];
	int FilteredY[121];