How to replace image portion with processed image?

2 visualizaciones (últimos 30 días)
rupam baruah
rupam baruah el 9 de Dic. de 2015
Comentada: Image Analyst el 24 de Nov. de 2018
I have one rgb image. I crop one portion by using imcrop function. After lots of processing I want to place that processed portion into the same place of the orginal image. How can I do that. I tried by using imfusion but its not worked.

Respuesta aceptada

Image Analyst
Image Analyst el 9 de Dic. de 2015
Since you cropped it, you know what the starting and stopping rows and columns are. So just assign:
originalImage(row1:row2, col1:col2, :) = processedImage;
  4 comentarios
rupam baruah
rupam baruah el 9 de Dic. de 2015
Yes. I got it. Thank you Sir.
Subhadeep Koley
Subhadeep Koley el 8 de Feb. de 2018
Thank you Image Analyst

Iniciar sesión para comentar.

Más respuestas (1)

Gosselin Thibault
Gosselin Thibault el 12 de Jul. de 2018
Hello everybody ! Sorry to view this long date post only but i've the same problem and your solution don't work on my program.
I have this error message : "Unable to perform assignment because the size of the left side is 118-by-325 and the size of the right side is 912-by-1200."
for this line code : Icrop1(row1:row2, col1:col2) = I;
Thank you for your help !!
  4 comentarios
Duyen Ho
Duyen Ho el 24 de Nov. de 2018
how did you fix the problem? im getting the same error
Image Analyst
Image Analyst el 24 de Nov. de 2018
He said he had
processedImage(row1:row2, col1:col2, :) = originalImage;
when he should have had
originalImage(row1:row2, col1:col2, :) = processedImage;
like I said. When he "interchanged the originalImage and the processedImage" he got my code and it worked. In short, the bigger matrix is on the left, and the smaller submatrix is on the right.

Iniciar sesión para comentar.

Categorías

Más información sobre Images 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