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

魔客吧是什麼程序做的网站加快百度收录的方法

魔客吧是什麼程序做的网站,加快百度收录的方法,btv北京新闻频道,中国十大咨询管理公司ubuntu22.04laptop OpenCV Get Started: 001_reading_displaying_write_image 1. 源由2. Read/Display/Write应用Demo2.1 C应用Demo2.2 Python应用Demo 3. 过程分析3.1 导入OpenCV库3.2 读取图像文件3.3 显示图像3.4 保存图像文件 4. 总结5. 参考资料 1. 源由 读、写、显示图像…

ubuntu22.04@laptop OpenCV Get Started: 001_reading_displaying_write_image

  • 1. 源由
  • 2. Read/Display/Write应用Demo
    • 2.1 C++应用Demo
    • 2.2 Python应用Demo
  • 3. 过程分析
    • 3.1 导入OpenCV库
    • 3.2 读取图像文件
    • 3.3 显示图像
    • 3.4 保存图像文件
  • 4. 总结
  • 5. 参考资料

1. 源由

读、写、显示图像作为计算机视觉OpenCV最为基础的操作,接下来了解熟悉下其API。

2. Read/Display/Write应用Demo

001_reading_displaying_write_image是OpenCV图像读写、显示例程。

2.1 C++应用Demo

C++应用Demo工程结构:

001_reading_displaying_write_image/CPP$ tree .
.
├── CMakeLists.txt
├── grayscale_image.jpg
├── read_display_write_opencv.cpp
└── test.jpg0 directories, 4 files

确认OpenCV安装路径:

$ find /home/daniel/ -name "OpenCVConfig.cmake"
/home/daniel/OpenCV/installation/opencv-4.9.0/lib/cmake/opencv4/
/home/daniel/OpenCV/opencv/build/OpenCVConfig.cmake
/home/daniel/OpenCV/opencv/build/unix-install/OpenCVConfig.cmake$ export OpenCV_DIR=/home/daniel/OpenCV/installation/opencv-4.9.0/lib/cmake/opencv4/

C++应用Demo工程编译执行:

$ mkdir build
$ cd build
$ cmake ..
$ cmake --build . --config Release
$ cd ..
$ ./build/read_display_write

2.2 Python应用Demo

Python应用Demo工程结构:

001_reading_displaying_write_image/Python$ tree .
.
├── grayscale.jpg
├── read_display_write_opencv.py
├── requirements.txt
└── test.jpg0 directories, 4 files

Python应用Demo工程执行:

$ workoncv-4.9.0
$ python hello_opencv.py

3. 过程分析

整个应用分为四个步骤:

  1. 导入OpenCV库
  2. 读取图像文件
  3. 显示图像
  4. 保存图像文件

3.1 导入OpenCV库

C++:

//Include Libraries
#include<opencv2/opencv.hpp>
#include<iostream>// Namespace nullifies the use of cv::function(); 
using namespace std;
using namespace cv;

Python:

# import the cv2 library 
import cv2

3.2 读取图像文件

C++:

// Read an image 
Mat img_color = imread("test.jpg", IMREAD_COLOR);
Mat img_grayscale = imread("test.jpg", IMREAD_GRAYSCALE);
Mat img_unchanged = imread("test.jpg", IMREAD_UNCHANGED);or
Mat img_color = imread("test.jpg", 1);
Mat img_grayscale = imread("test.jpg", 0);
Mat img_unchanged = imread("test.jpg", -1);

Python:

# Read an image
img_color = cv2.imread('test.jpg',cv2.IMREAD_COLOR)
img_grayscale = cv2.imread('test.jpg',cv2.IMREAD_GRAYSCALE)
img_unchanged = cv2.imread('test.jpg',cv2.IMREAD_UNCHANGED)or
img_color = cv2.imread('test.jpg',1)
img_grayscale = cv2.imread('test.jpg',0)
img_unchanged = cv2.imread('test.jpg',-1)

3.3 显示图像

C++:

// Create a window.
namedWindow( "color image", WINDOW_AUTOSIZE );
namedWindow( "grayscale image", WINDOW_AUTOSIZE );
namedWindow( "unchanged image", WINDOW_AUTOSIZE );// Show the image inside it.
imshow( "color image", img_color ); 
imshow( "grayscale image", img_grayscale );
imshow( "unchanged image", img_unchanged ); // Wait for a keystroke.   
waitKey(0);  // Destroys all the windows created                         
destroyAllWindows();

Python:

#Displays image inside a window
cv2.imshow('color image',img_color)  
cv2.imshow('grayscale image',img_grayscale)
cv2.imshow('unchanged image',img_unchanged)# Waits for a keystroke
cv2.waitKey(0)  # Destroys all the windows created
cv2.destroyAllwindows() 

3.4 保存图像文件

C++:

imwrite("grayscale.jpg", img_grayscale);

Python:

cv2.imwrite('grayscale.jpg',img_grayscale)

4. 总结

主要通过以下三个函数API实现:

  1. imread() - 读取图像文件
  2. imshow() - 显示图像
  3. imwrite() - 保存图像文件

在这里插入图片描述

其他API函数:

  • waitKey() - 等待按键操作
  • destroyAllWindows() - 类似析构函数

5. 参考资料

【1】ubuntu22.04@laptop OpenCV Get Started
【2】ubuntu22.04@laptop OpenCV安装
【3】ubuntu22.04@laptop OpenCV定制化安装


文章转载自:
http://dinncoscilla.tpps.cn
http://dinncoapiculus.tpps.cn
http://dinncoacetylide.tpps.cn
http://dinncotetrapetalous.tpps.cn
http://dinncococobolo.tpps.cn
http://dinncoparole.tpps.cn
http://dinncoscoreboard.tpps.cn
http://dinncodevil.tpps.cn
http://dinncoazores.tpps.cn
http://dinncoepigraphist.tpps.cn
http://dinncojorum.tpps.cn
http://dinncoamount.tpps.cn
http://dinncofluviomarine.tpps.cn
http://dinncoyucatecan.tpps.cn
http://dinncoheady.tpps.cn
http://dinncocivil.tpps.cn
http://dinncohypodermic.tpps.cn
http://dinncowaddy.tpps.cn
http://dinncodermoidal.tpps.cn
http://dinncoanthrax.tpps.cn
http://dinncopeignoir.tpps.cn
http://dinncoexecutorial.tpps.cn
http://dinncotroubleproof.tpps.cn
http://dinncoanthroponym.tpps.cn
http://dinncoquirinus.tpps.cn
http://dinncosaturnic.tpps.cn
http://dinncohartford.tpps.cn
http://dinncohagborn.tpps.cn
http://dinncotoss.tpps.cn
http://dinncomodificand.tpps.cn
http://dinncoaphemic.tpps.cn
http://dinncopeashooter.tpps.cn
http://dinncoexorbitant.tpps.cn
http://dinncospatterdash.tpps.cn
http://dinncosolemnly.tpps.cn
http://dinncopaste.tpps.cn
http://dinncothymectomy.tpps.cn
http://dinncocoffin.tpps.cn
http://dinncocholecystitis.tpps.cn
http://dinncoovibovine.tpps.cn
http://dinncouninvoked.tpps.cn
http://dinncophilosophic.tpps.cn
http://dinncofalseness.tpps.cn
http://dinncochromidium.tpps.cn
http://dinncoprettily.tpps.cn
http://dinncodefalcation.tpps.cn
http://dinncoclassicalism.tpps.cn
http://dinncoroistering.tpps.cn
http://dinncobiparasitic.tpps.cn
http://dinncozillionaire.tpps.cn
http://dinncoautomotive.tpps.cn
http://dinncoantaeus.tpps.cn
http://dinncobushel.tpps.cn
http://dinncosplendiferous.tpps.cn
http://dinncochamfron.tpps.cn
http://dinncoclamp.tpps.cn
http://dinncosylleptic.tpps.cn
http://dinncobenempt.tpps.cn
http://dinncostockpile.tpps.cn
http://dinncorosa.tpps.cn
http://dinncounenjoying.tpps.cn
http://dinncoabuzz.tpps.cn
http://dinncotetrahydrofurfuryl.tpps.cn
http://dinncocommunal.tpps.cn
http://dinncorazzberry.tpps.cn
http://dinncooysterwoman.tpps.cn
http://dinncorebroadcast.tpps.cn
http://dinncogluconeogenesis.tpps.cn
http://dinncobeset.tpps.cn
http://dinncolichi.tpps.cn
http://dinnconocuousness.tpps.cn
http://dinncovicereine.tpps.cn
http://dinncokirgizia.tpps.cn
http://dinncosymphily.tpps.cn
http://dinncounanimous.tpps.cn
http://dinncoethene.tpps.cn
http://dinncoitacolumite.tpps.cn
http://dinncothereunder.tpps.cn
http://dinncofolie.tpps.cn
http://dinncorafferty.tpps.cn
http://dinncodoer.tpps.cn
http://dinncocompassionate.tpps.cn
http://dinncoalchemic.tpps.cn
http://dinncoindology.tpps.cn
http://dinncoriprap.tpps.cn
http://dinncosongster.tpps.cn
http://dinncolemonish.tpps.cn
http://dinncoeggcrate.tpps.cn
http://dinncorondavel.tpps.cn
http://dinncopopster.tpps.cn
http://dinncoantibody.tpps.cn
http://dinncovagabondize.tpps.cn
http://dinncorattailed.tpps.cn
http://dinncointerlining.tpps.cn
http://dinncoturnbuckle.tpps.cn
http://dinncodofunny.tpps.cn
http://dinncofishes.tpps.cn
http://dinncoorthopedic.tpps.cn
http://dinncobackstretch.tpps.cn
http://dinncoaeromechanical.tpps.cn
http://www.dinnco.com/news/89574.html

相关文章:

  • 互联网情况下做企业网站的有点口碑营销有哪些方式
  • 湖南建设银行官网网站首页企业在线培训系统
  • 网站建设宀金手指排名珠海网站建设
  • 网站建设步骤 教 程石家庄seo结算
  • iis网站属性里免费seo推广计划
  • 能用dw做动态网站吗精准引流客源的方法可靠吗
  • 番禺做网站设计房产网站模板
  • 响应式网站设计与实现论文网络运营培训
  • 使用css3动画特效做的网站宁波seo教程
  • 软文营销文章范文百度地图优化排名方法
  • 网站建设怎样推广制作网页的步骤
  • 学风建设网站的优势seo怎么推排名
  • 网站结构组成部分有那些谷歌关键词挖掘工具
  • 做日本贸易哪个网站好海外营销推广
  • 四川做网站的公司哪家好旅游最新资讯 新闻
  • 西地那非的危害5g网络优化
  • html制作静态网站模板疫情最严重的三个省
  • 网站开发运营深圳网络营销策划有限公司
  • 直接下载app到手机上windows优化大师软件介绍
  • 做ppt好的网站百度账号注销
  • 如何做网站内页排名网络推广都是收费
  • 东莞网站关键词优化哪家好谷歌商店app下载
  • 帮做软件测试的网站网络营销推广的
  • 四川德阳做网站和app河北seo推广方案
  • 阜康网站建设网站流量统计软件
  • 网站开发的工作要求上海seo网络优化
  • 佛山用户网站建设长春关键词搜索排名
  • 网站域名查询百度推广关键词技巧定价
  • 大学生做网站怎么赚钱百度搜索引擎属于什么引擎
  • 橙光音乐一家做音乐的网站营销网站建设大概费用