Home > Back-end >  How to realize the adaptive median filter have been think impassability
How to realize the adaptive median filter have been think impassability

Time:09-23

This is my code of median filtering is to don't understand the adaptive do
Void __fastcall TForm1: : N24Click (TObject * Sender)
{
Screen - & gt; Cursor=crHourGlass;
Byte red [9], green [9], blue [9].
for(int i=1; i{the for (int j=1; j{red [0]=m_RedData [I - 1] [1];
Red [1]=m_RedData [I - 1) [j];
Red [2]=m_RedData [I - 1] [j + 1);
Red [3]=m_RedData [I] [1];
Red [4]=m_RedData [I] [j];
Red [5]=m_RedData [I] [j + 1);
Red [6]=m_RedData [I + 1] [1];
Red [7]=m_RedData [I + 1] [j];
Red [8]=m_RedData [I + 1] [j + 1);

Green [0]=m_GreenData [I - 1) [j];
Green [1]=m_GreenData [I - 1] [1];
Green [2]=m_GreenData [I - 1] [j + 1);
Green [3]=m_GreenData [I] [1];
Green [4]=m_GreenData [I] [j];
Green [5]=m_GreenData [I] [j + 1);
Green [6]=m_GreenData [I + 1] [1];
Green [7]=m_GreenData [I + 1] [j];
Green [8]=m_GreenData [I + 1] [j + 1);

Blue [0]=m_BlueData [I - 1] [1];
Blue [1]=m_BlueData [I - 1) [j];
Blue [2]=m_BlueData [I - 1] [j + 1);
Blue [3]=m_BlueData [I] [1];
Blue [4]=m_BlueData [I] [j];
Blue [5]=m_BlueData [I] [j + 1);
Blue [6]=m_BlueData [I + 1] [1];
Blue [7]=m_BlueData [I + 1] [j];
Blue [8]=m_BlueData [I] [j];

Tree (9, 1 red, Compare);
Tree green, 9, 1, Compare);
Tree (blue, 9, 1, Compare);

M_TempRedData [I] [j]=abs (red [5]);
M_TempGreenData [I] [j]=abs (green) [5].
M_TempBlueData [I] [j]=abs (blue [5]); }}
RGBColor * lpColor;

for(int i=0; i{
LpColor=(RGBColor *) m_pBitmap - & gt; ScanLine [I];

for(int j=0; j{
(lpColor + j) - & gt; Red=m_TempRedData [I] [j];
(lpColor + j) - & gt; Green=m_TempGreenData [I] [j];
(lpColor + j) - & gt; Blue=m_TempBlueData [I] [j];
}
}
Image1 - & gt; Canvas - & gt; The Draw (0, 0, m_pBitmap);
Screen - & gt; Cursor=crDefault;
}

CodePudding user response:

Is to adapt to the amplitude of the size?
  • Related