![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1065855/image.png)
Fusing one rgb image with one grayscale image using imfuse function
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I used imfuse to combine one rgb image with one grayscale image. After fusing, the rgb image became dimmer. Please suggest how I can increase the intensity of the rgb image.
I used final_image=imfuse(image_rgb, image_gray, 'blend');
0 comentarios
Respuesta aceptada
DGM
el 14 de Jul. de 2022
Editada: DGM
el 14 de Jul. de 2022
The contribution of either image is reduced by half, because that's what a 50% opacity blend is. It's the simple arithmetic mean of two images. Imfuse() can't do any other proportion. It's a simple, inflexible visual comparison tool, not an image composition tool.
Assuming that your images have the same page geometry, and assuming you're using R2016b or newer:
A = imread('cameraman.tif'); % single-channel
B = imread('cmantifBG.png'); % RGB
alph = 0.3;
blended = alph*im2double(A) + (1-alph)*im2double(B);
blended = im2uint8(blended);
montage({A B blended})
If you want something other than simple linear alpha blending, you'll have to elaborate with an example image and a description of what the output should look like.
There are other methods of combining two images, but what's appropriate depends on the object contrast/polarity and which objects are important.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1065855/image.png)
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!