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

在numpy中使用as_strided函數(shù)的滑動(dòng)窗口?

Sliding window using as_strided function in numpy?(在numpy中使用as_strided函數(shù)的滑動(dòng)窗口?)
本文介紹了在numpy中使用as_strided函數(shù)的滑動(dòng)窗口?的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

當(dāng)我開始使用 python 實(shí)現(xiàn)一個(gè)滑動(dòng)窗口來檢測(cè)靜止圖像中的對(duì)象時(shí),我開始了解這個(gè)不錯(cuò)的功能:

As I get to implement a sliding window using python to detect objects in still images, I get to know the nice function:

numpy.lib.stride_tricks.as_strided

所以我嘗試制定一個(gè)通用規(guī)則,以避免在更改我需要的滑動(dòng)窗口大小時(shí)可能會(huì)失敗的錯(cuò)誤.最后我得到了這個(gè)表示:

So I tried to achieve a general rule to avoid mistakes I may fail in while changing the size of the sliding windows I need. Finally I got this representation:

all_windows = as_strided(x,((x.shape[0] - xsize)/xstep ,(x.shape[1] - ysize)/ystep ,xsize,ysize), (x.strides[0]*xstep,x.strides[1]*ystep,x.strides[0],x.strides[1])

這會(huì)產(chǎn)生一個(gè) 4 暗矩陣.前兩個(gè)代表圖像的 x 和 y 軸上的窗口數(shù).其他的代表窗口的大小(xsize,ysize)

which results in a 4 dim matrix. The first two represents the number of windows on the x and y axis of the image. and the others represent the size of the window (xsize,ysize)

step代表兩個(gè)連續(xù)窗口之間的位移.

and the step represents the displacement from between two consecutive windows.

如果我選擇方形滑動(dòng)窗口,這種表示效果很好.但我仍然有一個(gè)問題要讓它適用于 e.x. 的 Windows.(128,64),我通常會(huì)在其中獲得與圖像無關(guān)的數(shù)據(jù).

This representation works fine if I choose a squared sliding windows. but still I have a problem in getting this to work for windows of e.x. (128,64), where I get usually unrelated data to the image.

我的代碼有什么問題.有任何想法嗎?是否有更好的方法在 python 中讓滑動(dòng)窗口美觀整潔地進(jìn)行圖像處理?

What is wrong my code. Any ideas? and if there is a better way to get a sliding windows nice and neat in python for image processing?

謝謝

推薦答案

查看這個(gè)問題的答案:使用步幅實(shí)現(xiàn)高效的移動(dòng)平均濾波器.基本上跨步不是一個(gè)很好的選擇,盡管它們有效.

Check out the answers to this question: Using strides for an efficient moving average filter. Basically strides are not a great option, although they work.

這篇關(guān)于在numpy中使用as_strided函數(shù)的滑動(dòng)窗口?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

How to draw a rectangle around a region of interest in python(如何在python中的感興趣區(qū)域周圍繪制一個(gè)矩形)
How can I detect and track people using OpenCV?(如何使用 OpenCV 檢測(cè)和跟蹤人員?)
How can I download a specific part of Coco Dataset?(如何下載 Coco Dataset 的特定部分?)
Detect centre and angle of rectangles in an image using Opencv(使用 Opencv 檢測(cè)圖像中矩形的中心和角度)
Calculating percentage of Bounding box overlap, for image detector evaluation(計(jì)算邊界框重疊的百分比,用于圖像檢測(cè)器評(píng)估)
How to merge lines after HoughLinesP?(如何在 HoughLinesP 之后合并行?)
主站蜘蛛池模板: 啪一啪 | 欧美日韩国产一区二区三区 | 国产成人综合av | 国产精品久久久久久久久久久久冷 | 天天艹日日干 | 欧美一区二区三区小说 | 欧美xxxx黑人又粗又长 | 亚洲视频 欧美视频 | 日韩视频精品 | 国产馆| 91激情视频 | 日韩www视频 | 精产嫩模国品一二三区 | 亚洲婷婷一区 | 国产精品一区二区久久 | 中文字字幕一区二区三区四区五区 | 欧美精品一区二区在线观看 | 久久机热 | 日韩精品在线观看视频 | 色综合一区二区 | 国产亚洲欧美在线 | 久久激情网 | 一级毛片视频 | 国产不卡在线观看 | 国产精品久久久久影院色老大 | 成人区精品一区二区婷婷 | 久久久久久国产精品免费免费狐狸 | 午夜国产一级 | 男女av| 秋霞电影一区二区 | 青青草社区 | 国产色片 | 综合第一页| 亚洲国产一区二区视频 | 国产91久久久久蜜臀青青天草二 | 亚洲三区在线播放 | 日韩中文字幕在线播放 | 亚洲国产精品久久久 | 欧美久久国产精品 | 国产精品欧美一区二区 | 亚洲综合首页 |