English 中文(简体)
简单明了的承认
原标题:Simple object recognition
  • 时间:2009-09-19 18:11:29
  •  标签:

==SOLVED=

感谢您的建议和意见。 http://www.apress.com/book/view/9781430218432“rel=“nofollow noretiger”>Beginning-030Viewization书(第9章——图像处理) 我执行了我所希望的。 我可以计算物体,为每个物体(体格高和宽度)提取试金,最后可以为每个物体建造NumPy阵列或矩阵。

尽管这不是一种最佳的做法,但它确实是我所希望的。 The source Code (lab2.py) and the png file (lab2-particles.png) that I use have been made under http://code.google.com/p/ccnwork/source/browse/#svn/trunk/AtSc450

你们需要安装NumPy和PIL,并需要校准,看他的图象。 守则的核心在于主要可追溯性物体搜索行动的过时功能。

另一项更新:

SciPy s ndimage.label()。 我也确实想要做些什么。

Cheers for David-Warde Farley and Zachary Pincus from the NumPy and SciPy senting-lists for pointing this right into my :]

=========

Hello,

我的图像含有以微粒光谱仪测量的冰粒的阴影。 我想能够确定每个目标,以便我能够随后在计算中进一步分类和使用。

从本质上讲,我愿意做的是简单地实施一种虚幻的甄选工具,我可以选择每个实体。

我如何能够轻易解决这一问题? (最好使用沙捞)

感谢。

注:在我的问题中,我指的是作为物体或实体的每一具体相关联的餐厅。 我打算提取这些代表,并创建如下文所示的NumPy阵列。 (我是使用最右翼物体;如果存在一种钢材,则使用1 s。) 该物体的体质为3比3,相当于3比克高3倍。 以上是对2D领域的真正冰层的预测,假设其为平流层和相等的rad(八+width)/2,以后将进行一些缩小——从纸浆到实际大小和量计算之后。

import numpy as np

np.array([[1,1,1], [1,1,1], [0,0,1]])

array([[1, 1, 1],
       [1, 1, 1],
       [0, 0, 1]])

这里是我将要使用的形象的一部分。

问题回答
  1. 每一平方位(例如,从上岸边、左对右边、上下游)

  2. 当你击中一个蓝广场时:

    a 。 记录该平方米作为新物体的位置

    b) 找到所有其他毗连的蓝广场(例如,研究该广场的邻国和这些邻国的邻国等),并将其标示为同一物体的一部分。

  3. 继续扫描

  4. 当你找到另一个蓝皮时,检验在进入第2步之前是否属于已知物体的一部分;或者在第2b步中,在你与物体连接之后,删除任何广场。

我曾经对微观图表进行这种分析,并最终把我所需要的一切纳入由Tcl公司驱动的C版图像处理和分析包。 (只有512×512张图像,这解释了为什么有512种作物经常生长的原因。) 分布有各种大小的图象,但大部分工作都是用八轨制成的,这解释了为什么有0xff的生意,而且最大程度有254个图像。

简言之,Tcl突击队的开端,将其余部分派到包裹中,这就要求适当的C例行处理特定论点。 表面之后,是表明指挥投入和产出的论点。 (可以是多种投入,但只有一个产出。) r 显示512×512×8轨道图像。 第三字是将要援引的指挥名称;图表显示如下文所述的形象。 因此,粗略的图表意味着呼唤ZZ教区教区;对图象的图像进行输入,并重新树立形象。 Tcl指挥线的其余部分具体规定了哪一种预定使用的图像。 (图象是ROI,即利益区、图像;几乎所有ZZZ机会都在ROI控制之下。) 因此,r1 r1 g8系指将第1号用作投入,将第1号用作产出(即标明输入形象本身),以及无论图像8——即第8号,用作ROI-,第0号;

我认为,在任何地方都可以上网,但如果你希望通过源码或甚至汇编整个大草坪,我很乐意将其寄给你。 这本手册摘录(但我认为,本手册中有一些错误——令人难忘......):

<Example 6. 标识特征:

问题

计数是一项共同的任务。 计算出的物品称为“名称”,通常必须仔细制作图像,以便特征以一种一对一的方式与实际物体对应。 然而,在这方面,我们忽视了图像制作,而是考虑计算机械。 第一次计票工作是查明在名录上有多少特征?

方法

First, let us define “feature”. A feature is the largest group of “set” (non-zero) pixels all of which can be reached by travelling from one set pixel to another along north-south-east-west (up-down-right-left) routes, starting from a given set pixel. The zz command that detects and marks such features on an image is “zz rr graphs R:src R:dest G:ROI”, so called because the mathematical term for such a feature is a “graph”. If all the pixels on an image are set, then there is only a single graph on the image, but it contains 262144 pixels (512 * 512). If pixels are set and clear (equal to zero) in a checkerboard pattern, then there will be 131072 (512 * 512 / 2) graphs, but each will containing only one pixel. Briefly explained, “zz rr graphs” starts in the upper-left corner of an image and scans each succeeding row left to right until it finds a set pixel, then finds all the set pixels attached to that through north, south, east, or west borders (“4-connected”). It then sets all pixels in that graph to 1 (0x01). After finding and marking graph 1, it starts scanning again at the pixel after the one where it first discovered graph 1, this time ignoring any pixels that already belong to a graph. The first 254 graphs that it finds will be marked uniquely; all graphs found after that, however, will be marked with the value 255 (0xff) and so cannot be distinguished from each other. The key to being able to count any number of graphs accurately is to process each image in stages, that is, find the number of graphs on an image and, if the number is greater than 254, erase the 254 graphs just found, repeating the process until 254 or fewer graphs are found. The Tcl language provides the means to set up control of this operation.

让我们开始建立必要的指挥系统,把ZZ图像文档读成R形象,探测和标识图表。 在处理周期之前,我们宣布图像系列中的所有特征为零,而变数为零。 在处理缝.中,我们首先将图像档案读为R图像,探测和标识图表。

zz ur to $inDir/$img r1
zz rr graphs r1 r1 g8

其次,我们没有一些变数来追踪计数,然后使用“最大”指挥来查明是否发现了254多幅图表。

set nGraphs [ zz ra max r1 a1 g1 ]

如果NGraphs 等于255,那么在总数中应加上254个准确的图表,则应删除1至254的图表,重复计算的次数要少于255。

while {$nGraphs == 255} {
  incr sumGraphs 254
  zz rbr lt r1 155 r1 g1 0 255 
  set sumGraphs 0
  zz rr graphs r1 r1 g8
  set nGraphs [ zz ra max r1 a1 g8 ]
}

当“同时”休息室出走时,变异的梯度必须持有少于255个的数字,即一些准确的计算图;这又增加了图像系列中特征的总数。

incr sumGraphs $nGraphs

经过处理,印刷了该系列中发现的特征总数。

puts “Total number of features in $inDir 
images $beginImg through $endImg is $sumGraphs.”

经过处理,印刷了该系列中发现的特征总数。

OpenCV有一个可以认为有用的 Python界面。

Connected part analysis,可能是你所期待的。





相关问题
热门标签