久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

簡(jiǎn)單的物體識(shí)別

Simple object recognition(簡(jiǎn)單的物體識(shí)別)
本文介紹了簡(jiǎn)單的物體識(shí)別的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

問(wèn)題描述

===已解決===

感謝您的建議和意見(jiàn).通過(guò)研究 Beginning Python Visualization 一書(shū)(第 9 章 - 圖像處理)中給出的 flood_fill 算法) 我已經(jīng)實(shí)現(xiàn)了我想要的.我可以計(jì)算對(duì)象,獲取每個(gè)對(duì)象的封閉矩形(因此是高度和寬度),最后可以為每個(gè)對(duì)象構(gòu)造 NumPy 數(shù)組或矩陣.

Thanks for your suggestions and comments. By working on the flood_fill algorithm given in Beginning Python Visualization book (Chapter 9 - Image Processing) I have implemented what I have wanted. I can count the objects, get enclosing rectangles for each object (therefore height and widths), and lastly can construct NumPy arrays or matrices for each of them.

雖然它不是一種優(yōu)化的方法,但它可以滿(mǎn)足我的需求.我使用的源代碼 (lab2.py) 和 png 文件 (lab2-particles.png) 已放在 http://code.google.com/p/ccnworks/source/browse/#svn/trunk/AtSc450.

Although it is not an optimized approach it does what I want. The source code (lab2.py) and the png file (lab2-particles.png) that I use have been put under http://code.google.com/p/ccnworks/source/browse/#svn/trunk/AtSc450.

您需要安裝 NumPy 和 PIL,并使用 matplotlib 來(lái)查看直方圖.代碼的核心位于 objfind 函數(shù)中,主要的遞歸對(duì)象搜索動(dòng)作發(fā)生在該函數(shù)中.

You need NumPy and PIL installed, and matplotlib to see the histogram. Core of the code lies within the objfind function where the main recursive object search action occurs.

進(jìn)一步更新:

SciPy 的 ndimage.label() 也完全符合我的要求.

SciPy's ndimage.label() does exactly what I want, too.

為 NumPy 和 SciPy 郵件列表中的 David-Warde FarleyZachary Pincus 歡呼:)

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

=============

你好,

我有一張圖像,其中包含由粒子光譜儀測(cè)量的冰粒子的陰影.我希望能夠識(shí)別每個(gè)對(duì)象,以便以后可以在計(jì)算中進(jìn)一步分類(lèi)和使用它們.

I have an image that contains the shadows of ice particles measured by a particle spectrometer. I want to be able to identify each object, so that I can later classify and use them further in my calculations.

本質(zhì)上,我愿意做的是簡(jiǎn)單地實(shí)現(xiàn)一個(gè)模糊選擇工具,在這里我可以簡(jiǎn)單地選擇每個(gè)實(shí)體.

In essence, what I am willing to do is to simply implement a fuzzy selection tool where I can simply select each entity.

我怎樣才能輕松解決這個(gè)問(wèn)題?(最好使用 Python)

How could I easily solve this problem? (Preferably using Python)

謝謝.

注意:在我的問(wèn)題中,我將每個(gè)特定的連接像素稱(chēng)為對(duì)象或?qū)嶓w.我打算提取它們并創(chuàng)建 NumPy 數(shù)組表示,如下所示.(這里我使用左上角的對(duì)象;如果存在像素,則使用 1,如果不使用 0.該對(duì)象的形狀是 3 x 3,對(duì)應(yīng)的 3 像素高 x 3 像素寬.這些是真實(shí)冰粒子在 2D 域上的投影, 假設(shè)它們是球形的,等效半徑為 (height+width)/2,之后會(huì)進(jìn)行一些縮放——從像素到實(shí)際大小和體積計(jì)算)

NOTE: In my question I am referring to each specific connected pixels as objects or entities. My intention to extract them and create NumPy array representations as shown below. (Here I am using the top-left object; if a pixel exist use 1's if not use 0's. This object's shape is 3 by 3 which correspondingly 3 pixel height by 3 pixel width. These are projections of real ice-particles onto 2D domain, under the assumption of their being spherical and equivalent radius is (height+width)/2, and later some scalings --from pixels to actual sizes and volume calculations will follow)

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]])

這是我將要使用的圖片中的一部??分.

Here is a section from the image which I am going to use.

截圖 http://img43.imageshack.us/img43/2327/particles.png

推薦答案

  1. 掃描每個(gè)方格(例如從左上角、從左到右、從上到下)

  1. Scan every square (e.g. from the top-left, left-to-right, top-to-bottom)

當(dāng)你擊中一個(gè)藍(lán)色方塊時(shí):

When you hit a blue square then:

一個(gè).將此方格記錄為新對(duì)象的位置

a. Record this square as a location of a new object

b.找到所有其他相鄰的藍(lán)色方塊(例如通過(guò)查看該方塊的鄰居以及這些鄰居的鄰居等)并將它們標(biāo)記為同一對(duì)象的一部分

b. Find all the other contiguous blue squares (e.g. by looking at the neighbours of this square, and the neighbours of those neighbours, etc.) and mark them as being part of the same object

繼續(xù)掃描

當(dāng)你找到另一個(gè)藍(lán)色方塊時(shí),在進(jìn)行第 2 步之前測(cè)試它是否是已知對(duì)象的一部分;或者,在步驟 2b 中,將任何正方形與對(duì)象關(guān)聯(lián)后擦除它

When you find another blue square, test to see whether it's part of a known object before going to step 2; alternatively in step 2b, erase any square after you've associated it with an object

這篇關(guān)于簡(jiǎn)單的物體識(shí)別的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How to draw a rectangle around a region of interest in python(如何在python中的感興趣區(qū)域周?chē)L制一個(gè)矩形)
How can I detect and track people using OpenCV?(如何使用 OpenCV 檢測(cè)和跟蹤人員?)
How to apply threshold within multiple rectangular bounding boxes in an image?(如何在圖像的多個(gè)矩形邊界框中應(yīng)用閾值?)
How can I download a specific part of Coco Dataset?(如何下載 Coco Dataset 的特定部分?)
Detect image orientation angle based on text direction(根據(jù)文本方向檢測(cè)圖像方向角度)
Detect centre and angle of rectangles in an image using Opencv(使用 Opencv 檢測(cè)圖像中矩形的中心和角度)
主站蜘蛛池模板: 四虎免费视频 | 亚洲欧美一区二区三区情侣bbw | 亚洲人a| 中文字幕免费视频 | 成年人视频在线免费观看 | 日韩精品在线一区 | 成人av一区二区三区 | 在线观看国产视频 | 影音av| 日本不卡一区二区三区 | 99这里只有精品视频 | 精品视频一区二区 | 国产成人网| 国产一级电影在线 | 成人精品视频在线 | 色爱综合| av综合站| 亚洲午夜在线 | 亚洲欧洲在线视频 | 午夜视频在线观看视频 | av中文在线 | 国精日本亚洲欧州国产中文久久 | 国产一区二区a | 久久国产电影 | 蜜桃在线一区二区三区 | 超碰在线免费公开 | 日韩高清www| 欧美在线天堂 | 自拍偷拍亚洲一区 | 久久网一区二区三区 | 黄色一级大片在线免费看产 | 欧美成人a∨高清免费观看 老司机午夜性大片 | 久久久久久亚洲精品 | 国精久久 | 99亚洲精品| 亚洲欧美综合精品久久成人 | 午夜免费精品视频 | 伊人免费观看视频 | 久久黄色精品视频 | 久久精品亚洲精品国产欧美 | av在线电影网 |