Functions
>
Image Processing
>
Combinations of Images
> Example: Replacing a Part of an Image
Example: Replacing a Part of an Image
Use the
putregion
function to insert matrix
N
into matrix
M
at position
(row, col)
. Matrix
M
must be large enough to contain all of
N
when inserted at the given position.
For information on using this example, refer to
About Image Processing Examples
.
1.
Read in a starting image.
R
READ_IMAGE
camera.bmp
rows
R
256
cols
R
256
2.
Create a second image, smaller than the first.
N
submatrix
READ_IMAGE
mona.bmp
70
100
60
140
col
170
row
90
cols
N
81
rows
N
31
Make sure that
col
cols
N
1
250
is less than
cols
R
256
row
rows
N
1
120
is less than
rows
R
256
3.
Insert matrix
N
into
M
and view the resulting image:
C
putregion
R
N
row
col
DummyC
WRITEBMP
mona_in_camera.bmp
C
(camera.bmp)
(mona_in_camera.bmp)
Copy Expressions
Related TopicsĀ
Replacing a Part of an Image
Was this helpful?
This site works best with JavaScript enabled