public void SymbolExtraction()
{
try
{
List<Bitmap> imgfnp_list = new List<Bitmap>();
List<Bitmap> imgfnn_list = new List<Bitmap>();
Image<Bgr, Byte> srcImage = new Image<Bgr, byte>(_rasterInfo.ratserImgPath);
//sourceImageDir = CreateDirectory(parentInfo.FullName, "Data");
////////////////////Geo Spatial PRoject Sima//////////////////////
fillSymbolList(imgfnp_list, srcImage);
Image<Gray, Byte> gElement = null;
HashSet<float[]> hash = symbolRecognition(out gElement, _rasterInfo.rasterData);
coordinatePoints = new CoordinatePoint[hash.Count];
pointSet = new Points[hash.Count];
//....................................................................
int j = 0;
foreach (float[] i in hash)
{
double lng, lat, x, y;
int neg = 1;
if (i[1] > 0 && _rasterInfo.ratserNegative < 0)
neg = _rasterInfo.ratserNegative;
pointSet[j] = new Points();
pointSet[j].leftTopX = i[0];
pointSet[j].leftTopY = i[1] * neg;
pointSet[j].rightTopX = i[0] + gElement.Size.Width;
pointSet[j].rightTopY = i[1] * neg;
pointSet[j].leftDownX = i[0];
pointSet[j].leftDownY = (i[1] + gElement.Size.Height) * neg;
pointSet[j].rightDownX = i[0] + gElement.Size.Width;
pointSet[j].rightDownY = (i[1] + gElement.Size.Height) * neg;
if (_rasterInfo.rasterType != "Unknown")
{
x = i[0] + gElement.Size.Width / 2;
y = i[1] + gElement.Size.Height / 2;
getLngLat(x, y, out lng, out lat);
coordinatePoints[j] = new CoordinatePoint();
coordinatePoints[j].lng = lng;
coordinatePoints[j].lat = lat;
}
j++;
}
#region Geo-Spatial Project- Connection to DBpredia
if (_rasterInfo.rasterType != "Unknown")
{
bindURI();
int num = 0;
foreach (CoordinatePoint pn in coordinatePoints)
{
pointSet[num].URI = pn.URI;
num++;
}
}
#endregion
}
catch (Exception e)
{
Log.WriteLine("textLayerExtract: " + e.Message);
}
}