当前位置:网站首页>Matlab imoverlay function (burn binary mask into two-dimensional image)
Matlab imoverlay function (burn binary mask into two-dimensional image)
2022-07-05 11:58:00 【**inevitable**】
List of articles
grammar
B = imoverlay(A,BW)
B = imoverlay(A,BW,color)
explain
B = imoverlay(A,BW)
% Fill grayscale with solid color or RGB Images A, Where the binary mask is input BW by true.
B = imoverlay(A,BW,color)
% Appoint imoverlay The color used to fill the image .
Example
Burn binary images into grayscale images
% Read the grayscale image into the work area
A = imread('cameraman.tif');
figure(1)
imshow(A)

% Read binary image into work
BW = imread('text.png');
figure(2)
imshow(BW)

% Burn binary images into grayscale images , Specifies the color used for the binary mask .
B = imoverlay(A,BW,'yellow');
% Show results
figure(3)
imshow(B)

Burn binary images to RGB Images
% take RGB Image read into workspace
RGB = imread('peppers.png');
figure(1)
imshow(RGB)

% Read binary images into the workspace
BW = imread('text.png');
figure(2)
imshow(BW)

% tailoring RGB Images , Make it the same size as the binary mask
RGB_cropped = imcrop(RGB,[64,128,255,255]);
% Burn binary images as cropped RGB Images , Choose the color you want to use
B = imoverlay(RGB_cropped,BW,'red');
% Show results
figure(3)
imshow(B)

Cutting effect :
Input parameters
A : Input image
The input image , Specify as a two-dimensional grayscale image or two-dimensional RGB Images
data type :single | double | int16 | uint8 | uint16 | logical
BW: Mask image
Mask image , Specified two-dimensional binary matrix , Its size and image A The first two dimensions of are the same . For digital input , Any non-zero pixel is considered 1( really ).
data type : single | double | int8 | int16 | int32 | uint8 | uint16 | uint32 | logical
color: Color used for overlay
Color used for overlay , Designated as MATLAB Color specification . for example , If you want to specify red , You can use any of the following specifications :“ Red ”,“ r” or [1 0 0].
Output parameters
B: Output image
Output image , In two dimensions RGB Return in image form .
data type :uint8
边栏推荐
- 多表操作-子查询
- Open3D 网格(曲面)赋色
- leetcode:1200. Minimum absolute difference
- 【PyTorch预训练模型修改、增删特定层】
- [mainstream nivida graphics card deep learning / reinforcement learning /ai computing power summary]
- 【云原生 | Kubernetes篇】Ingress案例实战(十三)
- Sentinel sentinel mechanism of master automatic election in redis master-slave
- [crawler] bugs encountered by wasm
- 1 plug-in to handle advertisements in web pages
- Solve the grpc connection problem. Dial succeeds with transientfailure
猜你喜欢

pytorch-权重衰退(weight decay)和丢弃法(dropout)

【yolov5.yaml解析】

13. (map data) conversion between Baidu coordinate (bd09), national survey of China coordinate (Mars coordinate, gcj02), and WGS84 coordinate system

redis主从模式

redis的持久化机制原理

【TFLite, ONNX, CoreML, TensorRT Export】

简单解决redis cluster中从节点读取不了数据(error) MOVED

【L1、L2、smooth L1三类损失函数】

Redirection of redis cluster
The survey shows that traditional data security tools cannot resist blackmail software attacks in 60% of cases
随机推荐
Network five whip
redis的持久化机制原理
Redis cluster (master-slave) brain crack and solution
Solve the grpc connection problem. Dial succeeds with transientfailure
Open3D 网格(曲面)赋色
一次生产环境redis内存占用居高不下问题排查
redis 集群模式原理
pytorch-softmax回归
How can China Africa diamond accessory stones be inlaid to be safe and beautiful?
vscode快捷键
[upsampling method opencv interpolation]
Pytorch weight decay and dropout
[configuration method of win11 multi-user simultaneous login remote desktop]
1 plug-in to handle advertisements in web pages
【Win11 多用户同时登录远程桌面配置方法】
pytorch-权重衰退(weight decay)和丢弃法(dropout)
Multi table operation - sub query
yolov5目標檢測神經網絡——損失函數計算原理
Error modulenotfounderror: no module named 'cv2 aruco‘
COMSOL -- 3D casual painting -- sweeping