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

2 views (last 30 days)
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

Accepted Answer

Abhisek Pradhan
Abhisek Pradhan on 30 Aug 2019
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.

More Answers (0)

Categories

Find more on Read, Write, and Modify Image in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

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

Start Hunting!