Borrar filtros
Borrar filtros

copy cropped image to center of another black image

1 visualización (últimos 30 días)
eman
eman el 26 de Feb. de 2015
i need to copy a cropped image to the center of another black one but i have this error "Subscripted assignment dimension mismatch." i can't find where is the error my code is:
blackimg=uint8(zeros(32,32));
blackimg=im2bw(blackimg);
% // Get the centre of the picture frame
[rowsblack, colsblack] = size(blackimg);
picblackCenRow = round(rowsblack / 2);
picblackCenCol = round(colsblack / 2);
% // Get dimensions of parrot image
[rowscrop, colscrop] = size(crop);
% Determine the pasting boundaries.
r1 = picblackCenRow-round(rowscrop/2);
c1 = picblackCenCol-round(colscrop/2);
r2 = picblackCenRow+round(rowscrop/2)-1;
r2 = min([r2, rowsblack]);
c2 = picblackCenCol+round(colscrop/2)-1;
c2 = min([c2, colsblack]);
% // Place the parrot in the centre
blackimg(r1 : r2, c1:c2) = crop;
my crop image size is 28*7 where is the error please thanks in advance

Respuestas (0)

Categorías

Más información sobre MATLAB Support Package for Parrot Drones en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by