Android Glide 4.9 常见方法总结

news2025/2/25 23:03:06

转载请标明出处:http://blog.csdn.net/zhaoyanjun6/article/details/128665358
本文出自【赵彦军的博客】

文章目录

  • 依赖
  • submit 下载图片
  • DrawableImageViewTarget
  • RequestListener 加载圆角图片回调
  • 圆形 CircleCrop
  • 圆角 RoundedCorners
  • FitCenter
  • CenterCrop
  • CenterInside
  • Rotate 旋转
  • 指定圆角方向

Android Glide 3.8 常见方法总结 【圆角、下载、回调】

依赖

 implementation 'com.github.bumptech.glide:glide:4.9.0'
 kapt 'com.github.bumptech.glide:compiler:4.9.0'

submit 下载图片

        new Thread(() -> {
            try {
                FutureTarget<File> taget = Glide.with(this).asFile().load(url).submit();
                File imgFile = taget.get();
               
                runOnUiThread(() -> {
                    Glide.with(this).load(imgFile).into(imageView);
                });
            } catch (Exception e) {
                e.printStackTrace();
            }
        }).start();

submit 有两个方法
submit()submit(int width, int height)

在这里插入图片描述

DrawableImageViewTarget

DrawableImageViewTarget 代替原来的 SimpleTarget

Glide.with(this).load(url).into(new DrawableImageViewTarget(imageView));

在这里插入图片描述

其他使用方式

Glide.with(this).load(url).into(new DrawableImageViewTarget(imageView) {
            @Override
            public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
                super.onResourceReady(resource, transition);    
            }

            @Override
            public void onLoadFailed(@Nullable Drawable errorDrawable) {
                super.onLoadFailed(errorDrawable);
            }
        });

RequestListener 加载圆角图片回调

要特别注意 onResourceReady 回调的线程问题

使用方式一:

        //设置图片圆角角度
        RoundedCorners roundedCorners = new RoundedCorners(20);
        //通过RequestOptions扩展功能,override:采样率,因为ImageView就这么大,可以压缩图片,降低内存消耗
        RequestOptions options = RequestOptions.bitmapTransform(roundedCorners).override(300, 300);

        Glide.with(this).load(url3).apply(options).listener(new RequestListener<Drawable>() {
          /**
             * 加载失败
             * @return false 未消费,继续走into(ImageView)
             *         true 已消费,不再继续走into(ImageView)
             */
            @Override
            public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
                return false;
            }
            
             /**
             * 加载成功
             * @return false 未消费,继续走into(ImageView)
             *         true 已消费,不再继续走into(ImageView)
             */
            @Override
            public boolean onResourceReady(Drawable drawable, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
                //这里的线程为主线程
                return false;
            }
        }).into(imageView);

使用方式二:

        //设置图片圆角角度
        RoundedCorners roundedCorners = new RoundedCorners(20);
        //通过RequestOptions扩展功能,override:采样率,因为ImageView就这么大,可以压缩图片,降低内存消耗
        RequestOptions options = RequestOptions.bitmapTransform(roundedCorners).override(300, 300);

        Glide.with(this).load(url3).apply(options).listener(new RequestListener<Drawable>() {
            /**
             * 加载失败
             * @return false 未消费,继续走into(ImageView)
             *         true 已消费,不再继续走into(ImageView)
             */
            @Override
            public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
                return false;
            }
            
            /**
             * 加载成功
             * @return false 未消费,继续走into(ImageView)
             *         true 已消费,不再继续走into(ImageView)
             */
            @Override
            public boolean onResourceReady(Drawable drawable, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
                //这里的线程为子线程
                runOnUiThread(() -> {
                    imageView.setBackground(drawable);
                });
                return false;
            }
        }).submit();

圆形 CircleCrop

  Glide.with(this)
                .load(url)
                .transform(new CircleCrop())
                .into(imageView);

在这里插入图片描述

圆角 RoundedCorners

        Glide.with(this)
                .load(url)
                .transform(new RoundedCorners(30))
                .into(imageView);

在这里插入图片描述

FitCenter

图片保持原来比例,在 imageView 中居中显示

        Glide.with(this)
                .load(url)
                .transform(new FitCenter())
                .into(imageView);

在这里插入图片描述

CenterCrop

图片会缩放 ,铺满 imageView , 四周会被裁剪

    Glide.with(this)
                .load(url)
                .transform(new CenterCrop())
                .into(imageView);

在这里插入图片描述

CenterInside

原图居中显示

    Glide.with(this)
          .load(url)
          .transform(new CenterInside())
          .into(imageView);

在这里插入图片描述

Rotate 旋转

        Glide.with(this)
                .load(url)
                .transform(new Rotate(90))
                .into(imageView);

在这里插入图片描述

指定圆角方向

        Glide.with(this)
                .load(url)
                //指定 image view 上面是圆角
                .transform(new RoundedCornersTransformation(this, 30,30, RoundedCornersTransformation.CornerType.TOP))
                .into(imageView);

RoundedCornersTransformation 从 jp.wasabeef:glide-transformations:2.0.2 拷贝出来的。
并且修改了部分函数。

RoundedCornersTransformation 如下

package com.zyj.myapplication;

/**
 * Copyright (C) 2017 Wasabeef
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Shader;
import android.support.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.Transformation;
import com.bumptech.glide.load.engine.Resource;
import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
import com.bumptech.glide.load.resource.bitmap.BitmapResource;

import java.security.MessageDigest;

public class RoundedCornersTransformation implements Transformation<Bitmap> {

    public enum CornerType {
        ALL,
        TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT,
        TOP, BOTTOM, LEFT, RIGHT,
        OTHER_TOP_LEFT, OTHER_TOP_RIGHT, OTHER_BOTTOM_LEFT, OTHER_BOTTOM_RIGHT,
        DIAGONAL_FROM_TOP_LEFT, DIAGONAL_FROM_TOP_RIGHT
    }

    private BitmapPool mBitmapPool;
    private int mRadius;
    private int mDiameter;
    private int mMargin;
    private CornerType mCornerType;

    public RoundedCornersTransformation(Context context, int radius, int margin) {
        this(context, radius, margin, CornerType.ALL);
    }

    public RoundedCornersTransformation(BitmapPool pool, int radius, int margin) {
        this(pool, radius, margin, CornerType.ALL);
    }

    public RoundedCornersTransformation(Context context, int radius, int margin,
                                        CornerType cornerType) {
        this(Glide.get(context).getBitmapPool(), radius, margin, cornerType);
    }

    public RoundedCornersTransformation(BitmapPool pool, int radius, int margin,
                                        CornerType cornerType) {
        mBitmapPool = pool;
        mRadius = radius;
        mDiameter = mRadius * 2;
        mMargin = margin;
        mCornerType = cornerType;
    }

    @NonNull
    @Override
    public Resource<Bitmap> transform(@NonNull Context context, @NonNull Resource<Bitmap> resource, int outWidth, int outHeight) {
        Bitmap source = resource.get();

        int width = source.getWidth();
        int height = source.getHeight();

        Bitmap bitmap = mBitmapPool.get(width, height, Bitmap.Config.ARGB_8888);
        if (bitmap == null) {
            bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
        }

        Canvas canvas = new Canvas(bitmap);
        Paint paint = new Paint();
        paint.setAntiAlias(true);
        paint.setShader(new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
        drawRoundRect(canvas, paint, width, height);
        return BitmapResource.obtain(bitmap, mBitmapPool);
    }

    private void drawRoundRect(Canvas canvas, Paint paint, float width, float height) {
        float right = width - mMargin;
        float bottom = height - mMargin;

        switch (mCornerType) {
            case TOP_LEFT:
                drawTopLeftRoundRect(canvas, paint, right, bottom);
                break;
            case TOP_RIGHT:
                drawTopRightRoundRect(canvas, paint, right, bottom);
                break;
            case BOTTOM_LEFT:
                drawBottomLeftRoundRect(canvas, paint, right, bottom);
                break;
            case BOTTOM_RIGHT:
                drawBottomRightRoundRect(canvas, paint, right, bottom);
                break;
            case TOP:
                drawTopRoundRect(canvas, paint, right, bottom);
                break;
            case BOTTOM:
                drawBottomRoundRect(canvas, paint, right, bottom);
                break;
            case LEFT:
                drawLeftRoundRect(canvas, paint, right, bottom);
                break;
            case RIGHT:
                drawRightRoundRect(canvas, paint, right, bottom);
                break;
            case OTHER_TOP_LEFT:
                drawOtherTopLeftRoundRect(canvas, paint, right, bottom);
                break;
            case OTHER_TOP_RIGHT:
                drawOtherTopRightRoundRect(canvas, paint, right, bottom);
                break;
            case OTHER_BOTTOM_LEFT:
                drawOtherBottomLeftRoundRect(canvas, paint, right, bottom);
                break;
            case OTHER_BOTTOM_RIGHT:
                drawOtherBottomRightRoundRect(canvas, paint, right, bottom);
                break;
            case DIAGONAL_FROM_TOP_LEFT:
                drawDiagonalFromTopLeftRoundRect(canvas, paint, right, bottom);
                break;
            case DIAGONAL_FROM_TOP_RIGHT:
                drawDiagonalFromTopRightRoundRect(canvas, paint, right, bottom);
                break;
            default:
                canvas.drawRoundRect(new RectF(mMargin, mMargin, right, bottom), mRadius, mRadius, paint);
                break;
        }
    }

    private void drawTopLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
        canvas.drawRoundRect(new RectF(mMargin, mMargin, mMargin + mDiameter, mMargin + mDiameter),
                mRadius, mRadius, paint);
        canvas.drawRect(new RectF(mMargin, mMargin + mRadius, mMargin + mRadius, bottom), paint);
        canvas.drawRect(new RectF(mMargin + mRadius, mMargin, right, bottom), paint);
    }

    private void drawTopRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
        canvas.drawRoundRect(new RectF(right - mDiameter, mMargin, right, mMargin + mDiameter), mRadius,
                mRadius, paint);
        canvas.drawRect(new RectF(mMargin, mMargin, right - mRadius, bottom), paint);
        canvas.drawRect(new RectF(right - mRadius, mMargin + mRadius, right, bottom), paint);
    }

    private void drawBottomLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
        canvas.drawRoundRect(new RectF(mMargin, bottom - mDiameter, mMargin + mDiameter, bottom),
                mRadius, mRadius, paint);
        canvas.drawRect(new RectF(mMargin, mMargin, mMargin + mDiameter, bottom - mRadius), paint);
        canvas.drawRect(new RectF(mMargin + mRadius, mMargin, right, bottom), paint);
    }

    private void drawBottomRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
        canvas.drawRoundRect(new RectF(right - mDiameter, bottom - mDiameter, right, bottom), mRadius,
                mRadius, paint);
        canvas.drawRect(new RectF(mMargin, mMargin, right - mRadius, bottom), paint);
        canvas.drawRect(new RectF(right - mRadius, mMargin, right, bottom - mRadius), paint);
    }

    private void drawTopRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
        canvas.drawRoundRect(new RectF(mMargin, mMargin, right, mMargin + mDiameter), mRadius, mRadius,
                paint);
        canvas.drawRect(new RectF(mMargin, mMargin + mRadius, right, bottom), paint);
    }

    private void drawBottomRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
        canvas.drawRoundRect(new RectF(mMargin, bottom - mDiameter, right, bottom), mRadius, mRadius,
                paint);
        canvas.drawRect(new RectF(mMargin, mMargin, right, bottom - mRadius), paint);
    }

    private void drawLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
        canvas.drawRoundRect(new RectF(mMargin, mMargin, mMargin + mDiameter, bottom), mRadius, mRadius,
                paint);
        canvas.drawRect(new RectF(mMargin + mRadius, mMargin, right, bottom), paint);
    }

    private void drawRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
        canvas.drawRoundRect(new RectF(right - mDiameter, mMargin, right, bottom), mRadius, mRadius,
                paint);
        canvas.drawRect(new RectF(mMargin, mMargin, right - mRadius, bottom), paint);
    }

    private void drawOtherTopLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
        canvas.drawRoundRect(new RectF(mMargin, bottom - mDiameter, right, bottom), mRadius, mRadius,
                paint);
        canvas.drawRoundRect(new RectF(right - mDiameter, mMargin, right, bottom), mRadius, mRadius,
                paint);
        canvas.drawRect(new RectF(mMargin, mMargin, right - mRadius, bottom - mRadius), paint);
    }

    private void drawOtherTopRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
        canvas.drawRoundRect(new RectF(mMargin, mMargin, mMargin + mDiameter, bottom), mRadius, mRadius,
                paint);
        canvas.drawRoundRect(new RectF(mMargin, bottom - mDiameter, right, bottom), mRadius, mRadius,
                paint);
        canvas.drawRect(new RectF(mMargin + mRadius, mMargin, right, bottom - mRadius), paint);
    }

    private void drawOtherBottomLeftRoundRect(Canvas canvas, Paint paint, float right, float bottom) {
        canvas.drawRoundRect(new RectF(mMargin, mMargin, right, mMargin + mDiameter), mRadius, mRadius,
                paint);
        canvas.drawRoundRect(new RectF(right - mDiameter, mMargin, right, bottom), mRadius, mRadius,
                paint);
        canvas.drawRect(new RectF(mMargin, mMargin + mRadius, right - mRadius, bottom), paint);
    }

    private void drawOtherBottomRightRoundRect(Canvas canvas, Paint paint, float right,
                                               float bottom) {
        canvas.drawRoundRect(new RectF(mMargin, mMargin, right, mMargin + mDiameter), mRadius, mRadius,
                paint);
        canvas.drawRoundRect(new RectF(mMargin, mMargin, mMargin + mDiameter, bottom), mRadius, mRadius,
                paint);
        canvas.drawRect(new RectF(mMargin + mRadius, mMargin + mRadius, right, bottom), paint);
    }

    private void drawDiagonalFromTopLeftRoundRect(Canvas canvas, Paint paint, float right,
                                                  float bottom) {
        canvas.drawRoundRect(new RectF(mMargin, mMargin, mMargin + mDiameter, mMargin + mDiameter),
                mRadius, mRadius, paint);
        canvas.drawRoundRect(new RectF(right - mDiameter, bottom - mDiameter, right, bottom), mRadius,
                mRadius, paint);
        canvas.drawRect(new RectF(mMargin, mMargin + mRadius, right - mDiameter, bottom), paint);
        canvas.drawRect(new RectF(mMargin + mDiameter, mMargin, right, bottom - mRadius), paint);
    }

    private void drawDiagonalFromTopRightRoundRect(Canvas canvas, Paint paint, float right,
                                                   float bottom) {
        canvas.drawRoundRect(new RectF(right - mDiameter, mMargin, right, mMargin + mDiameter), mRadius,
                mRadius, paint);
        canvas.drawRoundRect(new RectF(mMargin, bottom - mDiameter, mMargin + mDiameter, bottom),
                mRadius, mRadius, paint);
        canvas.drawRect(new RectF(mMargin, mMargin, right - mRadius, bottom - mRadius), paint);
        canvas.drawRect(new RectF(mMargin + mRadius, mMargin + mRadius, right, bottom), paint);
    }

    @Override
    public void updateDiskCacheKey(@NonNull MessageDigest messageDigest) {

    }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/161973.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

RK3399平台开发系列讲解(中断篇)ARM64异常处理详解

🚀返回专栏总目录 文章目录 一、异常级别二、异常分类三、异常向量表四、异常处理沉淀、分享、成长,让自己和他人都能有所收获!😄 一、异常级别 📢ARM64的处理器支持多个异常等级(exception level),其中EL0是用户模式,EL1是内核模式,也称为特权模式;EL2 是虚拟化…

算力狂热时代的冷静之道:宁畅总裁秦晓宁分享企业的算力最优解

算力是数字化时代的生产力之源&#xff0c;近年来已经成为共识。所以&#xff0c;我们能看到各个层面对算力的追逐&#xff0c;无论是国家层面的政策利好&#xff0c;算力基础设施建设的加速&#xff0c;还是诸多行业和企业积极地增加算力部署&#xff0c;呈现出一片如火如荼的…

958. 二叉树的完全性检验

958. 二叉树的完全性检验 难度中等 给定一个二叉树的 root &#xff0c;确定它是否是一个 完全二叉树 。 在一个 完全二叉树 中&#xff0c;除了最后一个关卡外&#xff0c;所有关卡都是完全被填满的&#xff0c;并且最后一个关卡中的所有节点都是尽可能靠左的。它可以包含 …

AWVS扫描Web应用程序

AWVS扫描Web应用程序 系列文章 AWVS安装与激活 1.账户密码登录扫描 我们准备了一个靶场用来做测试扫描&#xff1a; 1.点击【Targets】&#xff0c;点击【add Target】 2.输入扫描地址和扫描描述,点击【save】 3.点击【Site Login】 4.选择【try to auto-login into the si…

降本增效,软件质量是要降还是要升?

最近一年&#xff0c;裁员潮席卷而来&#xff0c;意味着许多企业经营遇到了很大困难&#xff0c;“降本增效”自然成了企业的主旋律&#xff1a;内部研发和运营要努力降低成本&#xff0c;外部市场想突出重围、开拓新局面&#xff0c;创造新营收&#xff0c;企业才能渡过难关&a…

DeViSE: A Deep Visual-Semantic Embedding Model

摘要 现代视觉识别系统受限于其能力为&#xff1a;扩大大规模数量的目标类别。 scale to large numbers of object categoriestext data :文本数据这篇文章我们提出一个a new deep visual-semantic embedding model从unannotated text 中收集的语义信息和有标签的图像数据。o…

经纬恒润荣膺2022年度中国港口协会科学技术奖一等奖!

近日&#xff0c;2022年度中国港口协会科学技术奖评终审答辩会在青岛圆满闭幕&#xff0c;经纬恒润和山东港口日照港集装箱发展有限公司共同申报的“顺岸开放式全自动化集装箱码头集卡无人驾驶关键技术研究和应用”获得2022年度中国港口协会科技进步奖一等奖。 中国港口协会科学…

[go]深入学习Go总结

Go 深入学习 文章目录Go 深入学习编译过程概念编译四阶段词法分析 语法分析类型检查中间代码生成机器码生成类型系统分类底层类型类型相同类型赋值类型强制转换类型方法自定义类型方法方法调用方法调用时的类型转换类型断言接口类型查询数据结构数组初始化访问和赋值切片数据结…

【Java】Java的面向对象笔记(上)(二)

再谈方法 Overload 重载 定义&#xff1a;在同一个类中&#xff0c;允许存在一个以上的同名方法&#xff0c;只要它们的参数个数或者参数类型不同即可。 两同一不同 同一个类、相同方法名参数列表不同&#xff1a;参数个数不同&#xff0c;参数类型不同&#xff0c;参数顺序不…

SpringBoot 数据源的自动配置HikariDataSource以及使用Druid数据源

目录 &#xff08;一&#xff09;、数据源的自动配置-HikariDataSource 1、导入JDBC场景 2、分析自动配置 3、修改配置项 4、测试 &#xff08;二&#xff09;、使用Druid数据源 1、druid官方github地址 2、自定义方式 3、使用官方starter方式 &#xff08;一&#xf…

汇编语言【王爽】实验一、二

实验一&#xff1a;查看CPU和内存&#xff0c;用机器指令和汇编指令编程 debug环境搭建&#xff1a;参考此文 assignment 1 用A命令向内存中写入汇编指令&#xff0c;用U命令查看 用R命令分别修改CS、IP寄存器&#xff0c;即CS:IP的指向&#xff0c;用T命令逐条执行 assignm…

小兔子在终端给大家拜年啦

小兔子在终端给大家拜年啦前言创作过程小兔子模型制作实现思路代码小结耐心和持久胜过激烈和狂热。 哈喽大家好&#xff0c;我是陈明勇&#xff0c;本文分享的内容是 使用 Go 语言实现小兔子在终端给大家拜年。如果觉得作品有趣&#xff0c;不妨点个赞&#xff0c;如果本文有错…

【学习笔记】决策树 (1.简介+基本构建思想)

简单问题引入 如何判断今天是什么季节&#xff1f;春天、夏天、秋天、冬天&#xff1f; 如果是我们的话&#xff0c;可以通过日期一下子知道今天的季节——“7月份&#xff0c;所以是夏天&#xff01;”大概是这样的发言。 但如果不让你通过日期来判断呢&#xff1f;选择还是…

摸鱼快报:golang net/http中的雕虫小技

以后会开一个板块&#xff0c;摸鱼快报&#xff0c;快速记录这几周开发中雕虫小技&#xff0c; 也算一个错题集。1. 向开发环境localhost:3000种植cookie前端使用Create React App脚手架&#xff0c;默认以localhost:3000端口启动&#xff1b;后端使用golang-gin框架&#xff0…

python在多卡服务器中指定某块显卡允许程序 -- 本机为mac,服务器为Linux, nvidia

1 在pychram环境变量中设置 在pycharm端操作&#xff0c;操作步骤如下&#xff1a; &#xff08;1&#xff09;操作右上角&#xff1a;Edit Configurations... (2)在 Edit Configurations界面可以选择设置哪个程序的cuda&#xff0c;如图&#xff1a; &#xff08;3&#xff0…

java基于ssm框架开发的视频论坛网站源码

简介 Java基于ssm开发的视频论坛网站&#xff0c;普通用户可以浏览视频搜索视频评论点赞收藏视频&#xff0c;关注用户。还可以浏览新闻&#xff0c;发布帖子到论坛。 演示视频 https://www.bilibili.com/video/BV15T4y1P7kk/?p2&share_sourcecopy_web&vd_sourceed0…

【阶段三】Python机器学习24篇:机器学习项目实战:XGBoost回归模型

本篇的思维导图: 项目实战(XGBoost回归模型) 项目背景 为了降低不良贷款率,保障自身资金安全,提高风险控制水平,银行等金融机构会根据客户的信用历史资料构建信用评分卡模型给客户评分。根据客户的信用得分,可以预估客户按时还款的可能性,并据此决定是否发放贷款…

DX-BT18 双模蓝牙模块介绍

DX-BT18双模蓝牙模块简介DX-BT18 双模蓝牙模块是深圳大夏龙雀科技有限公司专为智能无线数据传输而打造&#xff0c;遵循蓝牙4.2标准协议的双模蓝牙模块&#xff08;Dual-Mode&#xff09; 同时支持 BT3.0 Classic 和 BT4.2 BLE模式。 DX-BT18模块应用于无线数据传输领域&#x…

72.全卷积神经网络(FCN)及代码实现

语义分割是对图像中的每个像素分类。 全卷积网络&#xff08;fully convolutional network&#xff0c;FCN&#xff09;采用卷积神经网络实现了从图像像素到像素类别的变换 。 与我们之前在图像分类或目标检测部分介绍的卷积神经网络不同&#xff0c;全卷积网络将中间层特征图的…

【正点原子FPGA连载】 第十九章 LED灯闪烁实验 摘自【正点原子】DFZU2EG/4EV MPSoC 之FPGA开发指南V1.0

1&#xff09;实验平台&#xff1a;正点原子MPSoC开发板 2&#xff09;平台购买地址&#xff1a;https://detail.tmall.com/item.htm?id692450874670 3&#xff09;全套实验源码手册视频下载地址&#xff1a; http://www.openedv.com/thread-340252-1-1.html 第十九章 LED灯闪…