Save plot as logical matrix array with same dimensions as original?
古いコメントを表示
I am plotting an outline on a logical matrix array and need to resave as the same filetype w/ same dimensions including outline.
Any Advice?
回答 (1 件)
J. Alex Lee
2021 年 2 月 17 日
0 投票
are you looking for imwrite()? or some combination of getframe(), frame2im(), and imwrite()?
4 件のコメント
Walter Roberson
2021 年 2 月 17 日
Or if you have Computer Vision Toolbox, do the plotting by using insertShape() .
Note: the output of insertShape() is RGB even if the input is not, so you will need to convert to logical afterwards.
Theodore Fisher
2021 年 2 月 18 日
Theodore Fisher
2021 年 2 月 18 日
J. Alex Lee
2021 年 2 月 18 日
oh, if the issue is "original dimensions", I guess you need to make sure (if not using CVT) that the image is being "displayed" on your "axes" at 1:1 pixel resolution of the original image. You can set that up by ensuring your figure is at least as large as your image and axes is exactly the same size, by setting the figure's "Units" property to "pixels" and settin the "Position" property appropriately. In the past I've had to adjust the pixel size by +/- 1 pixels to get frame2im to output the right size.
カテゴリ
ヘルプ センター および File Exchange で Image Arithmetic についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!