How to warp texture onto a part of an object (for example the cylinder) ?

2 ビュー (過去 30 日間)
Thao Do
Thao Do 2019 年 8 月 22 日
回答済み: Abhisek Pradhan 2019 年 8 月 30 日
I know there's warp command and how to warp a texture onto a cylinder
[X,Y,Z] = cylinder(imgRows,imgCols);
h = warp(X,Y,Z,imgRGB);
some time, if I only want to warp onto a part of the cylinder. I tried to use padding (white around) to make the texture bigger. But it's not in good shape.
also how to warp in perpendicular direction ? (context: I would like to create synthetic barcode printed on a cylinder shape metal can, normally, warp only gives me landscape placing on the cylinder, not portrait direction)
Thanks

採用された回答

Abhisek Pradhan
Abhisek Pradhan 2019 年 8 月 30 日
One possible workaround will be to rotate the image using imrotate and then use warp function for wrapping around the cylinder. Or make an image of required dimensions consisting of all the elements which you want to put around the cylinder and then warp it. This will ensure it is in good shape.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRead, Write, and Modify Image についてさらに検索

タグ

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by