How to assign a image into a shape 1?

1 view (last 30 days)
Selva Karna
Selva Karna on 29 Jan 2018
Answered: KSSV on 29 Jan 2018
How to assign a image into a shape 1?

Answers (2)

Walter Roberson
Walter Roberson on 29 Jan 2018
If you only need this for display purposes, then you can create a surface() or patch() object that are configured to texturemap . That allows you to map the rectangular image into an arbitrary shape such as the small triangle you show.
If you need to store the entire image into that small triangular area, you are going to need to use interp2() to interpolate some projection and store at the appropriate locations.
If you are trying to point out the entire inner green rectangle, then imresize() the image to match the size available and assign the result to the appropriate locations in the new image.

KSSV
KSSV on 29 Jan 2018
Read the image using imread.....you should be having the coordinates of the rectangle inside which you need to fit the image......let x0,x1 and y0, y1 be the min and max x and y values. USe:
image([x0 x1],[y0 y1],I) ;

Community Treasure Hunt

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

Start Hunting!