当前位置:网站首页>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
边栏推荐
猜你喜欢
COMSOL -- establishment of geometric model -- establishment of two-dimensional graphics
iTOP-3568开发板NPU使用安装RKNN Toolkit Lite2
报错ModuleNotFoundError: No module named ‘cv2.aruco‘
【L1、L2、smooth L1三类损失函数】
Simply solve the problem that the node in the redis cluster cannot read data (error) moved
Principle of redis cluster mode
一次生产环境redis内存占用居高不下问题排查
Mmclassification training custom data
How to make your products as expensive as possible
【yolov3损失函数】
随机推荐
Principle of redis cluster mode
【yolov5.yaml解析】
1. Laravel creation project of PHP
Unity Xlua MonoProxy Mono代理类
Pytorch MLP
COMSOL -- 3D casual painting -- sweeping
POJ 3176 cow bowling (DP | memory search)
Dynamic SQL of ibatis
Redirection of redis cluster
《增长黑客》阅读笔记
《看完就懂系列》15个方法教你玩转字符串
COMSOL -- three-dimensional graphics random drawing -- rotation
一类恒等式的应用(范德蒙德卷积与超几何函数)
Liunx prohibit Ping explain the different usage of traceroute
pytorch-线性回归
【使用TensorRT通过ONNX部署Pytorch项目】
汉诺塔问题思路的证明
splunk配置163邮箱告警
阻止瀏覽器後退操作
Intern position selection and simplified career development planning in Internet companies