今天測試同步播放兩支影片






 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89



using System;
using System.Threading;
using Emgu.CV;
using Emgu.CV.CvEnum;
using Emgu.CV.Structure;
using System.Windows.Forms;

namespace WaferPositioning
{
// 同時播放兩支影片
public class DualVideoPlayer
{
private VideoCapture capture1;
private VideoCapture capture2;
private ManualResetEvent pauseEvent = new ManualResetEvent(true);
private bool stopThreads = false;

public event EventHandler<FrameReadyEventArgs> FrameReady;

public DualVideoPlayer(string videoFile1, string videoFile2)
{
capture1 = new VideoCapture(videoFile1);
capture2 = new VideoCapture(videoFile2);
}

public void Start()
{
stopThreads = false;
pauseEvent.Set(); // Resume if paused
ThreadPool.QueueUserWorkItem(o => StartVideoPlayback());
}

public void Pause()
{
pauseEvent.Reset(); // Pause playback
}

public void Resume()
{
pauseEvent.Set(); // Resume playback
}

public void Stop()
{
stopThreads = true;
pauseEvent.Set(); // Resume if paused
}

private void StartVideoPlayback()
{
while (!stopThreads)
{
pauseEvent.WaitOne(); // Pause if signaled

Mat frame1 = new Mat();
Mat frame2 = new Mat();

// Read frames from the video captures
capture1.Read(frame1);
capture2.Read(frame2);

if (!frame1.IsEmpty && !frame2.IsEmpty)
{
FrameReady?.Invoke(this, new FrameReadyEventArgs(frame1, frame2));
}
else
{
// End of video, you may want to stop or loop the playback
capture1.Set(CapProp.PosFrames, 0);
capture2.Set(CapProp.PosFrames, 0);
}
Thread.Sleep(33);
Application.DoEvents(); // Allow UI events to be processed
}
}
}

public class FrameReadyEventArgs : EventArgs
{
public Mat Frame1 { get; }
public Mat Frame2 { get; }

public FrameReadyEventArgs(Mat frame1, Mat frame2)
{
Frame1 = frame1;
Frame2 = frame2;
}
}
}





me1237guy 發表在 痞客邦 留言(0) 人氣()

室內無人機結合3D空間定位及追蹤

me1237guy 發表在 痞客邦 留言(0) 人氣()

Object Detection and Background removal with Detectron2
detectron2
 

me1237guy 發表在 痞客邦 留言(0) 人氣()

查詢影片FPS(frames per second)
(base) C:\ffmpeg>ffmpeg -i cam1.avi 2>&1 | findstr "fps"
 
調整影片FPS = 5.99

me1237guy 發表在 痞客邦 留言(0) 人氣()

enter image description here

今天有一項任務,要模擬隨機切割一個物體,
簡單的說,要任意切割物體並且 需要將碎片融合至一張背景圖片上,

me1237guy 發表在 痞客邦 留言(0) 人氣()



產生10筆資料2維資料(xp, yp),前面8筆inliers和最後兩筆outliers
yp_lr: linear regression預測值

me1237guy 發表在 痞客邦 留言(0) 人氣()

zip 是Python的一個內置函數,用於將兩個或多個可迭代對象(如列表(list)、元組(tuple)或數組(array))
逐元素地合併成單個可迭代對象。
它將來自每個輸入可迭代對象的相應元素配對在一起。
zip(X, y) 將兩個數組 X 和 y 逐元素合併在一起。

me1237guy 發表在 痞客邦 留言(0) 人氣()

QGraphicsPathItem 是Qt框架中的一個類別,它是Qt圖形視圖框架的一部分。
它用於在圖形用戶界面的QGraphicsScene中顯示向量圖形路徑。
這個類別允許您在場景環境中渲染操作複雜的2D向量圖形

me1237guy 發表在 痞客邦 留言(0) 人氣()



安裝pythonnet
> pip install pythonnet

me1237guy 發表在 痞客邦 留言(0) 人氣()


 
UniDAQ_Win_Setup

me1237guy 發表在 痞客邦 留言(0) 人氣()


GetMind
model加入video_recorder.py

gihub: VideoRecorder類別

me1237guy 發表在 痞客邦 留言(0) 人氣()


今天將先前的 Pyside6+OpneCV每分鐘記錄一個錄影檔案
改寫成MVC框架
首先,針對view利用designer設計界面如下

me1237guy 發表在 痞客邦 留言(0) 人氣()

Blog Stats
⚠️

成人內容提醒

本部落格內容僅限年滿十八歲者瀏覽。
若您未滿十八歲,請立即離開。

已滿十八歲者,亦請勿將內容提供給未成年人士。