本文整理汇总了C#中INyARGrayscaleRaster类的典型用法代码示例。如果您正苦于以下问题:C# INyARGrayscaleRaster类的具体用法?C# INyARGrayscaleRaster怎么用?C# INyARGrayscaleRaster使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
INyARGrayscaleRaster类属于命名空间,在下文中一共展示了INyARGrayscaleRaster类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: doFilter
public override void doFilter(int i_l, int i_t, int i_w, int i_h, int i_th, INyARGrayscaleRaster i_gsraster)
{
Debug.Assert(i_gsraster.isEqualBufferType(NyARBufferType.INT1D_BIN_8));
INyARRgbPixelDriver input = this._raster.getRgbPixelDriver();
int[] output = (int[])i_gsraster.getBuffer();
int th = i_th * 3;
NyARIntSize s = i_gsraster.getSize();
int skip_dst = (s.w - i_w);
int skip_src = skip_dst;
//左上から1行づつ走査していく
int pt_dst = (i_t * s.w + i_l);
int[] rgb = this.__rgb;
for (int y = 0; y <i_h; y++)
{
int x;
for (x = 0; x < i_w; x++)
{
input.getPixel(x + i_l, y + i_t, rgb);
output[pt_dst++] = (rgb[0] + rgb[1] + rgb[2]) <= th ? 0 : 1;
}
//スキップ
pt_dst += skip_dst;
}
return;
}
开发者ID:walidBelfadel,项目名称:MARS_project,代码行数:25,代码来源:INyARRgb2GsFilterArtkTh.cs
示例2: labeling
public override bool labeling(INyARGrayscaleRaster i_raster, int i_th)
{
//配列初期化
this.label_stack.clear();
//ラベルの検出
bool ret = base.labeling(i_raster, i_th);
//ソート
this.label_stack.sortByArea();
return ret;
}
开发者ID:mlakhal,项目名称:CollaborativeAugmentedRealityEnvironment,代码行数:10,代码来源:NyARSquareContourDetector_Rle.cs
示例3: CreateDriver
/**
* この関数は、i_rasterを操作するピクセルドライバインスタンスを生成します。
* @param i_raster
* @return
* @throws NyARException
*/
public static INyARGsRasterGraphics CreateDriver(INyARGrayscaleRaster i_raster)
{
switch (i_raster.getBufferType()) {
case NyARBufferType.INT1D_GRAY_8:
return new NyARGsRasterGraphics_GS_INT8(i_raster);
default:
break;
}
throw new NyARException();
}
开发者ID:ooHIROoo,项目名称:Imagine2016,代码行数:16,代码来源:NyARGsRasterGraphicsFactory.cs
示例4: doFilter
public void doFilter(int[] i_tone_table, INyARGrayscaleRaster i_output)
{
INyARGsPixelDriver outd = i_output.getGsPixelDriver();
INyARGsPixelDriver ind = this._raster.getGsPixelDriver();
NyARIntSize s = this._raster.getSize();
for (int y = s.h - 1; y >= 0; y--)
{
for (int x = s.w - 1; x >= 0; x--)
{
outd.setPixel(x, y, i_tone_table[ind.getPixel(x, y)]);
}
}
}
开发者ID:whztt07,项目名称:NyARToolkitCS,代码行数:13,代码来源:INyARGsCustomToneTableFilter.cs
示例5: copyTo
public void copyTo(int i_left, int i_top, int i_skip, INyARGrayscaleRaster o_output)
{
Debug.Assert(this._raster.getSize().isInnerSize(i_left + o_output.getWidth() * i_skip, i_top + o_output.getHeight() * i_skip));
int[] input = (int[])this._raster.getBuffer();
switch (o_output.getBufferType())
{
case NyARBufferType.INT1D_GRAY_8:
int[] output = (int[])o_output.getBuffer();
NyARIntSize dest_size = o_output.getSize();
NyARIntSize src_size = this._raster.getSize();
int skip_src_y = (src_size.w - dest_size.w * i_skip) + src_size.w * (i_skip - 1);
int pix_count = dest_size.w;
int pix_mod_part = pix_count - (pix_count % 8);
// 左上から1行づつ走査していく
int pt_dst = 0;
int pt_src = (i_top * src_size.w + i_left);
for (int y = dest_size.h - 1; y >= 0; y -= 1)
{
int x;
for (x = pix_count - 1; x >= pix_mod_part; x--)
{
output[pt_dst++] = input[pt_src];
pt_src += i_skip;
}
for (; x >= 0; x -= 8)
{
output[pt_dst++] = input[pt_src];
pt_src += i_skip;
output[pt_dst++] = input[pt_src];
pt_src += i_skip;
output[pt_dst++] = input[pt_src];
pt_src += i_skip;
output[pt_dst++] = input[pt_src];
pt_src += i_skip;
output[pt_dst++] = input[pt_src];
pt_src += i_skip;
output[pt_dst++] = input[pt_src];
pt_src += i_skip;
output[pt_dst++] = input[pt_src];
pt_src += i_skip;
output[pt_dst++] = input[pt_src];
pt_src += i_skip;
}
// スキップ
pt_src += skip_src_y;
}
return;
default:
throw new NyARException();
}
}
开发者ID:saakaifoundry,项目名称:NyARToolkitUnity,代码行数:51,代码来源:NyARGsRasterGraphicsFactory.cs
示例6: createDriver
public static IRasterDriver createDriver(INyARGrayscaleRaster i_ref_raster)
{
switch (i_ref_raster.getBufferType())
{
case NyARBufferType.INT1D_GRAY_8:
case NyARBufferType.INT1D_BIN_8:
return new NyARContourPickup_BIN_GS8(i_ref_raster);
default:
if (i_ref_raster is NyARContourPickup_GsReader)
{
return new NyARContourPickup_GsReader((INyARGrayscaleRaster)i_ref_raster);
}
break;
}
throw new NyARException();
}
开发者ID:whztt07,项目名称:NyARToolkitCS,代码行数:16,代码来源:NyARContourPickup.cs
示例7: doFilter
public override void doFilter(int i_l, int i_t, int i_w, int i_h, int i_th, INyARGrayscaleRaster i_gsraster)
{
Debug.Assert(i_gsraster.isEqualBufferType(NyARBufferType.INT1D_BIN_8));
byte[] input = (byte[])this._raster.getBuffer();
int[] output = (int[])i_gsraster.getBuffer();
int th = i_th * 3;
NyARIntSize s = this._raster.getSize();
int skip_dst = (s.w - i_w);
int skip_src = skip_dst * 3;
int pix_count = i_w;
int pix_mod_part = pix_count - (pix_count % 8);
//左上から1行づつ走査していく
int pt_dst = (i_t * s.w + i_l);
int pt_src = pt_dst * 3;
for (int y = i_h - 1; y >= 0; y -= 1)
{
int x;
for (x = pix_count - 1; x >= pix_mod_part; x--)
{
output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) <= th ? 0 : 1;
pt_src += 3;
}
for (; x >= 0; x -= 8)
{
output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) <= th ? 0 : 1;
pt_src += 3;
output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) <= th ? 0 : 1;
pt_src += 3;
output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) <= th ? 0 : 1;
pt_src += 3;
output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) <= th ? 0 : 1;
pt_src += 3;
output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) <= th ? 0 : 1;
pt_src += 3;
output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) <= th ? 0 : 1;
pt_src += 3;
output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) <= th ? 0 : 1;
pt_src += 3;
output[pt_dst++] = ((input[pt_src + 0] & 0xff) + (input[pt_src + 1] & 0xff) + (input[pt_src + 2] & 0xff)) <= th ? 0 : 1;
pt_src += 3;
}
//スキップ
pt_src += skip_src;
pt_dst += skip_dst;
}
return;
}
开发者ID:mlakhal,项目名称:CollaborativeAugmentedRealityEnvironment,代码行数:47,代码来源:INyARRgb2GsFilterArtkTh.cs
示例8: createInstance
public static INyARHistogramFromRaster createInstance(INyARGrayscaleRaster i_raster)
{
switch(i_raster.getBufferType()){
case NyARBufferType.INT1D_GRAY_8:
case NyARBufferType.INT1D_BIN_8:
return new NyARHistogramFromRaster_INTGS8(i_raster);
default:
if(i_raster is INyARGrayscaleRaster){
return new NyARHistogramFromRaster_AnyGs((INyARGrayscaleRaster)i_raster);
}
if (i_raster is INyARRgbRaster)
{
return new NyARHistogramFromRaster_AnyRgb((INyARRgbRaster)i_raster);
}
break;
}
throw new NyARException();
}
开发者ID:whztt07,项目名称:NyARToolkitCS,代码行数:18,代码来源:NyARHistogramFromRasterFactory.cs
示例9: doFilter
public void doFilter(int i_hist_interval, INyARGrayscaleRaster i_output)
{
//ヒストグラムを得る
NyARHistogram hist = this._histogram;
this._histdrv.createHistogram(i_hist_interval, hist);
//変換テーブルを作成
int hist_total = this._histogram.total_of_data;
int min = hist.getMinData();
int hist_size = this._histogram.length;
int sum = 0;
for (int i = 0; i < hist_size; i++)
{
sum += hist.data[i];
this._hist[i] = (int)((sum - min) * (hist_size - 1) / ((hist_total - min)));
}
//変換
this._tone_table.doFilter(this._hist, i_output);
return;
}
开发者ID:whztt07,项目名称:NyARToolkitCS,代码行数:19,代码来源:INyARGsEqualizeHistFilter.cs
示例10: createDriver
/**
* ラスタから画素ドライバを構築します。構築したラスタドライバには、i_ref_rasterをセットします。
* @param i_ref_raster
* @return
* @
*/
public static INyARGsPixelDriver createDriver(INyARGrayscaleRaster i_ref_raster)
{
INyARGsPixelDriver ret;
switch (i_ref_raster.getBufferType())
{
case NyARBufferType.INT1D_GRAY_8:
case NyARBufferType.INT1D_BIN_8:
ret = new NyARGsPixelDriver_INT1D_GRAY_8();
break;
default:
//RGBRasterインタフェイスがある場合
if (i_ref_raster is INyARRgbRaster)
{
ret = new NyARGsPixelDriver_RGBX((INyARRgbRaster)i_ref_raster);
break;
}
throw new NyARException();
}
ret.switchRaster(i_ref_raster);
return ret;
}
开发者ID:ooHIROoo,项目名称:Imagine2016,代码行数:27,代码来源:NyARGsPixelDriverFactory.cs
示例11: sigmoid
public void sigmoid(int i_x, int i_y, double i_gain, INyARGrayscaleRaster i_output)
{
for (int i = 0; i < 256; i++)
{
int v = 255 * (int)(1 / (1 + Math.Exp(i_gain * (i - i_x))) - 0.5) + i_y;
this._table[i] = v < 0 ? 0 : v > 255 ? 255 : v;
}
this._tone_filter.doFilter(this._table, i_output);
}
开发者ID:walidBelfadel,项目名称:MARS_project,代码行数:9,代码来源:INyARGsToneTableFilter.cs
示例12: line
public void line(double i_a, INyARGrayscaleRaster i_output)
{
this.line(0, 0, i_a, i_output);
}
开发者ID:walidBelfadel,项目名称:MARS_project,代码行数:4,代码来源:INyARGsToneTableFilter.cs
示例13: convert
public void convert(INyARGrayscaleRaster i_raster)
{
NyARIntSize s = this._ref_raster.getSize();
this.convertRect(0, 0, s.w, s.h, i_raster);
}
开发者ID:walidBelfadel,项目名称:MARS_project,代码行数:5,代码来源:NyARBitmapRaster.cs
示例14: doFilter
public void doFilter(int i_h, INyARGrayscaleRaster i_gsraster)
{
NyARIntSize s = this._raster.getSize();
this.doFilter(0, 0, s.w, s.h, i_h, i_gsraster);
}
开发者ID:walidBelfadel,项目名称:MARS_project,代码行数:5,代码来源:NyARBitmapRaster.cs
示例15: NyARContourPickup_GsReader
public NyARContourPickup_GsReader(INyARGrayscaleRaster i_ref_raster)
{
this._ref_raster = i_ref_raster;
}
开发者ID:walidBelfadel,项目名称:MARS_project,代码行数:4,代码来源:NyARContourPickup.cs
示例16: doFilter
public void doFilter(INyARGrayscaleRaster i_output)
{
Debug.Assert(i_output.isEqualBufferType(NyARBufferType.INT1D_GRAY_8));
NyARIntSize size = this._raster.getSize();
int[] in_ptr = (int[])this._raster.getBuffer();
switch (this._raster.getBufferType())
{
case NyARBufferType.INT1D_GRAY_8:
int[] out_ptr = (int[])i_output.getBuffer();
int width = size.w;
int idx = 0;
int idx2 = width;
int fx, fy;
int mod_p = (width - 2) - (width - 2) % 8;
for (int y = size.h - 2; y >= 0; y--)
{
int p00 = in_ptr[idx++];
int p10 = in_ptr[idx2++];
int p01, p11;
int x = width - 2;
for (; x >= mod_p; x--)
{
p01 = in_ptr[idx++]; p11 = in_ptr[idx2++];
fx = p11 - p00; fy = p10 - p01;
out_ptr[idx - 2] = ((fx < 0 ? -fx : fx) + (fy < 0 ? -fy : fy)) >> 1;
p00 = p01;
p10 = p11;
}
for (; x >= 0; x -= 4)
{
p01 = in_ptr[idx++]; p11 = in_ptr[idx2++];
fx = p11 - p00;
fy = p10 - p01;
out_ptr[idx - 2] = ((fx < 0 ? -fx : fx) + (fy < 0 ? -fy : fy)) >> 1;
p00 = p01; p10 = p11;
p01 = in_ptr[idx++]; p11 = in_ptr[idx2++];
fx = p11 - p00;
fy = p10 - p01;
out_ptr[idx - 2] = ((fx < 0 ? -fx : fx) + (fy < 0 ? -fy : fy)) >> 1;
p00 = p01; p10 = p11;
p01 = in_ptr[idx++]; p11 = in_ptr[idx2++];
fx = p11 - p00;
fy = p10 - p01;
out_ptr[idx - 2] = ((fx < 0 ? -fx : fx) + (fy < 0 ? -fy : fy)) >> 1;
p00 = p01; p10 = p11;
p01 = in_ptr[idx++]; p11 = in_ptr[idx2++];
fx = p11 - p00;
fy = p10 - p01;
out_ptr[idx - 2] = ((fx < 0 ? -fx : fx) + (fy < 0 ? -fy : fy)) >> 1;
p00 = p01; p10 = p11;
}
out_ptr[idx - 1] = 0;
}
for (int x = width - 1; x >= 0; x--)
{
out_ptr[idx++] = 0;
}
return;
default:
//ANY未対応
throw new NyARException();
}
}
开发者ID:walidBelfadel,项目名称:MARS_project,代码行数:67,代码来源:INyARGsRobertsFilter.cs
示例17: init
/**
* Initialize call back handler.
*/
public void init(INyARGrayscaleRaster i_raster, INyIdMarkerData i_prev_data)
{
this.marker_data = null;
this._prev_data = i_prev_data;
this._ref_raster = i_raster;
}
开发者ID:whztt07,项目名称:NyARToolkitCS,代码行数:9,代码来源:SingleNyIdMarkerProcesser.cs
示例18: NyARGsRobertsFilter_GS8
public NyARGsRobertsFilter_GS8(INyARGrayscaleRaster i_raster)
{
this._raster = i_raster;
}
开发者ID:walidBelfadel,项目名称:MARS_project,代码行数:4,代码来源:INyARGsRobertsFilter.cs
示例19: NyARHistogramFromRaster_AnyGs
public NyARHistogramFromRaster_AnyGs(INyARGrayscaleRaster i_raster)
{
this._gsr = i_raster;
}
开发者ID:whztt07,项目名称:NyARToolkitCS,代码行数:4,代码来源:NyARHistogramFromRasterFactory.cs
示例20: getContour
/**
* この関数は、ラスタの指定点を基点に、画像の特定の範囲内から輪郭線を抽出します。
* 開始点は、輪郭の一部である必要があります。
* 通常は、ラべリングの結果の上辺クリップとX軸エントリポイントを開始点として入力します。
* @param i_raster
* 輪郭線を抽出するラスタを指定します。
* @param i_area
* 輪郭線の抽出範囲を指定する矩形。i_rasterのサイズ内である必要があります。
* @param i_th
* 輪郭とみなす暗点の敷居値を指定します。
* @param i_entry_x
* 輪郭抽出の開始点です。
* @param i_entry_y
* 輪郭抽出の開始点です。
* @param o_coord
* 輪郭点を格納するオブジェクトを指定します。
* @return
* 輪郭線がo_coordの長さを超えた場合、falseを返します。
* @
*/
public bool getContour(INyARGrayscaleRaster i_raster, NyARIntRect i_area, int i_th, int i_entry_x, int i_entry_y, NyARIntCoordinates o_coord)
{
//ラスタドライバの切り替え
if (i_raster != this._ref_last_input_raster)
{
this._imdriver = (IRasterDriver)i_raster.createInterface(typeof(IRasterDriver));
this._ref_last_input_raster = i_raster;
}
return this._imdriver.getContour(i_area.x, i_area.y, i_area.x + i_area.w - 1, i_area.h + i_area.y - 1, i_entry_x, i_entry_y, i_th, o_coord);
}
开发者ID:walidBelfadel,项目名称:MARS_project,代码行数:30,代码来源:NyARContourPickup.cs
注:本文中的INyARGrayscaleRaster类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论