【问题标题】:imtranslate command matlab show me a black imageimtranslate 命令 matlab 显示黑色图像
【发布时间】:2019-01-14 10:27:14
【问题描述】:

我正在尝试翻译通过 imshow 函数读取的图像,但输出是黑色图像。

代码如下:

fingers=imread('thumb-index.png');

[nrows,ncols] = size(fingers);

RI = imref2d(size(fingers));
h = imshow(fingers,RI);
grid on

x_center=ncols/2;
y_center=nrows/2;

x_orig=ncols-x_center;
y_orig=nrows-y_center;

[fingers_translate,RF]=imtranslate(fingers,RI,[x_orig,y_orig]);
figure

h=imshow(fingers_translate,RI);
grid on 

我的目标是平移图像中心坐标系的原点。 谢谢!

【问题讨论】:

    标签: image matlab coordinates system


    【解决方案1】:

    您将图像推出了框架。看翻译效果试试:

    x_orig=100;
    y_orig=100;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-12
      • 2016-08-28
      • 2020-03-09
      • 2020-11-01
      • 2020-08-20
      • 2018-03-15
      相关资源
      最近更新 更多