フィルターのクリア

I have to plot some lines over an image. Lines are rotated, so to align them with image I used camroll(-90). But now the whole image is rotated.

2 ビュー (過去 30 日間)
Here is my code:
U = load('C:\Users\khan1\jupyter_test_code\CRBD\TMGEM results\crop_row_001.tmg');
O = imread('C:\Users\khan1\jupyter_test_code\CRBD\Images\crop_row_001.JPG');
h1 = figure;
imshow(O);
figure(h1)
ax = gca;hold on;
plot(ax,U,'color','red','LineWidth',1);
camroll(ax,-90);
Here is the output I am getting. As you can see, lines are not aligned with the green leaves.
Link for .tmg and .jpg files:
https://drive.google.com/open?id=1dIMlWPMGYuv9QAox24UQ4dLAyyTVfXsb
  2 件のコメント
Ameer Hamza
Ameer Hamza 2020 年 4 月 16 日
How do you want to rotate the line? DO you want to make them horizontal?
md khan
md khan 2020 年 4 月 16 日
Yes. The lines should be over the green leaves. @Ameer

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

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 4 月 16 日
Use the rotate function to just rotate the axis while keeping the figure at its location: https://www.mathworks.com/help/matlab/ref/rotate.html
U = load('C:\Users\khan1\jupyter_test_code\CRBD\TMGEM results\crop_row_001.tmg');
O = imread('C:\Users\khan1\jupyter_test_code\CRBD\Images\crop_row_001.JPG');
h1 = figure;
imshow(O);
figure(h1)
ax = gca;hold on;
p = plot(ax,U,'color','red','LineWidth',1);
rotate(p, [0 0 1], -90);
If there is some issue, attach the image and variable 'U' in a .mat file.
  6 件のコメント
md khan
md khan 2020 年 4 月 16 日
Hey, this worked!! :) Thanks a lot.

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

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by