This commit is contained in:
louiscklaw
2025-01-31 22:56:45 +08:00
parent 2b2e378e49
commit 57c7fd9332
4 changed files with 112 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,76 @@
### vnc
host 192.168.10.21
<http://192.168.10.21:6199/>
work path
/home/logic/_workspace/task-list/servers/logic-NUC8i5BEH/opencv-workdesk/001_monitor/src/007-test
# test results
### currently bad result on recognizing elephant, horse and mountain
- i want to know if increase nPos can help
- 400 -> 4000
- 400 -> 12000
- i am testing nPos 10, nNeg ~2000, nStages 15 on `007-train-bus-test-big-pos-pic`
- i want to know if large dimensions of pos image can help
| nPos(p) | nNeg(n) | nStage(s) | px | success | TT | TT base | FT | FT base | reasons / remarks / conclusion |
| :-----: | :-----: | :-------: | :--------: | :-----: | :---: | :-----: | :---: | :-----: | :--------------------------------------------------------------------------------------------- |
| 12800 | 200 | 5 | 24 | failed | ? | ? | ? | ? | 007-train-bus-test-pos-pic-100px, i want to know lower stage can build ? |
| 32000 | 200 | 5 | 24 | failed | ? | ? | ? | ? | 007-train-bus-test-pos-pic-24px, i need a build success |
| 9600 | 200 | 5 | 24 | failed | ? | ? | ? | ? | 007-train-bus-test-pos-pic-100px, i want to know lower stage can build ? |
| 9600 | 200 | 15 | 24 | failed | ? | ? | ? | ? | 007-train-bus-test-pos-pic-24px, i need a build success |
| 2400 | 200 | 15 | 24 | failed | ? | ? | ? | ? | 007-train-bus-test-pos-pic-24px, i need a build success |
| 400 | 200 | 15 | 50 | N/A | 1 | 50 | 2 | 450 | 007-train-bus-test-big-pos-pic, seems good when using 50px, build failed, increase nPos to 800 |
| 50 | 200 | 15 | 100 | N/A | 50 | 50 | 450 | 450 | 007-train-bus-test-pos-pic-50, try pos 10 -> 50 samples, |
| 10 | 200 | 5 | 100 | N/A | 0 | 50 | 0 | 450 | 007-train-bus-test-pos-pic-100px, try 100px pos size |
| 10 | 200 | 15 | 50 | N/A | 1 | 50 | 2 | 450 | 007-train-bus-test-big-pos-pic, try 50px pos size |
| 10 | 200 | 5 | orig. size | N/A | 0 | 50 | 0 | 450 | seems original size not a correct size, try 50px black and white |
| 200 | 1783 | 15 | 24 | N/A | 7 | 7 | 51 | 51 | ongoing, test to find bus image |
| 200 | 1971 | 15 | 24 | N/A | 7 | 7 | 51 | 51 | ongoing, add flowers and horse |
| 200 | 1603 | 5 | 50 | N/A | x | x | x | x | try reduce fault rate by increase px, resut -> cannot built |
| 200 | 1603 | 10 | 24 | N/A | 50 | 50 | 441 | 450 | stage 10 is not acceptable, return to use 15 |
| 200 | 1603 | 5 | 24 | N/A | 50 | 50 | 450 | ~450 | small stage can kills accurancy |
| 200 | 1603 | 15 | 24 | N/A | 33 | 50 | 100 | 450 | currently best bulid |
| 200 | 1354 | 5 | 24 | N/A | 4 | 4 | 9 | 26 | i want to see if stage can keep same result but trainging faster |
| 200 | 1354 | 15 | 24 | N/A | 4 | 4 | 9 | 26 | ongoing |
| 200 | 944 | 15 | 24 | N/A | 4 | 4 | 9 | 26 | guess, this is 900 + 44 bus photo result |
| 200 | 900 | 15 | 100 | N/A | 2 | 2 | 7 | 14 | ongoing, i want to know if i increase px increase accuracy |
| 200 | 900 | 15 | 24 | N/A | 2 | 2 | 7 | 14 | |
| 100 | 300 | 15 | x | N/A | 33 | 142 | x | x | |
```bash
-numPos 100
-numNeg 300
-numStages 15
```
```bash
count_good_result : 33
count_good_result_base : 99
count_bad_result : 142
```
### test with 100 posdata
```bash
count_good_result : 33
count_good_result_base : 99
count_bad_result : 142
```
https://pythonprogramming.net/haar-cascade-object-detection-python-opencv-tutorial/
i want to test haar cascade classifier, i need to make a helloworld
https://machinelearningmastery.com/training-a-haar-cascade-object-detector-in-opencv/
https://github.com/yang-hfff/opencv_traincascade/tree/master
https://cloud.tencent.com/developer/article/1996918

View File

@@ -0,0 +1,31 @@
from rtree import index
from pprint import pprint
import os, sys
import rtree
# Create a new index
idx = rtree.index.Index()
# Insert a rectangle (minx, miny, maxx, maxy) with a unique identifier
idx.insert(0, (0, 0, 0, 0))
idx.insert(1, (30, 30, 30, 30))
idx.insert(2, (40, 40, 40, 40))
# Query all rectangles that intersect with the given rectangle
result = idx.intersection((2, 2, 8, 8))
# for id in result:
# print(id) # prints: 0
# Query all rectangles that are completely contained within the given rectangle
# result = idx.intersection((1, 1, 9, 9), objects=True)
# for id, bounds in result:
# print(id, bounds) # prints: (0, (0, 0, 10, 10))
# # Query all rectangles that contain the given point
result = idx.nearest((40, 35), 1)
for id in result:
print(id) # prints: (0, (0, 0, 10, 10))
# # Delete a rectangle by its identifier
# idx.delete(0, (0, 0, 10, 10))

View File

@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -ex
pip install rtree