当前位置:网站首页>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
边栏推荐
- 【SingleShotMultiBoxDetector(SSD,单步多框目标检测)】
- yolov5目標檢測神經網絡——損失函數計算原理
- Codeforces Round #804 (Div. 2)
- Idea set the number of open file windows
- 一次生产环境redis内存占用居高不下问题排查
- 石油化工企业安全生产智能化管控系统平台建设思考和建议
- 跨平台(32bit和64bit)的 printf 格式符 %lld 输出64位的解决方式
- Use and install RkNN toolkit Lite2 on itop-3568 development board NPU
- [cloud native | kubernetes] actual battle of ingress case (13)
- [leetcode] wild card matching
猜你喜欢
随机推荐
Troubleshooting of high memory usage of redis in a production environment
Redis集群的重定向
【L1、L2、smooth L1三类损失函数】
ACID事务理论
11.(地图数据篇)OSM数据如何下载使用
splunk配置163邮箱告警
Wireless WiFi learning 8-channel transmitting remote control module
How to protect user privacy without password authentication?
查看rancher中debug端口信息,并做IDEA Remote Jvm Debug
[singleshotmultiboxdetector (SSD, single step multi frame target detection)]
你做自动化测试为什么总是失败?
COMSOL -- establishment of geometric model -- establishment of two-dimensional graphics
Multi table operation - Auto Association query
【Win11 多用户同时登录远程桌面配置方法】
Ncp1342 chip substitute pn8213 65W gallium nitride charger scheme
Linux Installation and deployment lamp (apache+mysql+php)
[pytorch modifies the pre training model: there is little difference between the measured loading pre training model and the random initialization of the model]
Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in
[untitled]
Yolov5 target detection neural network -- calculation principle of loss function