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

最专业的网站开发公司哪家最专业php网站怎么做301跳转

最专业的网站开发公司哪家最专业,php网站怎么做301跳转,网站怎么建立视频,python 网站开发 环境目录 1、创建图像 1.1实例1-创建黑色图像 1.2实例2-创建白色图像 1.3实例3-创建随机像素的雪花点图像 2、图像拼接 2.1水平拼接图像 2.2垂直拼接图像 2.3实例4-垂直和水平两种方式拼接两张图像 在OpenCV中#xff0c;黑白图像其实就是一个二维数组#xff0c;彩色图像…目录 1、创建图像 1.1实例1-创建黑色图像 1.2实例2-创建白色图像 1.3实例3-创建随机像素的雪花点图像 2、图像拼接 2.1水平拼接图像 2.2垂直拼接图像 2.3实例4-垂直和水平两种方式拼接两张图像 在OpenCV中黑白图像其实就是一个二维数组彩色图像就是一个三位数组。数组中的每个元素就是图像中对应位置的像素值。 1、创建图像 在黑白图像中像素值为0表示纯黑色像素值为255表示纯白色 1.1实例1-创建黑色图像 创建一个100行、200列即宽200、高100的黑色图像代码如下 int width 200; int height 100; Mat img Mat.Zeros(height, width, MatType.CV_8UC1); Cv2.ImShow(img, img); Cv2.WaitKey(); Cv2.DestroyAllWindows(); 效果 方式二效果同上代码如下 int width 200; int height 100; int[] array new int[200 * 100]; Mat img new Mat(height, width, MatType.CV_8UC1, array); Cv2.ImShow(img, img); Cv2.WaitKey(); Cv2.DestroyAllWindows(); 1.2实例2-创建白色图像 创建白色图像有多种方式 第一种利用Mat构造函数直接创建 第二种利用Mat.Ones方法创建一个像素值为1的图像然后将图像中所有像素值乘以255 第三种创建一个所有值都为255的数组利用数组创建图像 第四种利用SetTo方法 第一种代码如下 int width 200; int height 100; Mat img new Mat(new Size(width, height), MatType.CV_8UC1, Scalar.White); Cv2.ImShow(img, img); Cv2.WaitKey(); Cv2.DestroyAllWindows(); 第二种代码如下 int width 200; int height 100; Mat img Mat.Ones(height, width, MatType.CV_8UC1) * 255; Cv2.ImShow(img, img); Cv2.WaitKey(); Cv2.DestroyAllWindows(); 第三种代码如下 int width 200; int height 100; byte[] array new byte[width* height]; // 定义了长度为width* height的数组 for (int i 0; i array.Length; i) {     array[i] 255; // 将每个元素赋值为255 } Mat img new Mat(height, width, MatType.CV_8UC1, array); Cv2.ImShow(img, img); Cv2.WaitKey(); Cv2.DestroyAllWindows(); 第四种代码如下 int width 200; int height 100; Mat img new Mat(new Size(width, height), MatType.CV_8UC1); img.SetTo(new Scalar(255, 255, 255)); // 将背景设置为白色 Cv2.ImShow(img, img); Cv2.WaitKey(); Cv2.DestroyAllWindows(); 效果 1.3实例3-创建随机像素的雪花点图像 代码如下 int width 200; int height 100; Mat img new Mat(height, width, MatType.CV_8UC1); Random random new Random(); for (int i 0; i height; i) {     for (int j 0; j width; j)     {         byte blue (byte)(random.NextDouble() * 256);         byte green (byte)(random.NextDouble() * 256);         byte red (byte)(random.NextDouble() * 256);         Vec3b color new Vec3b((byte)blue, (byte)green, (byte)red);         img.AtVec3b(i, j) color;     } } Cv2.ImShow(img, img); Cv2.WaitKey(); Cv2.DestroyAllWindows();  效果 改变一行代码创建彩色的随机图像代码如下 int width 200; int height 100; Mat img new Mat(height, width, MatType.CV_8UC3); Random random new Random(); for (int i 0; i height; i) {     for (int j 0; j width; j)     {         byte blue (byte)(random.NextDouble() * 256);         byte green (byte)(random.NextDouble() * 256);         byte red (byte)(random.NextDouble() * 256);         Vec3b color new Vec3b((byte)blue, (byte)green, (byte)red);         img.AtVec3b(i, j) color;     } } Cv2.ImShow(img, img); Cv2.WaitKey(); Cv2.DestroyAllWindows();  效果 2、图像拼接 OpenCvSharp中提供Cv2.HConcat、Cv2.VConcat方法实现图像拼接。 2.1水平拼接图像 Cv2.HConcat方法可以对图像进行水平拼接或者叫横向拼接其函数如下 public static void HConcat(IEnumerableMat src, OutputArray dst) 说明 摘要:     Applies horizontal concatenation to given matrices. 参数:   src:     input array or vector of matrices. all of the matrices must have the same number     of rows and the same depth. dst:     output array. It has the same number of rows and depth as the src, and the sum     of cols of the src. 2.2垂直拼接图像 Cv2.VConcat可以对图像进行垂直拼接或者叫纵向拼接其函数如下 public static void VConcat(IEnumerableMat src, OutputArray dst) 说明 摘要:     Applies vertical concatenation to given matrices. 参数:   src:     input array or vector of matrices. all of the matrices must have the same number     of cols and the same depth. dst:     output array. It has the same number of cols and depth as the src, and the sum     of rows of the src. 2.3实例4-垂直和水平两种方式拼接两张图像 代码如下 Mat mat Cv2.ImRead(test01.jpg); Cv2.ImShow(src, mat); Mat dst new Mat(); Cv2.VConcat(new Mat[] { mat, mat }, dst); Cv2.ImShow(img_v, dst); Cv2.HConcat(new Mat[] { mat, mat }, dst); Cv2.ImShow(img_h, dst); Cv2.WaitKey(); Cv2.DestroyAllWindows(); 效果
http://www.pierceye.com/news/194387/

相关文章:

  • 西城企业网站建设深圳设计网站多少钱
  • 电子商务网站建设a卷网站建设厘金手指排名二一
  • 网站空间便宜网站的信息管理建设的必要性
  • 校级特色专业建设网站博达站群网站建设教程
  • 有没有做任务的网站吗网站首页开发
  • 公司名字变了网站备案济南网站建设公司哪个好点呢
  • 图书馆网站建设的规章制度企业免费招聘网站
  • 效果图网站大全系统优化的例子
  • 京东的网站建设介绍网站开发要源码多少钱
  • 东莞网站制作公司报价企业定制
  • 创同盟做网站生成拼贴的网站
  • 网站备案号查电话号码商场网站开发
  • 手机网站建站教育模板下载泰州公司注册
  • 如何做商业网站推广西安市城乡建设管理局网站的公示栏
  • 上海做兼职哪个网站腾讯企业邮箱域名是什么
  • 霸州网站制作棋牌网站建设源码
  • 茶叶网站制作模板网页设计在安阳工资多少
  • 网站建设项目验收方案自己做捕鱼网站能不能挣钱
  • 微信网页网站怎么做我为群众办实事实践活动
  • 建设银行发卡银行网站福州 网站设计
  • 网站备案号码舟山高端网站建设
  • 买奢侈品代工厂做的产品的网站名建立网站 英语怎么说
  • 网站访问者qq计算机等级培训机构
  • 可以让外国人做问卷调查的网站济南优化seo网站建设公司
  • odoo做网站创建企业需要什么条件
  • 山西省旅游网站建设分析wordpress 个人介绍
  • 山东高级网站建设赚钱
  • 做网站大概要多少钱新建网站的外链多久生效
  • 天河区建设网站品牌网站建设小8蝌蚪
  • 深圳市企业网站seo点击软件小程序游戏开发公司