• 大小: 3KB
    文件类型: .m
    金币: 1
    下载: 0 次
    发布日期: 2021-05-12
  • 语言: Matlab
  • 标签: 目标定位  matlab  

资源简介

基于matlab的图像目标定位,可以得到该图像的像素颜色变化明显的点的坐标。

资源截图

代码片段和文件信息

clearclose all;
clc;
points = [2552.52852.52606.52894.52156.52168.52480.5;2727.52391.52559.52217.52409.52235.51959.5];
P1 = [points(11) points(21)];
P2 = [points(12) points(22)];
Pixel_D = norm(P1 - P2‘fro‘); Real_D = 300*sqrt(2);
global rate;
rate = Real_D / Pixel_D; 
vanishPoint1_x = (points(11)*points(23)-points(21)*points(13))*(points(14)-points(17)) - (points(14)*points(27) - points(17)*points(24))*(points(11) - points(13));
tmp1 = ((points(24) - points(27))* (points(11) - points(13)) - (points(21) - points(23))*(points(14) - points(17)));
vanishPoint1_x = vanishPoint1_x / tmp1;
vanishPoint1_y = vanishPoint1_x * (points(24) - points(27)) + points(14)*points(27) - points(17)*points(24);
vanishPoint1_y = vanishPoint1_y / (points(14) - points(17));
vanishPoint2_x = (points(17)*points(23)-points(27)*points(13))*(points(14)-points(12)) - (points(14)*points(22) - points(12)*points(24))*(points(17) - points(13));
tmp2 = ((points(24) - points(22))* (points(17) - points(13)) - (points(27) - points(23))*(points(14) - points(12)));
vanishPoint2_x = vanishPoint2_x / tmp2;
vanishPoint2_y = vanishPoint2_x * (points(24) - points(22)) + points(14)*points(22) - points(12)*points(24);
vanishPoint2_y = vanishPoint2_y / (points(14) - points(12));
v_V1 = [vanishPoint1_x vanishPoint1_y];
v_V2 = [vanishPoint2_x vanishPoint2_y];

评论

共有 条评论