0%

拉普拉斯算子在平面内的数值近似img

拉普拉斯滤波器卷积核表示

img

利用Laplacian滤波器实现图像的锐化

由于拉普拉斯是一种微分算子,它的应用可增强图像中灰度突变的区域,减弱灰度的缓慢变化区域。

​ 因此,锐化处理可选择拉普拉斯算子对原图像进行处理,产生描述灰度突变的图像,再将拉普拉斯图像与原始图像叠加而产生锐化图像:

img

使用拉普拉斯滤波器实现的图像锐化算法 ↑

​ 其中,f(x,y)为原始图像,g(x,y)为锐化后图像,c为-1(卷积核中间为负数时,若卷积核中间为正数,则c为1)

img

Read more »

MVC 模式代表 Model-View-Controller(模型-视图-控制器) 模式。这种模式用于应用程序的分层开发。

  • Model(模型) - 模型代表一个存取数据的对象或 JAVA POJO。它也可以带有逻辑,在数据变化时更新控制器。模型表示企业数据和业务规则。在MVC的三个部件中,模型拥有最多的处理任务。例如它可能用像EJBs和ColdFusion Components这样的构件对象来处理数据库,被模型返回的数据是中立的,就是说模型与数据格式无关,这样一个模型能为多个视图提供数据,由于应用于模型的代码只需写一次就可以被多个视图重用,所以减少了代码的重复性。

  • View(视图) - 视图代表模型包含的数据的可视化。

    视图是用户看到并与之交互的界面。对老式的Web应用程序来说,视图就是由HTML元素组成的界面,在新式的Web应用程序中,HTML依旧在视图中扮演着重要的角色,但一些新的技术已层出不穷,它们包括[Adobe Flash](https://baike.baidu.com/item/Adobe Flash)和像XHTMLXML/XSL,WML等一些标识语言和[Web services](https://baike.baidu.com/item/Web services).

    MVC好处是它能为应用程序处理很多不同的视图。在视图中其实没有真正的处理发生,不管这些数据是联机存储的还是一个雇员列表,作为视图来讲,它只是作为一种输出数据并允许用户操纵的方式。

  • Controller(控制器) - 控制器作用于模型和视图上。它控制数据流向模型对象,并在数据变化时更新视图。它使视图与模型分离开。控制器接受用户的输入并调用模型和视图去完成用户的需求,所以当单击Web页面中的超链接和发送HTML表单时,控制器本身不输出任何东西和做任何处理。它只是接收请求并决定调用哪个模型构件去处理请求,然后再确定用哪个视图来显示返回的数据。

img

img

Read more »

在该方法中构造main函数

Sources 一般用于标注类似 src 这种可编译目录。有时候我们不单单项目的 src 目录要可编译,还有其他一些特别的目录也许我们也要作为可编译的目录,就需要对该目录进行此标注。只有 Sources 这种可编译目录才可以新建 Java 类和包,这一点需要牢记。
Tests 一般用于标注可编译的单元测试目录。在规范的 maven 项目结构中,顶级目录是 src,maven 的 src 我们是不会设置为 Sources 的,而是在其子目录 main 目录下的 java 目录,我们会设置为 Sources。而单元测试的目录是 src - test - java,这里的 java 目录我们就会设置为 Tests,表示该目录是作为可编译的单元测试目录。一般这个和后面几个我们都是在 maven 项目下进行配置的,但是我这里还是会先说说。从这一点我们也可以看出 IntelliJ IDEA 对 maven 项目的支持是比彻底的。
Resources 一般用于标注资源文件目录。在 maven 项目下,资源目录是单独划分出来的,其目录为:src - main -resources,这里的 resources 目录我们就会设置为 Resources,表示该目录是作为资源目录。资源目录下的文件是会被编译到输出目录下的。
Test Resources 一般用于标注单元测试的资源文件目录。在 maven 项目下,单元测试的资源目录是单独划分出来的,其目录为:src - test -resources,这里的 resources 目录我们就会设置为 Test Resources,表示该目录是作为单元测试的资源目录。资源目录下的文件是会被编译到输出目录下的。
Excluded 一般用于标注排除目录。被排除的目录不会被 IntelliJ IDEA 创建索引,相当于被 IntelliJ IDEA 废弃,该目录下的代码文件是不具备代码检查和智能提示等常规代码功能。
通过上面的介绍,我们知道对于非 maven 项目我们只要会设置 src 即可。

Read more »

将鼠标放在接口的名称处按 Alt+Enter 键

实现接口:鼠标左键单击:Implement interface ,进入创建实现类的名字以及指明其所在的包的界面。选择好之后,点击ok即可完成

Read more »

The first important content is the image forming process. The image is an array. There is only one array for black and white images, and there are three arrays for color images. Then the picture is recorded by the camera because of the black box camera and the principle of small hole forming. There is a perspective effect through the camera, and the parallel lines will converge at a vanishing point in the distance in the picture. Homogeneous coordinates represent a vector that is originally n-dimensional with an n+1-dimensional vector, which refers to a coordinate system used in projection geometry, just like Cartesian coordinates used in Euclidean geometry. 2D and 3D transformations include homogeneous coordinates and transformation.

The intrinsic matrix: The focal length is from the pointer hole to the film, where the unit of focal length in pixels. The extrinsic matrix is used to describe the position of the camera in the “world coordinate system” and the direction it points to. The field of view depends on the focal length, the larger the focal length, the smaller the field of view. The smaller the focal length, the larger the field of view. The above is the position of the object in the photo, and the next is the pixel size. The biggest function of the large aperture is to highlight the subject, blur the background, and create a sense of hierarchy. The small aperture has a large clear range and is suitable for shooting themes such as scenery, travel, and documentary. The scenery is shot with a small aperture. With the pan-focus operation, the entire huge spatial scale picture can be located in a clear range. Finally, the digital camera, using imaging sensors.

The second part is image processing, Proposed the Aliasing problem, the harm caused by down-sampling danger, Characteristic errors will appear. The solution involves multiple sampling to eliminate frequencies higher than half of the new sampling, Including Gaussian filtering.

Tone mapping makes the Incoming light energy and the Image intensity value not linear.

Bilinear interpolation is a linear interpolation extension of an interpolation function with two variables. Its core idea is to perform a linear interpolation in two directions.

Chromatic aberration: Different colors of light have different wavelengths. Therefore, the focal plane of light passing through the lens and light of different wavelengths will be slightly different. Besides, the angles of the chromatic images after passing through the lens will be slightly staggered when they reach the focal plane. That is, the seven basic colors of light reach different focal points.

Histogram Equalization: It is often used to enhance the overall contrast of the picture, especially for those cases where useful data is represented by similar data.

Read more »

联系:
1.PreparedStatement继承自Statement,两者都是接口。
2.内部都要建立类似于Sockt连接,效率都不是特别高。

从资源利用和安全的角度区分两者的不同:

关于批处理时如何选择,以数据量大小位标准分三种情况:
1)量比较小,二者皆差别不大。
2)量比较多,在PreparedStatement预编译空间范围之内,选择PreparedStatement,因为其只预编译一次sql语句。
3)量特别大,使用Statement,因为PrepareStatement的预编译空间有限,当数据量特别大时,会发生异常。
特殊情况还有:执行不同的sql语句,批处理…等等 ,可以从消耗资源的角度再次分析。

批处理综合分析:
使用PreparedStatement代码演示:
在批处理过程中包含的sql语句的主干部分(sql语句)必须相同,改变的只是参数,因此编译一次sql语句即可,极大提高性能,但其主干必须相同则影响了灵活性。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
public static void main(String[] args) {
2 Connection conn = null;
3 Statement stat = null;
4 PreparedStatement ps = null;
5
6 try {
7 Class.forName("com.mysql.jdbc.Driver");
8 conn = DriverManager.getConnection("jdbc:mysql:///mydb5","root","admin");
9 //开始事务
10 conn.setAutoCommit(false);
11 String sql = "insert into tb_batch values (null,?)";
12 ps = conn.prepareStatement(sql);
13 for(int i=2000;i<3000;i++){
14 ps.setString(1, "tong"+i);
15 ps.addBatch();
16 }
17 ps.executeBatch();
18 //提交事务
19 conn.commit();
22 } catch (Exception e) {
23 e.printStackTrace();
24 }finally{
25 JDBCutils.closeResou(conn, ps, null);
26 }
29 }

使用Statement代码演示:
可以包含结构不同的sql语句,灵活性得到提高,但没有预编译机制, 效率低下;并且你会发现发送的sql语句主干部分相同,只是参数不同, 但是主干部分每次都需要重复写入,极为麻烦。.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Connection conn = null;
4 Statement stat = null;
5 //注册驱动和连接数据库
6 conn = JDBCutils.getConn();
7 try {
8 stat = conn.createStatement();
9 stat.addBatch("drop database if exists mydb5");
10 stat.addBatch("create database mydb5");
13 stat.addBatch("insert into tb_batch values(null,'a')");
14 stat.addBatch("insert into tb_batch values(null,'bbb')");
15 stat.addBatch("insert into tb_batch values(null,'cccccc')");
16 stat.executeBatch();
19 } catch (Exception e) {
20 e.printStackTrace();
21 }finally{
22 JDBCutils.closeResou(conn, stat, null);
23 }
24

从数据库安全的角度:
PreparedStatement可防止SQL注入。SQL注入情况如下所示:

1
2
3
4
5
//输入要删除的账户:'abc' or 1=1
String username="'abc' or 1=1"

//等待用户输入的SQL语句
String sql=select * from user where username ='"+username+"';

可以发现输入密码时,已经属于非法输入
使用Statement 的话最后的sql语句则是如下所示:

Read more »

此网站仅为学习过程中的笔记,供大家分享。

一緒に頑張りましょう!

What I’m doing right now, I’m chasing perfection.

如有疑问请发邮件到 1301420427@qq.com

img

Read more »