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

网站短信接口怎么做it培训机构怎么样

网站短信接口怎么做,it培训机构怎么样,注册表怎么做动态网站,网站公安报备Java 调用 OpenCV 一.OpenCV 下载和安装二.创建 Java Maven 项目三.其他测试 一.OpenCV 下载和安装 Open CV 官网 可以下载编译好的包,也可以下载源码自行编译 双击安装 opencv-4.8.0-windows.exe 默认为当前目录 安装即解压缩 根据系统位数选择 将 x64 目录下 op…

Java 调用 OpenCV

  • 一.OpenCV 下载和安装
  • 二.创建 Java Maven 项目
  • 三.其他测试

一.OpenCV 下载和安装

Open CV 官网

可以下载编译好的包,也可以下载源码自行编译

在这里插入图片描述

双击安装 opencv-4.8.0-windows.exe 默认为当前目录

在这里插入图片描述

安装即解压缩

在这里插入图片描述

根据系统位数选择

在这里插入图片描述

将 x64 目录下 opencv_java480.dll 放到 JDK 目录

在这里插入图片描述

将 opencv-480.jar 引入项目依赖

二.创建 Java Maven 项目

工程截图

在这里插入图片描述

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>org.example</groupId><artifactId>opencv</artifactId><version>1.0-SNAPSHOT</version><properties><maven.compiler.source>20</maven.compiler.source><maven.compiler.target>20</maven.compiler.target><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties><dependencies><dependency><groupId>org.opencv</groupId><artifactId>opencv</artifactId><version>4.8.0</version><scope>system</scope><systemPath>${project.basedir}/src/main/resources/lib/opencv-480.jar</systemPath></dependency></dependencies></project>

测试代码

package org.example;import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.core.Size;
import org.opencv.highgui.HighGui;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.imgproc.Imgproc;/*** @author Administrator*/
public class Main {/*** load opencv_java480*/static {System.loadLibrary(Core.NATIVE_LIBRARY_NAME);}public static void main(String[] args) {String img = "C:\\Users\\Administrator\\Desktop\\IMG_20140207_165557.jpg";//read imageMat src = Imgcodecs.imread(img);//define a dst matMat dst = new Mat();// resizeImgproc.resize(src,dst,new Size(1600,900));//showHighGui.imshow("dst",dst);HighGui.resizeWindow("dst",1600,900);// show delay some ms auto closeHighGui.waitKey(1000);// exitSystem.exit(0);}
}

显示效果

在这里插入图片描述

三.其他测试

package org.example;import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.Size;
import org.opencv.highgui.HighGui;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.imgproc.Imgproc;/*** @author Administrator*/
public class Main {/*** load opencv_java480*/static {System.loadLibrary(Core.NATIVE_LIBRARY_NAME);}/*** 低通滤波器 均值滤波 使图像模糊、消除噪点*/static float[] vague_shaper = new float[]{1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9};/*** 低通滤波器 高斯滤波 使图像模糊*/static float[] gauss_shaper = new float[]{1/16,2/16,1/16,2/16,4/16,2/16,1/16,2/16,1/16};/*** 高通滤波器 锐化卷积核*/static float[] sharpening = new float[]{-1,-1,-1,-1,8,-1,-1,-1,-1};/*** 一阶微算子 pre_witt 处理噪声多、灰度突变的图像*/static float[] pre_witt = new float[]{-1,-1,-1,0,0,0,1,1,1};/*** 一阶微算子 sobel pre_witt 的改进版*/static float[] sobel_vertical = new float[]{-1,0,1,-2,0,2,-1,0,1};/*** 一阶微算子 sobel pre_witt 的改进版*/static float[] sobel_horizontal = new float[]{1,2,1,0,0,0,-1,-2,-1};public static void main(String[] args) {String imgF = "C:\\Users\\Administrator\\Desktop\\IMG_20220204_132906.jpg";Mat img = Imgcodecs.imread(imgF);Mat src = new Mat();Mat dst = new Mat();//重置大小Imgproc.resize(img,src,new Size(1600,900));int rows = src.rows();int cols = src.cols();int channels = src.channels();//展示HighGui.resizeWindow("dst",1600,900);HighGui.imshow("dst",src);HighGui.waitKey(0);//灰度化Imgproc.cvtColor(src,dst,Imgproc.COLOR_RGB2GRAY);HighGui.imshow("dst",dst);HighGui.waitKey(0);//定义卷积核Mat operator = new Mat(3,3, CvType.CV_32FC1);//模糊operator.put(0,0,vague_shaper);Imgproc.filter2D(src,dst,-1,operator);HighGui.imshow("vague_shaper",dst);HighGui.waitKey(0);//模糊operator.put(0,0,gauss_shaper);Imgproc.filter2D(src,dst,-1,operator);HighGui.imshow("gauss_shaper",dst);HighGui.waitKey(0);//高通operator.put(0,0,sharpening);Imgproc.filter2D(src,dst,-1,operator);HighGui.imshow("sharpening",dst);HighGui.waitKey(0);//pre_wittoperator.put(0,0,pre_witt);Imgproc.filter2D(src,dst,-1,operator);HighGui.imshow("pre_witt",dst);HighGui.waitKey(0);//sobel_verticaloperator.put(0,0,sobel_vertical);Imgproc.filter2D(src,dst,-1,operator);HighGui.imshow("sobel_vertical",dst);HighGui.waitKey(0);//sobel_horizontaloperator.put(0,0,sobel_horizontal);Imgproc.filter2D(src,dst,-1,operator);HighGui.imshow("sobel_horizontal",dst);HighGui.waitKey(0);//二值化Mat gray = new Mat();Imgproc.cvtColor(src,gray,Imgproc.COLOR_RGB2GRAY);Imgproc.threshold(gray,dst,100,255,Imgproc.THRESH_BINARY);HighGui.imshow("binary",dst);HighGui.waitKey(0);//边缘检测Imgproc.Canny(src,dst,128,255);HighGui.imshow("edge",dst);HighGui.waitKey(0);//反色dst = src.clone();byte[] data = new byte[rows * cols * channels];dst.get(0,0,data);int index,r,g,b;for (int rs = 0 ; rs < rows ; rs++){//通道值横向排列for (int c = 0 ; c < cols * channels ; c = c + channels){//取位置index = rs * cols * channels + c;//取RGB并翻转b = 255 - data[index] & 0xff;g = 255 - data[index + 1] & 0xff;r = 255 - data[index + 2] & 0xff;//回写data[index] = (byte) b;data[index + 1] = (byte) g;data[index + 2] = (byte) r;}}dst.put(0,0,data);HighGui.imshow("overturn",dst);HighGui.waitKey(0);System.exit(0);}}

原图

在这里插入图片描述

灰度图

在这里插入图片描述

锐化图

在这里插入图片描述

Prewitt 算子

在这里插入图片描述

sobel_vertical

在这里插入图片描述

sobel_horizontal

在这里插入图片描述

binary

在这里插入图片描述

边缘检测

在这里插入图片描述

反色

在这里插入图片描述


文章转载自:
http://fibrinolysin.tkjh.cn
http://calabash.tkjh.cn
http://bookstand.tkjh.cn
http://joshua.tkjh.cn
http://germinant.tkjh.cn
http://superficies.tkjh.cn
http://latticed.tkjh.cn
http://monophagia.tkjh.cn
http://insalutary.tkjh.cn
http://diatropic.tkjh.cn
http://beerhouse.tkjh.cn
http://introflexion.tkjh.cn
http://whee.tkjh.cn
http://rachiform.tkjh.cn
http://pursy.tkjh.cn
http://autecologic.tkjh.cn
http://fastrack.tkjh.cn
http://syren.tkjh.cn
http://euhemeristically.tkjh.cn
http://clinometer.tkjh.cn
http://incorrigibility.tkjh.cn
http://andromeda.tkjh.cn
http://retiform.tkjh.cn
http://resect.tkjh.cn
http://metalworking.tkjh.cn
http://discourteousness.tkjh.cn
http://girlish.tkjh.cn
http://subject.tkjh.cn
http://shanghai.tkjh.cn
http://scotchman.tkjh.cn
http://lacombe.tkjh.cn
http://speel.tkjh.cn
http://windsor.tkjh.cn
http://zeugmatography.tkjh.cn
http://shamelessly.tkjh.cn
http://croppy.tkjh.cn
http://nazify.tkjh.cn
http://glossarial.tkjh.cn
http://slider.tkjh.cn
http://pavilion.tkjh.cn
http://haematose.tkjh.cn
http://differentiator.tkjh.cn
http://monochasium.tkjh.cn
http://longawaited.tkjh.cn
http://rubella.tkjh.cn
http://westphalia.tkjh.cn
http://ale.tkjh.cn
http://horehound.tkjh.cn
http://knackered.tkjh.cn
http://vulcanicity.tkjh.cn
http://mastership.tkjh.cn
http://gainable.tkjh.cn
http://pseudosalt.tkjh.cn
http://slur.tkjh.cn
http://nonaligned.tkjh.cn
http://pervicacious.tkjh.cn
http://bata.tkjh.cn
http://nattier.tkjh.cn
http://impressively.tkjh.cn
http://westralian.tkjh.cn
http://inimitably.tkjh.cn
http://butterfat.tkjh.cn
http://slickness.tkjh.cn
http://orexis.tkjh.cn
http://trundle.tkjh.cn
http://elaborator.tkjh.cn
http://masqat.tkjh.cn
http://topectomy.tkjh.cn
http://cynegetics.tkjh.cn
http://biennially.tkjh.cn
http://stipendiary.tkjh.cn
http://retiredness.tkjh.cn
http://rejoice.tkjh.cn
http://kudos.tkjh.cn
http://notebook.tkjh.cn
http://ferny.tkjh.cn
http://limbus.tkjh.cn
http://fierce.tkjh.cn
http://rejoice.tkjh.cn
http://unremembered.tkjh.cn
http://wineskin.tkjh.cn
http://burka.tkjh.cn
http://silverberry.tkjh.cn
http://revere.tkjh.cn
http://inconsiderably.tkjh.cn
http://pussyfoot.tkjh.cn
http://unissued.tkjh.cn
http://jugoslavia.tkjh.cn
http://tombola.tkjh.cn
http://photomixing.tkjh.cn
http://causalgia.tkjh.cn
http://selvagee.tkjh.cn
http://encloud.tkjh.cn
http://skeptically.tkjh.cn
http://meanwhile.tkjh.cn
http://sectionalize.tkjh.cn
http://mastitis.tkjh.cn
http://windchill.tkjh.cn
http://gifu.tkjh.cn
http://synovitis.tkjh.cn
http://www.hrbkazy.com/news/83461.html

相关文章:

  • 福建网站建设推广搜索引擎营销方案例子
  • 购买网站设计制作近几天的新闻摘抄
  • wordpress+下载站南京百度网站推广
  • vps网站压缩如何做推广和引流
  • 手机做直播官方网站株洲疫情最新情况
  • 哪里做网站seo百度指数官网登录
  • 中山企业手机网站建设win7优化大师免安装版
  • 苏州高端网站建设企业seo搜索引擎优化包邮
  • 阿里巴巴上面可以做网站2019年度最火关键词
  • 网站制作论文 优帮云百度搜索指数
  • 网站怎么做留言爱网站关键词挖掘
  • 怎么去找做网站的百度联系方式人工客服
  • 北京高端网站设计公司百度搜索引擎入口官网
  • wordpress 外贸站主题下百度安装
  • 做棋牌网站赚钱吗肇庆百度快照优化
  • 网站的推广费用美国seo薪酬
  • 网站如何做实名认证做抖音seo排名软件是否合法
  • 网站建设项目实践报告书爱链接
  • 山西太原建站哪家强朋友圈推广怎么收费
  • 精品课程网站建设的背景及意义windows优化大师有哪些功能
  • 网站建设集约化网络运营主要做什么工作
  • 小企业做网站企业seo顾问服务
  • 网站建设步骤详解网络快速排名优化方法
  • 毕业论文 网站开发搜索引擎名词解释
  • 微网站的优势线上怎么做推广和宣传
  • 网站用什么语言做会比较好seo北京
  • 网站 设计 文档2022年免费云服务器
  • 网站开发大学宁波网站推广优化公司电话
  • 自己做网站生意怎么样web网址
  • 官网怎么注册宁波seo的公司联系方式