02_ElasticSearch索引操作总结归纳

02_ElasticSearch索引操作总结归纳

ElasticSearch索引操作总结归纳 便于后期使用查找

Index索引操作

一、使用kibana工具操作索引

1.索引类型:

  • text/keyword、
  • 整数类型、
  • 浮点类型、
  • 日期类型、
  • boolean 、
  • array类型(其实就是josn对象中数组写法”[{},{}]”)、
  • Object类型(其实就是一个json对象)

2.创建索引和映射对象

PUT /索引库名 
{
    
    "mappings": {
    
        "类型名称":{
    //类似于数据库中的不同表字段名:任意填写 ,相当于表的名称。
            "properties": {
    
                "字段名": {
    
                    "type": "类型", 
                    "index": true"store": true"analyzer": "分词器"//比如ik_max_word
                } 
            } 
        } 
    }

先分析,那些需要建立索引放入到索引库中,比如

#创建索引结构 
PUT sku {
    
    "mappings": {
    
        "doc":{
    
            "properties":{
    
                "name":{
    
                    "type":"text", 
                    "analyzer":"ik_smart" 
                },
                "price":{
    
                    "type":"integer" 
                },
                "image":{
    
                    "type":"text",
                    "index":false
                },
                "createTime":{
    
                    "type":"date" 
                },
                "spuId":{
   
                    "type":"text" 
                },
                "categoryName":{
   
                    "type":"keyword" 
                },
                "brandName":{
   
                    "type":"keyword" 
                },
                "spec":{
   
                    "type":"object" 
                },
                "saleNum":{
   
                    "type":"integer" 
                },
                "commentNum":{
    
                    "type":"integer" 
                } 
            } 
        } 
    }
}

3.添加文档

分为指定id,和不指定id。如果不指定id,系统会自动生成。

POST 索引库名/ 类型名  //POST 索引库名/ 类型名/id值
{
   
"key":"value"
}
### 插入文档   手动指定指定id写法:POST sku/doc/3
POST sku/doc
{
   
  "name":"小米手机",
  "price":200000,
  "spuId":101,
  "createTime":"2019-05-01",
  "brandName":"小米",
  "categerName":"手机",
  "saleNum":1203,
  "commentNum":2356,
  "spec":{
   
    "网络制式":"移动4G",
    "屏幕尺寸":"4.5"
  }
}

在java中如何体现添加添加spec??

Map skuMap = new HashMap();

Map specMap = new HashMap();

specMap.put("网络制式","移动4G");

specMap.put("屏幕尺寸","4.5");

skuMap.put("spec",specMap);


4.查询索引

查询的基本格式:

Get 索引名称/_search
{
   
    "query":{
   
        "查询类型":{
   
            "查询条件":"查询条件值"
        }
    }
}

query代表一个查询对象,里面可以有不同的查询属性

  • 查询类型
    • match_allmatchterm(根据字段)range(根据区间)、等。
  • 查询条件:查询条件会根据类型的不同,写法也有差异。比如bool、过滤查询/分组查询

4.1 查询所有-match_all

查询类型为match_all相当于_search

Get sku/_search
{
   
    "query":{
   
        "match_all":{
   }
    }
}

4.2 匹配查询-match

查询类型match

GET sku/_search
{
   
    "query":{
   
        "match":{
   
            "name":"手机"
        }
    }
}

只要name中包含手机、手、机都会被查询出来.会对手机进行分词,多个词语之间的关系默认为or。如果要精准查询,需要将操作改为and关系.

GET sku/_search
{
   
    "query":{
   
        "match":{
   
            "name":{
   
                "query":"小米手机",
                "operator":"and"
            }
        }
    }
}

4.3 多字段查询-multi_match

查询类型名称为:“multi_match”

Get sku/_search
{
   
    "query":{
   
        "multi_match":{
   
            "query":"小米",
            "fields":["name","brandName","categoryName"]
        }
    }
}

"fields":["name","brandName","categoryName"]从这些字段查询小米

4.4 词条匹配-term

查询类型名称为:“term”,精确值匹配,可能是数字、时间、布尔或者未分词的字符串。

###单词条匹配
GET sku/_search
{
   
    "query":{
   
        "term":{
   
            "price":20000
        }
    }
}
###多词条匹配
GET sku/_search
{
   
    "query":{
   
        "term":{
   
            "price":[200000,300000]
        }
    }
}

4.5 布尔组合查询bool

查询类型为:“bool”。把”match”/“match_all”/“term”/“terms”等查询方式通过”must(与)”、“must_not(非)”、”should(或)”的方式进行组合。

#查询名称包含手机,并且品牌名称为小米的数据
Get sku/_search
{
   
    "query":{
   
        "bool":{
   
            "must":[
                "match":{
   
                "name":"手机"
                },
        		"term":{
   
                    "brandName":"小米"
                }
            ]
        }
    }
}

4.6 过滤查询-bool-filter

过滤器查询的效率比查询效率高,过滤查询不会计算判断文档匹配度的得分.推荐尽量使用过滤

器去实现查询或者过滤器和查询共同使用。

过滤查询场景:我们希望查询出来的文档不需要对他进行匹配度评分、简单的进行筛选一下

查询类型为:“bool”

GET sku/_search
{
   
    "query":{
   
        "bool":{
   
            "filter":{
   
                "match":{
   "brandName":"小米"}
            }
        }
    }
}

4.7 分组查询-aggs

#分组查询
GET sku/_search
{
   
 ### aggs 表示分组 
  "size": 0, ###如果size:0 表示不用展示hits:[] 里面的数据了  
  "aggs": {
   
    "sku_category": {
    //分组展示的名称
      "terms": {
   
        "field": "price"
      }
    }
  }
}
#多个分组条件
GET sku/_search
{
   
  
   "size": 0, ###如果size:0 表示不用展示hits:[] 里面的数据了
  "aggs": {
   
    "sku_category": {
   //分组展示的名称
      "terms": {
   
        "field": "price" //分组字段
      }
    },
    "sku_brand": {
   
      "terms": {
   
        "field": "brandName"
      }
    }
    
  }
}
###Mysql中多个字段的分组
####对Subject_Selection表中的数据进行分组,
####将具有相同Subject和Semester字段值的记录放到同一个分组里去, 
####然后对每个分组中的数据应用聚合函数(COUNT,SUM, AVG,etc)。
####分组条件使用having
SELECT Subject, Semester, Count(*)FROM Subject_Selection GROUP BY Subject, Semester

二、使用java操作索引

使用java high level rest client。elasticsearch 版本需要在ES5以上。

创建索引和映射对象,可以使用kibana工具进行创建,然后添加、查询、修改索引使用java代码进行操作。

1.新增修改数据

HttpHost : url地址封装

RestClientBuilder: rest客户端构建器

RestHighLevelClient: rest高级客户端

HttpHost、RestClientBuild、RestHighLevelClient 这三个类用于连接ElasticSearch。

IndexRequest: 新增或修改请求

IndexResponse:新增或修改的响应结果

BulkRequest: 批量请求(用于增删改操作) ;BulkRequest里面可以装入多个IndexRequest。

BulkResponse:批量请求(用于增删改操作)

1.1 新增修改单条数据

import org.apache.http.HttpHost;

import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;



import java.util.HashMap;
import java.util.Map;

public class Demo1 {
   
    public static void main(String[] args) {
   
        //1.链接rest接口
        HttpHost http = new HttpHost("127.0.0.1", 9200, "http");
        RestClientBuilder restClientBuilder = RestClient.builder(http);
        RestHighLevelClient restHighLevelClient = new RestHighLevelClient(restClientBuilder);


        //2.封装请求对象 (指定id)
        IndexRequest indexRequest = new IndexRequest("sku", "doc", "3");
        Map skuMap = new HashMap();

        skuMap.put("name", "华为p30");
        skuMap.put("name", "华为p30pro");
        skuMap.put("brandName", "华为");
        skuMap.put("categoryName", "手机");
        skuMap.put("price", 1010221);
        skuMap.put("createTime", "2019-05-01");
        skuMap.put("saleNum", 101021);
        skuMap.put("commentNum", 10102321);
		//spec在索引库的类型为Object ,在java代码中我们使用map进行封装spec,然后在封装到外面一层的map。
        Map spec = new HashMap();
        spec.put("网络制式", "移动4G");
        spec.put("屏幕尺寸", "5");
        skuMap.put("spec", spec);
		//除了使用Map,也可以使用实体类进行封装。
        indexRequest.source(skuMap);

        //3.获取请求结果
       try{
   
           IndexResponse indexResponse = restHighLevelClient.index(indexRequest, RequestOptions.DEFAULT);
           //执行状态
           int status = indexResponse.status().getStatus();
           System.out.println(status);

       }catch (Exception e){
   
           e.printStackTrace();
       }
        //关闭资源流

    }
}

1.2 批量插入

import org.apache.http.HttpHost;
import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;

import java.util.HashMap;
import java.util.Map;

public class Demo2 {
   
    public static void main(String[] args) {
   
        //1.连接rest接口
        HttpHost http = new HttpHost("127.0.0.1", 9200, "http");
        RestClientBuilder builder = RestClient.builder(http);
        //rest构建器 
        RestHighLevelClient restHighLevelClient = new RestHighLevelClient(builder);
        //高级客户端对象 
        // 2.封装请求对象
        BulkRequest bulkRequest = new BulkRequest();
        
        //----------------------
        IndexRequest indexRequest = new IndexRequest("sku", "doc", "4");
        Map skuMap = new HashMap();
        skuMap.put("name", "华为p30pro 火爆上市");
        skuMap.put("brandName", "华为");
        skuMap.put("categoryName", "手机");
        skuMap.put("price", 1010221);
        skuMap.put("createTime", "2019‐05‐01");
        skuMap.put("saleNum", 101021);
        skuMap.put("commentNum", 10102321);
        Map spec = new HashMap();
        spec.put("网络制式", "移动4G");
        spec.put("屏幕尺寸", "5");
        skuMap.put("spec", spec);
        
        indexRequest.source(skuMap);
        
        bulkRequest.add(indexRequest); //可以循环加入的
        
        //--------------------
        
        //可以多次添加 
        // 3.获取响应结果 
        try {
   
            BulkResponse response = restHighLevelClient.bulk(bulkRequest, RequestOptions.DEFAULT);
            int status = response.status().getStatus();
            System.out.println(status);
            String message = response.buildFailureMessage();
            System.out.println(message);
            restHighLevelClient.close();
        } catch (Exception e) {
   
            e.printStackTrace();
        }
    }
}


2.匹配查询

SearchRequest: 查询请求对象

SearchResponse:查询响应对象

SearchSourceBuilder:查询源构建器

MatchQueryBuilder:匹配查询构建器

查询商品名称包含手机的数据

import org.apache.http.HttpHost;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.MatchQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.search.builder.SearchSourceBuilder;

public class Demo3 {
   
    public static void main(String[] args) throws  Exception{
   
        //1.连接rest接口
        HttpHost http = new HttpHost("127.0.0.1", 9200, "http");
        RestClientBuilder builder = RestClient.builder(http);
        RestHighLevelClient restHighLevelClient = new RestHighLevelClient(builder);

        //2.封装查询请求
        //对应GET sku 这部分。
        SearchRequest searchRequest = new SearchRequest("sku");
        searchRequest.types("doc");//如果不写,可以查询所有类型. GET sku/doc/_search
        //查询源构造器
        /* { "query": { ---->new SearchSourceBuilder(); "match": { ----> "name": "手机" ---->MatchQueryBuilder } } } */
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        MatchQueryBuilder matchQueryBuilder = QueryBuilders.matchQuery("name", "手机");
        searchSourceBuilder.query(matchQueryBuilder);

        //相当于最外面的大括号.
        searchRequest.source(searchSourceBuilder);

        //3.获取查询结果
        //相当于 _search
        SearchResponse searchResponse = restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT);
        SearchHits searchHits = searchResponse.getHits();
        long totalHits = searchHits.getTotalHits();
        System.out.println("返回记录数:"+totalHits);

        SearchHit[] hits = searchHits.getHits();
        for (SearchHit hit : hits) {
   
            String source = hit.getSourceAsString();//json字符串。也可以获取map类型
            System.out.println(source);
        }
        restHighLevelClient.close();

    }
}

3.布尔和词条查询

SearchRequest: 查询请求对象

SearchResponse:查询响应对象

SearchSourceBuilder:查询源构建器

BoolQueryBuilder:布尔查询构建器

TermQueryBuilder:词条查询构建器

QueryBuilders:查询构建器工厂

查询名称包含手机的,并且品牌为小米的记录

#查询名称包含手机的,并且品牌为小米的。
Get sku/_search
{
   
  "query":{
   
    "bool":{
   
      "must":[
        {
   "match":{
   "name":"手机"}},
        {
   "term":{
   "brandName":"小米"}}
      ]
    }
  }
}

import org.apache.http.HttpHost;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.*;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.search.builder.SearchSourceBuilder;

public class Demo4 {
   
    /* #查询名称包含手机的,并且品牌为小米的。 Get sku/_search { "query":{ ---- new SearchSourceBuilder(); "bool":{ ---> BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); "must":[ {"match":{"name":"手机"}}, ----->MatchQueryBuilder matchQueryBuilder = QueryBuilders.matchQuery("name","手机"); {"term":{"brandName":"小米"}} ----> TermQueryBuilder termQueryBuilder = QueryBuilders.termQuery("brandName", "小米"); ] } } } */
    public static void main(String[] args) throws Exception {
   
        //1.连接rest接口
        HttpHost http = new HttpHost("127.0.0.1", 9200, "http");
        RestClientBuilder builder = RestClient.builder(http);
        RestHighLevelClient restHighLevelClient = new RestHighLevelClient(builder);


        //2.封装查询对象
        SearchRequest searchRequest = new SearchRequest("sku");
        searchRequest.types("doc");



        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        //布尔构建查询器
        BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
        MatchQueryBuilder matchQueryBuilder = QueryBuilders.matchQuery("name","手机");
        boolQueryBuilder.must(matchQueryBuilder);

        TermQueryBuilder termQueryBuilder = QueryBuilders.termQuery("brandName", "小米");
        boolQueryBuilder.must(termQueryBuilder);

        
        //相当于最外面的大括号.
        searchRequest.source(searchSourceBuilder);


        //3.获取查询结果
        SearchResponse searchResponse = restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT);
        SearchHits searchHits = searchResponse.getHits();
        long totalHits = searchHits.getTotalHits();
        System.out.println("返回记录数:"+totalHits);

        SearchHit[] hits = searchHits.getHits();
        for (SearchHit hit : hits) {
   
            String source = hit.getSourceAsString();//json字符串。也可以获取map类型
            System.out.println(source);
        }
        restHighLevelClient.close();


    }
}

4.过滤查询

过滤查询依赖bool,filter是一个链接关键字,相当于must

筛选品牌为小米记录

package com.qingcheng;

import org.apache.http.HttpHost;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.MatchQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.query.TermQueryBuilder;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.search.builder.SearchSourceBuilder;

public class Demo5 {
   
    /* #查询名称包含手机的,并且品牌为小米的。 Get sku/_search { "query":{ ---- new SearchSourceBuilder(); "bool":{ ---> BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); "filter":[ {"match":{"name":"手机"}}, ----->MatchQueryBuilder matchQueryBuilder = QueryBuilders.matchQuery("name","手机"); ] } } } */
    public static void main(String[] args) throws Exception {
   
        //1.连接rest接口
        HttpHost http = new HttpHost("127.0.0.1", 9200, "http");
        RestClientBuilder builder = RestClient.builder(http);
        RestHighLevelClient restHighLevelClient = new RestHighLevelClient(builder);


        //2.封装查询对象
        SearchRequest searchRequest = new SearchRequest("sku");
        searchRequest.types("doc");


		//查询源构造器
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        //布尔构建查询器
        BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
        

        TermQueryBuilder termQueryBuilder = QueryBuilders.termQuery("brandName", "小米");
        boolQueryBuilder.filter(termQueryBuilder);


        //相当于最外面的大括号.
        searchRequest.source(searchSourceBuilder);


        //3.获取查询结果
        SearchResponse searchResponse = restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT);
        SearchHits searchHits = searchResponse.getHits();
        long totalHits = searchHits.getTotalHits();
        System.out.println("返回记录数:"+totalHits);

        SearchHit[] hits = searchHits.getHits();
        for (SearchHit hit : hits) {
   
            String source = hit.getSourceAsString();//json字符串。也可以获取map类型
            System.out.println(source);
        }
        restHighLevelClient.close();


    }
}


5.分组查询(聚合查询)

AggregationBuilders:聚合构建器工厂

TermsAggregationBuilder:词条聚合构建器

Aggregations:分组结果封装

Terms.Bucket: 桶

package com.qingcheng;

import org.apache.http.HttpHost;
import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.index.query.BoolQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.index.query.TermQueryBuilder;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.SearchHits;
import org.elasticsearch.search.aggregations.Aggregation;
import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.Aggregations;
import org.elasticsearch.search.aggregations.bucket.terms.Terms;
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregationBuilder;
import org.elasticsearch.search.builder.SearchSourceBuilder;

import java.util.List;
import java.util.Map;

public class Demo6 {
   

    public static void main(String[] args) throws Exception {
   
        //1.连接rest接口
        HttpHost http = new HttpHost("127.0.0.1", 9200, "http");
        RestClientBuilder builder = RestClient.builder(http);
        RestHighLevelClient restHighLevelClient = new RestHighLevelClient(builder);


        //2.封装查询对象
        SearchRequest searchRequest = new SearchRequest("sku");
        searchRequest.types("doc");


        //查询员构造器
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();

        /* #分组查询 GET sku/_search { ### aggs 表示分组 size:0 "aggs": { "sku_category": { //分组展示的名称 "terms": { "field": "categoryName" } } } } */

        //聚合构造器工程
        TermsAggregationBuilder sku_category = AggregationBuilders.terms("sku_category");
        //词条聚合构建器
        TermsAggregationBuilder termsAggregationBuilder = sku_category.field("categoryName");//指定按照什么分组

        searchSourceBuilder.aggregation(termsAggregationBuilder);
        searchSourceBuilder.size(0);



        //相当于最外面的大括号.
        searchRequest.source(searchSourceBuilder);


        //3.获取查询结果
        SearchResponse searchResponse = restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT);

        /* SearchHits searchHits = searchResponse.getHits(); long totalHits = searchHits.getTotalHits(); System.out.println("返回记录数:"+totalHits); SearchHit[] hits = searchHits.getHits(); for (SearchHit hit : hits) { String source = hit.getSourceAsString();//json字符串。也可以获取map类型 System.out.println(source); }*/
        Aggregations aggregations = searchResponse.getAggregations();
        Map<String, Aggregation> aggregationMap = aggregations.getAsMap();
       // Aggregation aggregation = aggregationMap.get("sku_category");
        //Terms 是Aggregation的子类
        Terms terms = (Terms)aggregationMap.get("sku_category");
        List<? extends Terms.Bucket> buckets = terms.getBuckets();
        for (Terms.Bucket bucket : buckets) {
   
            System.out.println(bucket.getKeyAsString()+"___"+bucket.getDocCount());
        }
        restHighLevelClient.close();


    }
}


版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。

发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/100761.html原文链接:https://javaforall.cn

【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...

(0)


相关推荐

  • Oracle11g安装详细步骤(图文教程)

    Oracle11g安装详细步骤(图文教程)Oracle11g是J2EE初学者必学的数据库之一,下面就给大家介绍一下Oracle11g数据库的详细安装步骤。第一步:打开Oracle中文官网下载Oracle11g打开Oracle中文官网点击导航中的下载,找到数据库下载链接打开链接后,选择同意协议选项,并在下方找到Oracle11g的下载列表选择对应的版本进行下载,需要将File1和File2两个文件都下载下来第二步:解压文件,以

  • wannacry病毒作者_wannacry病毒利用了哪种漏洞

    wannacry病毒作者_wannacry病毒利用了哪种漏洞1.样本概况1.1样本信息病毒名称:Trojan-Ransom.Win32.Wanna.m所属家族:木马/勒索/蠕虫MD5:DB349B97C37D22F5EA1D1841E3C89EB4SHA1:E889544AFF85FFAF8B0D0DA705105DEE7C97FE26CRC32:9FBB12271.2测试环境及工具…

  • phpstorm 2021 3月份 激活码破解方法

    phpstorm 2021 3月份 激活码破解方法,https://javaforall.cn/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

  • python图像处理实战_数字图像处理与python实现pdf下载

    python图像处理实战_数字图像处理与python实现pdf下载数学形态学是一门建立在格论和拓扑学基础之上的图像分析学科,是数学形态学图像处理的基本理论。其基本的运算包括:腐蚀和膨胀、开运算和闭运算、图像顶帽运算和图像底帽运算、骨架抽取、形态学梯度、Top-hat变换等。万字长文整理,希望对您有所帮助。该系列文章是讲解PythonOpenCV图像处理知识,前期主要讲解图像入门、OpenCV基础用法,中期讲解图像处理的各种算法,包括图像锐化算子、图像增强技术、图像分割等,后期结合深度学习研究图像识别、图像分类应用。希望文章对您有所帮助,如果有不足之处,还请海涵~

    2022年10月14日
  • Windows Server 2008 部署权限管理RMS

    Windows Server 2008 部署权限管理RMS

发表回复

您的电子邮箱地址不会被公开。

关注全栈程序员社区公众号