Superposed Two Images with Different Sizes on a Single Plot

2 ビュー (過去 30 日間)
Karry Li
Karry Li 2015 年 7 月 21 日
編集済み: Cedric 2015 年 7 月 21 日
Hi, can anyone help me to make the center of the slit of the green image be at the same spot of the pink one? And also how to change the pink color to be gray-scale white. Here is the code.
close all
A = imcomplement(rgb2gray(imread('flag.png')));
matrixPlot1 = matrixPlot;
matrixPlot1(matrixPlot<80) = 0;
% matrixPlot(matrixPlot>50) = 255;
B = matrixPlot1;
C = imfuse(A,B);
imshow(C)

回答 (1 件)

Image Analyst
Image Analyst 2015 年 7 月 21 日
Try imfuse() or imshowpair().
  2 件のコメント
Karry Li
Karry Li 2015 年 7 月 21 日
Thanks so much. Now I'm posting some new questions in the post.
Image Analyst
Image Analyst 2015 年 7 月 21 日
In the future, just leave the original question and post new question(s) separately. Now, no one knows what I answered. But since I apparently answered it correctly, can you mark it as Accepted?
For the new question, I'd use regionprops to find the centroid of the shapes, and then use circshift() to shift the centroid from the actual centroid location to the desired centroid location. See my Image Segmentation Tutorial if you need a tutorial in how to get centroid from regionprops(): http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by