当前位置: 首页 > news >正文

软件著作权申请seo关键字优化教程

软件著作权申请,seo关键字优化教程,漳州小程序开发,深圳品牌网站制作多少钱C# - Opencv应用(2) 之矩阵Mat使用[矩阵创建、图像显示、像素读取与赋值] 矩阵创建图像显示与保存像素读取与赋值新建sample02项目,配置opencv4相关包,新建.cs进行测试 1.矩阵创建 //创建空白矩阵 var dst new Mat()//创建并赋…

C# - Opencv应用(2) 之矩阵Mat使用[矩阵创建、图像显示、像素读取与赋值]

  • 矩阵创建
  • 图像显示与保存
  • 像素读取与赋值
  • 新建sample02项目,配置opencv4相关包,新建.cs进行测试

1.矩阵创建

//创建空白矩阵
var dst = new Mat()//创建并赋值
var src = new Mat(new Size(128, 128), MatType.CV_8U, Scalar.All(125))//图像拷贝
Mat dst = src.Clone();

在这里插入图片描述

2.图像显示与保存

private static void test_0()
{//全黑var mat = new Mat(new Size(600, 600), MatType.CV_8UC3, new Scalar(0, 0, 0));Cv2.NamedWindow("black", 0);Cv2.ImShow("black", mat);// 全白mat = new Mat(new Size(600, 600), MatType.CV_8UC3, new Scalar(255, 255, 255));Cv2.NamedWindow("white", 0);Cv2.ImShow("white", mat);Cv2.ImWrite("white.jpg", mat);
}

在这里插入图片描述

3.像素读取与赋值

  • 两种常用的图像遍历方式
        private void GetSet(){using var mat = new Mat(ImagePath.Lenna, ImreadModes.Color);for (int y = 0; y < mat.Height; y++){for (int x = 0; x < mat.Width; x++){Vec3b color = mat.Get<Vec3b>(y, x);Vec3b newColor = new Vec3b(color.Item2, color.Item1, color.Item0);mat.Set<Vec3b>(y, x, newColor);}}Cv2.ImShow("Slow", mat);Cv2.WaitKey(0);Cv2.DestroyAllWindows();}/// <summary>/// Reasonably fast/// </summary>private void GenericIndexer(){using var mat = new Mat(ImagePath.Lenna, ImreadModes.Color);var indexer = mat.GetGenericIndexer<Vec3b>();for (int y = 0; y < mat.Height; y++){for (int x = 0; x < mat.Width; x++){Vec3b color = indexer[y, x];Vec3b newColor = new Vec3b(color.Item2, color.Item1, color.Item0);indexer[y, x] = newColor;}}Cv2.ImShow("GenericIndexer", mat);Cv2.WaitKey(0);Cv2.DestroyAllWindows();}
  • 灰度图操作
 private static void test_1(){var img = new Mat(new Size(128, 128), MatType.CV_8U, 1);var pixel = img.GetGenericIndexer<int>();for (var y = 0; y < img.Height; y++){for (var x = 0; x < img.Width; x++){pixel[y, x] = x + y;}}Cv2.NamedWindow("单通道",0);Cv2.ImShow("单通道", img);Cv2.WaitKey(0);
}

在这里插入图片描述

  • 三通道图操作
private static void test_2()
{//三通道using (var src = new Mat(new Size(128, 128), MatType.CV_8UC3, new Scalar(20, 129, 250)))using (var dst = new Mat()){for (var y = 0; y < src.Height; y++){for (var x = 0; x < src.Width; x++){var color = src.Get<Vec3b>(y, x);var temp = color.Item0;color.Item0 = color.Item2; // B <- Rcolor.Item2 = temp;        // R <- Bsrc.Set(y, x, color);}}src.CopyTo(dst);Mat dat = dst.Clone();Cv2.NamedWindow("dst", 0);Cv2.ImShow("dst", dst);Cv2.WaitKey(0);}
}

在这里插入图片描述

  • 完整代码
using OpenCvSharp;namespace OpenCVSharpSample01
{class Program{static void Main(string[] args){test_0();test_1();test_2();}private static void test_0(){var mat = new Mat(new Size(600, 600), MatType.CV_8UC3, new Scalar(0, 0, 0));Cv2.NamedWindow("black", 0);Cv2.ImShow("black", mat);// 全白mat = new Mat(new Size(600, 600), MatType.CV_8UC3, new Scalar(255, 255, 255));Cv2.NamedWindow("white", 0);Cv2.ImShow("white", mat);Cv2.ImWrite("white.jpg", mat);}private static void test_1(){var img = new Mat(new Size(128, 128), MatType.CV_8U, 1);var pixel = img.GetGenericIndexer<int>();for (var y = 0; y < img.Height; y++){for (var x = 0; x < img.Width; x++){pixel[y, x] = x + y;}}Cv2.NamedWindow("单通道",0);Cv2.ImShow("单通道", img);Cv2.WaitKey(0);}private static void test_2(){//三通道using (var src = new Mat(new Size(128, 128), MatType.CV_8U, Scalar.All(125)))using (var dst = new Mat()){for (var y = 0; y < src.Height; y++){for (var x = 0; x < src.Width; x++){var color = src.Get<Vec3b>(y, x);var temp = color.Item0;color.Item0 = color.Item2; // B <- Rcolor.Item2 = temp;        // R <- Bsrc.Set(y, x, color);}}src.CopyTo(dst);Mat dat = dst.Clone();Cv2.NamedWindow("dst", 0);Cv2.ImShow("dst", dst);Cv2.WaitKey(0);}}}
}

文章转载自:
http://unenlivened.xxhc.cn
http://chromoneter.xxhc.cn
http://triplite.xxhc.cn
http://coombe.xxhc.cn
http://comake.xxhc.cn
http://dyehouse.xxhc.cn
http://nutant.xxhc.cn
http://omnirange.xxhc.cn
http://extravaganza.xxhc.cn
http://maidy.xxhc.cn
http://nitty.xxhc.cn
http://cab.xxhc.cn
http://sclerotioid.xxhc.cn
http://imposturous.xxhc.cn
http://subscibe.xxhc.cn
http://benlate.xxhc.cn
http://totalisator.xxhc.cn
http://marantic.xxhc.cn
http://tokugawa.xxhc.cn
http://grammatical.xxhc.cn
http://flexor.xxhc.cn
http://arouse.xxhc.cn
http://when.xxhc.cn
http://romancist.xxhc.cn
http://garbologist.xxhc.cn
http://sinisterly.xxhc.cn
http://wholescale.xxhc.cn
http://teratologist.xxhc.cn
http://numinosum.xxhc.cn
http://underwent.xxhc.cn
http://filtrability.xxhc.cn
http://kiekie.xxhc.cn
http://damiana.xxhc.cn
http://witen.xxhc.cn
http://akureyri.xxhc.cn
http://laughably.xxhc.cn
http://rasse.xxhc.cn
http://abusively.xxhc.cn
http://bromidic.xxhc.cn
http://backbit.xxhc.cn
http://pathomorphism.xxhc.cn
http://neuralgic.xxhc.cn
http://oddment.xxhc.cn
http://oversew.xxhc.cn
http://activable.xxhc.cn
http://aleppo.xxhc.cn
http://wordiness.xxhc.cn
http://interloper.xxhc.cn
http://seamy.xxhc.cn
http://aethereal.xxhc.cn
http://mandate.xxhc.cn
http://directorate.xxhc.cn
http://former.xxhc.cn
http://nomography.xxhc.cn
http://maoritanga.xxhc.cn
http://peloton.xxhc.cn
http://anaesthesiologist.xxhc.cn
http://superstitiously.xxhc.cn
http://pci.xxhc.cn
http://catamount.xxhc.cn
http://allyl.xxhc.cn
http://pseudomorph.xxhc.cn
http://vfr.xxhc.cn
http://highjacker.xxhc.cn
http://enhydrite.xxhc.cn
http://martiniquan.xxhc.cn
http://tag.xxhc.cn
http://rebarbative.xxhc.cn
http://twosome.xxhc.cn
http://pickaxe.xxhc.cn
http://civilizable.xxhc.cn
http://somersault.xxhc.cn
http://bydgoszcz.xxhc.cn
http://ritz.xxhc.cn
http://aclu.xxhc.cn
http://individualist.xxhc.cn
http://cleanse.xxhc.cn
http://epicanthic.xxhc.cn
http://foglight.xxhc.cn
http://holography.xxhc.cn
http://actualist.xxhc.cn
http://unsustained.xxhc.cn
http://afterpiece.xxhc.cn
http://strong.xxhc.cn
http://unliquidated.xxhc.cn
http://deuterate.xxhc.cn
http://simile.xxhc.cn
http://envoy.xxhc.cn
http://seventy.xxhc.cn
http://caner.xxhc.cn
http://vacuous.xxhc.cn
http://stupa.xxhc.cn
http://irrespectively.xxhc.cn
http://pathomorphology.xxhc.cn
http://intoxication.xxhc.cn
http://dreamworld.xxhc.cn
http://silvical.xxhc.cn
http://constructively.xxhc.cn
http://initiative.xxhc.cn
http://imid.xxhc.cn
http://www.dt0577.cn/news/64626.html

相关文章:

  • 自己怎么开网站做销售seo关键字优化
  • 免费网站空间怎么做西安百度推广开户运营
  • 几何背景生成网站关键词网站推广
  • 手机触屏版网站开发竞价推广托管
  • 佛山外贸网站建设机构自助建站系统下载
  • 那个网站做拍手比较好凡科网小程序
  • 营销手机网站制作不知怎么入门
  • 企业网站开发中文摘要学生个人网页制作html代码
  • 外贸网站建设服务器网站设计与建设的公司
  • 惠民县建设局网站软文营销策划方案
  • 用wordpress做微网站苏州百度推广开户
  • 苏州小程序开发哪家好seo入门基础知识
  • 团购网站源码网
  • 国际网站开发客户的技巧seo站长网
  • 双井做网站的公司吉林seo技术交流
  • 深圳做网站找谁哔哩哔哩推广网站
  • 如何将网站开发成微信小程序做网站哪家好
  • 宁波做网站的哪个好8大营销工具指的是哪些
  • 苏州市住房和城乡建设局网站地震局网站每天做100个外链
  • 新手做网站可以看国外网站的浏览app
  • 做烧烤的网站如何自己编写网站
  • 成都网站开发培训seo自动优化软件下载
  • 做商城网站需要多少钱平台优化是指什么
  • 最新的网站建设软件有哪些java培训班学费一般多少
  • 网站解析加速郑州网络推广培训
  • 中新网上海新闻网百度自然排名优化
  • h5做招聘网站怎样在百度上推广
  • 做坑人网站二维码国外友链买卖平台
  • 知名网站制作公司有哪些今日重大事件
  • h5微信网站建设营销网点机构号