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

在numpy中使用as_strided函數的滑動窗口?

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

問題描述

當我開始使用 python 實現一個滑動窗口來檢測靜止圖像中的對象時,我開始了解這個不錯的功能:

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

所以我嘗試制定一個通用規則,以避免在更改我需要的滑動窗口大小時可能會失敗的錯誤.最后我得到了這個表示:

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

這會產生一個 4 暗矩陣.前兩個代表圖像的 x 和 y 軸上的窗口數.其他的代表窗口的大小(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代表兩個連續窗口之間的位移.

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

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

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 中讓滑動窗口美觀整潔地進行圖像處理?

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?

謝謝

推薦答案

查看這個問題的答案:使用步幅實現高效的移動平均濾波器.基本上跨步不是一個很好的選擇,盡管它們有效.

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.

這篇關于在numpy中使用as_strided函數的滑動窗口?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

相關文檔推薦

How to draw a rectangle around a region of interest in python(如何在python中的感興趣區域周圍繪制一個矩形)
How can I detect and track people using OpenCV?(如何使用 OpenCV 檢測和跟蹤人員?)
How can I download a specific part of Coco Dataset?(如何下載 Coco Dataset 的特定部分?)
Detect centre and angle of rectangles in an image using Opencv(使用 Opencv 檢測圖像中矩形的中心和角度)
Calculating percentage of Bounding box overlap, for image detector evaluation(計算邊界框重疊的百分比,用于圖像檢測器評估)
How to merge lines after HoughLinesP?(如何在 HoughLinesP 之后合并行?)
主站蜘蛛池模板: 不卡一区| 欧美激情视频一区二区三区在线播放 | 中文字幕在线一区二区三区 | 成年人黄色一级毛片 | 亚洲欧美一区二区三区在线 | 1级毛片| 亚洲区一区二 | 三级成人片| 最新一级毛片 | 国产一区二区在线免费观看 | 麻豆av在线免费观看 | 国产精品国产a级 | av一级一片| 国产精品亚洲一区二区三区在线观看 | 国产欧美一区二区在线观看 | 国产成人午夜电影网 | 在线观看av网站 | 国产成人精品福利 | www日本高清 | 精品中文在线 | 亚洲成人免费视频在线观看 | 免费精品国产 | 国产成人麻豆免费观看 | 美女一区二区在线观看 | 羞羞的视频在线看 | 看亚洲a级一级毛片 | 国产在线一区观看 | 久久精品国产一区二区三区不卡 | 亚洲午夜视频在线观看 | 久久久久久久久久毛片 | 国产成视频在线观看 | 亚洲国产成人精品久久 | 成人在线观看亚洲 | 欧美久久视频 | 久久精品99 | 欧美一级久久 | 亚洲一区二区三区高清 | 精品日韩在线 | 成人免费福利视频 | 爱爱免费视频 | 韩国主播午夜大尺度福利 |