比较图像的两个坐标值 [英] Compare two coordinate values of an image

查看:98
本文介绍了比较图像的两个坐标值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组坐标值,我想将这些值相互比较.我想要x-min,x-max,y-min,y-max作为结果. 例如 : (10,40) 和 (20,30) 是两组值. 我想比较一下; 它应该是结果:

i have set of co-ordinate values and i want to compare these values with each other. I want x-min, x-max,y-min ,y-max as result. For example : (10,40) and (20,30) are two set of values. i want to compare them; it should be the result:

x-min=10
y-min=30
x-max=20
y-max=40

推荐答案

如果xy具有单独的数组,请参见@Andrey的答案. 如果您有一个类似

If you have separate arrays for x and y, see @Andrey's answer. If you have an array like

A = [x y] = [
    10 40
    20 30
    ..
    90 25];

然后使用此:

mins = min(A);
maxs = max(A); 

minX = mins(1);   maxX = maxs(1);
minY = mins(2);   maxY = maxs(2);

这篇关于比较图像的两个坐标值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆