算法的研究的价值最长的一段时间在一个二维矩阵任意角度 [英] Algorithm for Finding Longest Stretch of a Value at any Angle in a 2D Matrix

查看:180
本文介绍了算法的研究的价值最长的一段时间在一个二维矩阵任意角度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前工作的原因,我需要确定图像中的颜色斑点的方向计算机视觉程序。颜色斑点通常如下的椭圆形状,因此可以用于跟踪方向(相对于最初定义/确定取向)通过时间

I am currently working on a computer-vision program that requires me to determine the "direction" of a color blob in an image. The color blob generally follows an elliptical shape and thus can be used to track direction (with respect to an initially defined/determined orientation) through time.

由我想我会计算方向的变化说明如下的方式:

The means by which I figured I would calculate changes in direction are described as follows:

  1. 在量子化可能的方向(360度)为N个方向(可能8,45度角为单位)。
  2. 在给定一个存储矩阵重新presenting的颜色斑点的初始状态(T0),还获得一个矩阵再presenting BLOB的当前状态(TN)。
  3. 在遍历这些N个方向,并搜索最长的一段时间对于给定方向的颜色值。 (例如,如果椭圆旋转45度,其中0是垂直的,最长的长度应归因于45度马克/或225度)。
  1. Quantize possible directions (360 degrees) into N directions (potentially 8, for 45 degree angle increments).
  2. Given a stored matrix representing the initial state (t0) of the color blob, also acquire a matrix representing the current state (tn) of the blob.
  3. Iterate through these N directions and search for the longest stretch of the color value for that given direction. (e.g. if the ellipse is rotated 45 degrees with 0 being vertical, the longest length should be attributed to the 45 degree mark / or 225 degrees).

这个概念本身并不复杂,但我在用下面的麻烦:

The concept itself isn't complicated, but I'm having trouble with the following:

  • 计算最长伸展的值在图像任意角度。这是为角度如0°,45,90等简单但更困难的在两者之间的角度。 量化的角度是不容易对我来说,因为它的声音。

请不要担心有区别的角度,如0到90惯性可以用来决定颜色斑点最可能的方向(换言之,根据以往的取向状态)潜在的问题。

Please do not worry about potential issue with distinguishing angles such as 0 and 90. Inertia can be used to determine the most likely direction of the color blob (in other words, based upon past orientation states).

我最关心的是确定了最长的一段的矩阵。

My main concern is identifying the "longest stretch" in the matrix.

感谢您的帮助!

推荐答案

您可以使用图像矩如下建议:的 Matlab的 - 影像动量计算

You can use image moments as suggested here: Matlab - Image Momentum Calculation.

在MATLAB你可以使用 regionprops 的属性定位,但在previous答案维基文章应该给你所有你需要的信息$ C C $它在你所选择的语言。

In matlab you would use regionprops with the property 'Orientation', but the wiki article in the previous answer should give you all of the information you need to code it in the language of your choice.

这篇关于算法的研究的价值最长的一段时间在一个二维矩阵任意角度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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