̲Ͳ ² , IJ
ֲ Ͳ «² ˲Ͳ»




, , 15 2011 . 23 2011 . « ..», - 볺.
 - 㳿 ASP.NET , , .
, .
, , . , .
, . OpenCV, - ASP.NET EmguCV. , ᒺ , .
ASP ASP.NET, , 㳺 ASP:
, 䳿
, try ... catch
(controls) ,
, , 䳿

ASP.NET .NET, VB.NET, Delphi.NET, Visual C/C++
񳺿
,
- («code behind»)



master-
ϳ CRUD- GridView
AJAX
ASP.NET , .
㳿 AJAX, (CAPTCHA).
, , . . , AJAX «1», «0».
, JavaScript, . «1», - , . , , , , .
-.
ϳ .NET:
 - - , . , .
Framework - , , . 䳿 , , () , , , , .
Microsoft .NET - .
.NET Framework - Microsoft .NET. : Common Language Runtime (CLR) .NET Framework Class Library (.NET FCL).
CLS (Common Language Specification) - . , .NET Framework. , CLS, - , CLS.
, CLS ( Visual C# 2.0, Visual Basic, Visual C++), . CLS - 䳿 Microsoft .NET.
CLR (Common Language Runtime) - ³ . . .NET Framework. ϳ ³ () , () .
 - , , CLR. ³, 䳺.
, CLR - , . CLR : (mscoree.dll) (mscorlib.dll). - , ', , .NET.
FCL (.NET Framework Class Library) - CLS- '- , (-), Microsoft .NET. .NET-, , .
.NET CLR. .NET FCL .NET-, , :
() , ( .NET );
(Windows Forms);
web- web- 㳿 ASP.NET (Web Forms);
XML Internet- (FTP, HTTP, SMTP, SOAP);
, (ADO .NET) .
.NET- - , Microsoft .NET. , CLS.
MSIL (Microsoft Intermediate Language) - Microsoft .NET. .NET- , CLS. MSIL. , MSIL. CLS, , , IL-.
.NET CLR:

. 2. .NET-.
CLR , . CLR , .
, CLR, :
(JIT) MSIL- .
, .
䳿 .
( , ).
, OpenCV, . , . , :
opencv_core - . , ( , ) . .
opencv_imgproc - (, , . .).
opencv_highgui - UI, / .
opencv_ml - (SVM, , . .).
opencv_features2d - (SURF, FAST , ).
opencv_video - ' ( , , ).
opencv_objdetect - ' ( ³-, HOG . .).
opencv_calib3d - , - .
opencv_flann - (FLANN 1.5) OpenCV.
opencv_contrib - , .
opencv_legacy - , .
opencv_gpu - OpenCV CUDA, NVidia.
OpenCV:
2D 3D



- (Humancomputer interaction (HCI))




:
(Structure from motion (SFM))
Visual Studio. :
namespaceUtils.ImageOperations
{
staticclassFindSimilarImage
{
publicstaticvoid Run()
{
//Image<Gray, Byte> observedImage = new Image<Gray, byte>("test.jpg");
Stopwatch watch;
//create storage
using (MemStorage storage = newMemStorage())
{
//calculate foreground points for mask
var modelImageBmp = Image.FromFile("mask.png");
var foregroundPoints = GetForegroundPoints(modelImageBmp, storage);
DirectoryInfo di = newDirectoryInfo(@"C:\Users\Volodia\Downloads\images-folder");
if (di.Exists)
{
var files = di.GetFiles("*.jpg");
foreach (FileInfo fi in files)
{
var fullName = fi.FullName;
var observedImage = newImage<Gray, byte>(fi.FullName);
observedImage.ROI = newRectangle(0, 0, observedImage.Width, observedImage.Height/6);
//set mode
var enumeration = Emgu.CV.CvEnum.TM_TYPE.CV_TM_CCOEFF_NORMED;
Image<Gray, byte> modelImage = newImage<Gray, byte>((Bitmap) modelImageBmp);
//find template
var matchedImage = observedImage.MatchTemplate(modelImage, enumeration);
//
double[] min, max;
Point[] point1, point2;
matchedImage.MinMax(out min, out max, out point1, out point2);
Point p = newPoint();
Image<Bgr, Byte> result = newImage<Bgr, byte>(fullName);
if (min[0] < -0.01)
{
p.X = point1[0].X-1;
p.Y = point1[0].Y-1;
result.Draw(newRectangle(p, modelImage.Size), newBgr(Color.Red), 2);
var modelContours = modelImage.FindContours();
var observedContours = observedImage.FindContours();
//double ratio = contour.MatchShapes(, );
double ratio = CvInvoke.cvMatchShapes(observedContours, modelContours, Emgu.CV.CvEnum.CONTOURS_MATCH_TYPE.CV_CONTOURS_MATCH_I3, 0);
var movedPoints = MoveSeqPoints(foregroundPoints, p, storage);
foreach (Point foregroundPoint in movedPoints)
{
result.Draw(newRectangle(foregroundPoint, newSize(1,1)), newBgr(Color.YellowGreen), 1);
}
}
if (max[0] > 0.01)
{
p.X = point2[0].X;
p.Y = point2[0].Y;
result.Draw(newRectangle(p, modelImage.Size), newBgr(Color.Plum), 2);
}
result.Save(string.Format(@"C:\Users\Volodia\Desktop\ready\{0}", fi.Name));
modelImage.Dispose();
matchedImage.Dispose();
observedImage.Dispose();
result.Dispose();
}
}
//exited from directory, free bitmap
modelImageBmp.Dispose();
}
}
privatestaticSeq<Point> MoveSeqPoints(Seq<Point> foregroundPoints, Point point, MemStorage storage)
{
var fp = newSeq<Point>(storage);
for (int i = 0; i < foregroundPoints.Total; i++)
{
fp.Push(newPoint(foregroundPoints[i].X + point.X, foregroundPoints[i].Y + point.Y));
}
return fp;
}
privatestaticSeq<Point> GetForegroundPoints(Image modelImage, MemStorage storage)
{
FastPixel fp = newFastPixel((Bitmap)modelImage);
fp.Lock();
var points = newSeq<Point>(storage);
if (fp.IsAlphaBitmap)
{
for (int i = 0; i < fp.Width; i++)
{
for (int j = 0; j < fp.Height; j++)
{
///check for the Alpha channel
var a = fp.GetPixelAlphaChannel(i, j);
if (a != 0)
{
points.Push(newPoint(i,j));
}
}
}
}
fp.Unlock(false);
return points;
}
}
.
OpenCVMatchTemplate, , . , Emgu.CV.CvEnum.TM_TYPE.CV_TM_CCOEFF_NORMED, MinMax ( -1 1), 100% .
0.6, , , . , (x,y) .
:
- -.
OpenCV, , , - .