matlab图片测量尺寸_如何在MATLAB中测量图像的旋转?

在MATLAB中,可以通过检测彩色矩形的角落并使用CP2TFORM函数推断图像间的变换来测量图像的旋转角度。该方法首先将原始图像和旋转后的图像转化为二值图像,然后找出角落点,通过非反射相似变换计算旋转角度。
摘要由CSDN通过智能技术生成

I have two images. One is the original, and the another is rotated.

Now, I need to discover the angle that the image was rotated. Until now, I thought about discovering the centroids of each color (as every image I will use has squares with colors in it) and use it to discover how much the image was rotated, but I failed.

I'm using this to discover the centroids and the color in the higher square in the image:

i = rgb2gray(img);

bw = im2bw(i,0.01);

s = regionprops(bw,'Centroid');

centroids = cat(1, s.Centroid);

colors = impixel(img,centroids(1),centroids(2));

top = max(centroids);

topcolor = impixel(img,top(1),top(2));

解决方案

You can detect the corners of one of the colored rectangles in both the image and the rotated version,

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值