Composite of multiple small images over a larger background image

1 回表示 (過去 30 日間)
Dries Weytjens
Dries Weytjens 2017 年 5 月 4 日
コメント済み: Dries Weytjens 2017 年 5 月 4 日
Hello everyone,
Allow me to concisely set the scene for my question. I am currently running a bunch of simulations that result in ternary composition diagrams using MATLAB. For the sake of comprehensiveness of the dataset I am making composites of images overlayed over a background. To be exact, I am using one background for every figure and am than inserting 66 smaller figures on certain locations in the figure.
For an example you can check the attached figure. As you can see, the smaller images require to be at exact spots in the larger image.
The figures are all generated in MATLAB and then saved as .png using the export_fig function.
Currently I am doing this operation in Powerpoint but it takes a very long time to complete one figure and it is also very repetitive. I would thus like to know if it is possible do automate this process using matlab, i.e. overlaying multiple figures at specified locations over a background figure...
Regards
Dries
  4 件のコメント
KSSV
KSSV 2017 年 5 月 4 日
How you got the image terncomp? How you have drawn it?
Dries Weytjens
Dries Weytjens 2017 年 5 月 4 日
編集済み: Dries Weytjens 2017 年 5 月 4 日
The terncomp image is downloaded from the internet but it can also be generated using a matlab script if this would be better, an example generated in Matlab is in the attachment.

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

採用された回答

KSSV
KSSV 2017 年 5 月 4 日
編集済み: KSSV 2017 年 5 月 4 日
If you have coordinates of the triangles in hand, it can be automated with ease....Check the below code...when figure is prompted click twice to cover a triangle as to get a bounding box. Click the points as to make a square which covers whole triangle. That clicked area will be filled by the small image. You can further take care of transparency on reading the documentation of how to show .png files.
[I,map] = imread('big.png') ;
Is = imread('small.png') ;
figure
image(I)
hold on
for i = 1:10
[x,y] = ginput(2) ;
image([x(1) x(2)] ,[y(1) y(2)],Is) ;
end
If the coordinates are in hand, instead of clicking the point limits can be incorporated to automate.
  2 件のコメント
Dries Weytjens
Dries Weytjens 2017 年 5 月 4 日
Thank you for this effort. I am checking on how I can get the background of the smaller figures to disappear but I am not finding concrete answers to this. What would you do for this? The figures were made using export_fig and the background have been deleted in this program.
KSSV
KSSV 2017 年 5 月 4 日
Use .jpg instead of .png.

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

その他の回答 (1 件)

Image Analyst
Image Analyst 2017 年 5 月 4 日
Here's the official Mathworks instructions for sending pictures from MATLAB to Powerpoint: https://www.mathworks.com/matlabcentral/answers/103175-how-can-i-create-slides-in-ms-powerpoint-2007-using-matlab-7-13-r2011b. It uses ActiveX. With ActiveX you can do virtually anything from MATLAB that you could do in Powerpoint itself. For example, specifying where on the slide the image should be put.
If you still want to go with the pasting small images onto a larger image, like KSSV suggested, and then inserting only one picture within Powerpoint, then see my attached copy and paste demo.
  1 件のコメント
Dries Weytjens
Dries Weytjens 2017 年 5 月 4 日
Thank you for your input. Unfortunately ActiveX will not be an option since I am using a Mac OS.

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by