Friday, September 5, 2025

CopyFromSelectedWorkbookToThisWorkbook

 Sub CopyFromSelectedWorkbookToThisWorkbook()

    Dim sourceWB As Workbook

    Dim targetWB As Workbook

    Dim sourceWS As Worksheet

    Dim targetWS As Worksheet

    Dim copyRange As Range

    Dim lastRow As Long, lastCol As Long

    Dim filePath As Variant


    ' Set reference to the target workbook and Sheet1

    Set targetWB = ThisWorkbook

    'Set targetWS = targetWB.ActiveSheet

    Set targetWS = targetWB.Sheets("Sheet1")

    targetWS.cells.clear

    ' Prompt user to select the source workbook (.xls or .xlsx)

    filePath = Application.GetOpenFilename("Excel Files (*.xls; *.xlsx), *.xls; *.xlsx", , "Select Source Workbook")


    ' Exit if user cancels

    If filePath = False Then

        MsgBox "No file selected.", vbExclamation

        Exit Sub

    End If


    ' Open the source workbook

    Set sourceWB = Workbooks.Open(filePath)

    Set sourceWS = sourceWB.ActiveSheet


    ' Find the last used row and column in source sheet

    lastRow = sourceWS.Cells(sourceWS.Rows.Count, 2).End(xlUp).Row

    lastCol = sourceWS.Cells(lastRow, sourceWS.Columns.Count).End(xlToLeft).Column


    ' Define the range to copy

    Set copyRange = sourceWS.Range(sourceWS.Cells(1, 1), sourceWS.Cells(lastRow, lastCol))



    ' Paste the copied range into Sheet1

    copyRange.Copy

    targetWS.Range("A1").PasteSpecial Paste:=xlPasteAll

    ' Optional: Close the source workbook without saving

    sourceWB.Close SaveChanges:=False


    ' Clear clipboard

    Application.CutCopyMode = False


End Sub

Thursday, September 4, 2025

ExportToCSV

 Sub ExportToCSV()

    Dim ws As Worksheet

    Dim exportRange As Range

    Dim lastRow As Long

    Dim filePath As String


    ' Set the worksheet (change Sheet10 to your actual sheet name if needed)

    Set ws = ThisWorkbook.ActiveSheet


    ' Find the last row with data in column A

    lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row


    ' Define the range to export (A1 to D[lastRow])

    Set exportRange = ws.Range("A1:D" & lastRow)


    ' Set the file path (you can change this to your desired location)

    filePath = Application.ThisWorkbook.Path & "\ExportedData.csv"


    ' Export the range to CSV

    Open filePath For Output As #1

    Dim r As Range, cell As Range


    For Each r In exportRange.Rows

        Dim line As String

        line = ""

        For Each cell In r.Cells

            line = line & cell.Text & vbTab

        Next cell

        ' Remove trailing tab

        If Len(line) > 0 Then line = Left(line, Len(line) - 1)

        Print #1, line

    Next r

    Close #1



    MsgBox "Data exported to CSV successfully!" & vbCrLf & filePath, vbInformation

End Sub

Friday, August 29, 2025

HF2211 iot setting

 

















Initial 


TCP-SERVER


MQTT

Detail

UART Protocol Device for use MQTT
UART Protocol Modbus for use TCP

UART Protocol Device for use MQTT

https://www.youtube.com/watch?v=URnt9w62yxg

UART Protocol Modbus for use TCP
https://www.youtube.com/watch?v=ILlH-zUioWI

node-red

http://192.168.0.86:1880/

node-red dashboard 

http://192.168.0.86:1880/ui

TCP modbus client setting

Set TCP server


Function1

var Humidity = { payload: Number(msg.payload[0])/10 };
var temperature = { payload: Number(msg.payload[1])/10 };
return [Humidity, temperature];

Friday, June 13, 2025

ALPINE LINUX share internet 2 nic

#!/bin/sh


# Enable IP forwarding

echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf

sysctl -p


# Install required packages

apk add iptables iptables-openrc dnsmasq


# Configure iptables for NAT

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

iptables -A FORWARD -i eth1 -j ACCEPT


# Save iptables rules

mkdir -p /etc/iptables

iptables-save > /etc/iptables/rules-save


# Enable iptables service at boot

rc-update add iptables default


# Assign static IP to eth1

cat <<EOF > /etc/network/interfaces

auto lo

iface lo inet loopback


auto eth0

iface eth0 inet dhcp


auto eth1

iface eth1 inet static

    address 192.168.100.1

    netmask 255.255.255.0

EOF


# Enable networking service at boot

rc-update add networking default


# Configure dnsmasq

cat <<EOF > /etc/dnsmasq.conf

interface=eth1

dhcp-range=192.168.100.50,192.168.100.150,12h

dhcp-option=3,192.168.100.1

dhcp-option=6,8.8.8.8

EOF


# Enable and start dnsmasq

rc-update add dnsmasq default

rc-service dnsmasq restart


echo "Internet sharing setup complete and persistent across reboots."


Monday, June 9, 2025

MikroTik

Check Network card

 /interface print

set ip for nat card

/ip dhcp-client add interface=ether3 disabled=no
show status
/ip dhcp-client print

set ip for exit card
/ip address add address=192.168.137.1/24 interface=ether4

/ip pool add name=dhcp_pool_ether4 ranges=192.168.137.10-192.168.137.100
/ip dhcp-server network add address=192.168.137.0/24 gateway=192.168.137.1 dns-server=8.8.8.8
/ip dhcp-server add name=dhcp_ether4 interface=ether4 address-pool=dhcp_pool_ether4 disabled=no
show lease
/ip dhcp-server lease print

share
/ip firewall nat add chain=srcnat out-interface=ether3 action=masquerade

/system package update check-for-updates

/system package update download

Saturday, June 7, 2025

Debian 12 to share internet

1. Download The Debian Bookworm network installation CD

2. install follow steps and on set software unselect all

note command to see network

   ip a

3 sudo nano /etc/network/interfaces


3.1 sudo systemctl restart networking
3.2 echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
3.3 sudo nano /etc/sysctl.conf
    uncomment #
    net.ipv4.ip_forward=1
3.4 sudo sysctl -p
3.5 
sudo iptables -t nat -A POSTROUTING -o enx000ec6c29c18-j MASQUERADE
sudo iptables -A FORWARD -i ens33 -o enx000ec6c29c18 -j ACCEPT
sudo iptables -A FORWARD -i enx000ec6c29c18 -o ens33 -m state --state RELATED,ESTABLISHED -j ACCEPT
3.6 sudo apt install iptables-persistent


sudo nano /etc/apt/sources.list


sudo apt update && sudo apt upgrade
sudo apt install open-vm-tools isc-dhcp-server
sudo nano /etc/dhcp/dhcpd.conf

sudo nano /etc/default/isc-dhcp-server

sudo systemctl restart isc-dhcp-server

  sudo systemctl enable isc-dhcp-server

8 sudo crontab -e

select nano

0 3 * * * /sbin/shutdown -r now

Friday, May 23, 2025

excel forward backward seq

B2=INPUT
B3 =INDEX(A1:G1, MOD(MATCH(B2, A1:G1, 0), COLUMNS(A1:G1)) + 1)

B4=INDEX(A1:G1, IF(MATCH(B2, A1:G1, 0)=1, COLUMNS(A1:G1), MATCH(B2, A1:G1, 0)-1))

Tuesday, May 13, 2025

mysql move data over year

 CREATE TABLE record_packing_ok_2024 LIKE record_packing_ok;


INSERT INTO record_packing_ok_2024

SELECT *

FROM record_packing_ok

WHERE YEAR(date_time) < 2025;


DELETE FROM `record_packing_ok` WHERE year(`date_time`)<2025;

Thursday, March 13, 2025

VBA select area to export to picture and set name same sheet name

 Sub ExportAllSheets()

    Dim oWs As Worksheet

    Dim oRng As Range

    Dim oChrtO As ChartObject

    Dim lWidth As Long, lHeight As Long

    Dim sFilePath As String

    

    sFilePath = "d:\"

    

    For Each oWs In ActiveWorkbook.Worksheets

        ActiveWindow.Zoom = 100

        Set oRng = oWs.Range("B2:n30")

        

        oRng.CopyPicture xlScreen, xlPicture

        lWidth = oRng.Width

        lHeight = oRng.Height

        

        Set oChrtO = oWs.ChartObjects.Add(Left:=0, Top:=0, Width:=lWidth, Height:=lHeight)

        

        oChrtO.Activate

        With oChrtO.chart

            .Paste

            .Export Filename:=sFilePath & oWs.Name & ".jpg", Filtername:="JPG"

        End With

        

        oChrtO.Delete

    Next oWs

End Sub


Monday, February 10, 2025

openssh use public-key to connect (both server and client was windows)

first install openssh server, and openssh client both side

 server side:

    1 edit sshd_config

        1.1 remove # at line

        PubkeyAuthentication yes

        PasswordAuthentication no   (change yes -->no)

        1.2 add # at two lines of end file

        #Match Group administrators

           #AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys

    restart openssh service

    3 create file authorized_keys   (c:\user\prapop\.ssh\authorized_keys)

    may be need

    4 remove inherite permission and remove adminostator of file authorized_keys  

client side

    1 ssh-keygen

    2 copy id_rsa.pub (client side) --> authorized_keys (server side)

##edit file  "authorized_keys" and paste id_rsa.pub

If two client seperate line .


command on client  : backword Rustdesk

ssh -N -R 12345:localhost:21118 -o ServerAliveInterval=60 -o ServerAliveCountMax=3 192.168.0.86


Friday, February 7, 2025

openssh server windows and revese tunnel

  • Download the latest OpenSSH for Windows binaries (package OpenSSH-Win64.zip or OpenSSH-Win32.zip)
  • As the Administrator, extract the package to C:\Program Files\OpenSSH
  • As the Administrator, install sshd and ssh-agent services:
    powershell.exe -ExecutionPolicy Bypass -File install-sshd.ps1

Configuring SSH server

  • Allow incoming connections to SSH server in Windows Firewall:
    • When installed as an optional feature, the firewall rule “OpenSSH SSH Server (sshd)” should have been created automatically. If not, proceed to create and enable the rule as follows.
    • Either run the following PowerShell command as the Administrator:
      New-NetFirewallRule -Name sshd -DisplayName 'OpenSSH SSH Server' -Enabled True -Direction Inbound -Protocol TCP -Action Allow -LocalPort 22 -Program "C:\Windows\System32\OpenSSH\sshd.exe"
      Replace C:\Windows\System32\OpenSSH\sshd.exe with the actual path to the sshd.exe (C:\Program Files\OpenSSH\ssh.exe, had you followed the manual installation instructions above).
    • or go to Windows Security > Firewall & network protection1 > Advanced Settings > Inbound Rules and add a new rule for port 22.
  • Start the service and/or configure automatic start:
    • Go to Control Panel > System and Security > Windows Tools (Administrative Tools on Windows 10 and older) and open Services. Locate OpenSSH SSH Server service.
    • If you want the server to start automatically when your machine is started: Go to Action > Properties (or just double-click the service). In the Properties dialog, change Startup type to Automatic and confirm.
    • Start the OpenSSH SSH Server service by clicking the Start the service link or Action > Start in the menu.

Setting up SSH public key authentication

Follow a generic guide for Setting up SSH public key authentication in *nix OpenSSH server, with the following difference:

  • Create the .ssh folder (for the authorized_keys file) in your Windows account profile folder (typically in C:\Users\username\.ssh).2
  • For permissions to the .ssh folder and the authorized_keys file, what matters are Windows ACL permissions, not simple *nix permissions. Set the ACL so that the respective Windows account is the owner of the folder and the file and is the only account that has a write access to them. The account that runs OpenSSH SSH Server service (typically SYSTEM or sshd) needs to have read access to the file.
  • Though, with the default Win32-OpenSSH configuration there is an exception set in sshd_config for accounts in Administrators group. For these, the server uses a different location for the authorized keys file: %ALLUSERSPROFILE%\ssh\administrators_authorized_keys (i.e. typically C:\ProgramData\ssh\administrators_authorized_keys).

C:\Program Files\OpenSSH\ssh-keygen.exe

(on windows10 will copy to user folder)


Client 

install openssh

cmd-->

ssh -N -R 12345:localhost:21118 -o ServerAliveInterval=60 -o ServerAliveCountMax=3 192.168.0.86


Cr: https://winscp.net/eng/docs/guide_windows_openssh_server

Thursday, January 23, 2025

Excel โชว์ข้อมูลจากการเลือก หลายเงื่อนไข

 

Input E1 find "AAA or BBB"

E2,E3

=IFERROR(INDEX($B$2:$B$11, SMALL(IF(INDEX($C$2:$D$11,,MATCH($E$1,$C$1:$D$1,0))>0, ROW($B$2:$B$11)-MIN(ROW($B$2:$B$11))+1), ROW(1:1))), "")

Code from Copliot help

Monday, October 21, 2024

ACCESS VBA openform after closeform code continue

Sub OpenFormAndWait()

    ' Open the form in dialog mode

    DoCmd.OpenForm "YourFormName", WindowMode:=acDialog

    

    ' Code here will execute after the form is closed

    MsgBox "The form has been closed. Continuing with the code..."

End Sub


from copilot help

Wednesday, October 9, 2024

VBA Send JSON to HTTP POST PHP

 VBA

Sub SendJsonData()

    On Error GoTo ErrorHandler


    ' Create an object for ServerXMLHTTP

    Dim xmlhttp As Object

    Set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP.6.0")


    ' Define the URL where the data will be sent

    Dim url As String

    url = "https://192.168.0.88/xampp/API/P1.php" ' Modify the URL accordingly


    ' Create the JSON Payload

    Dim jsonData As String

    Set ws = ThisWorkbook.Sheets("Sheet1")

    lastRow = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row

    

   'jsonData = "{""name"":""John"",""value"":30}"

    For i = 2 To lastRow

        jsonData = "{""name"":""" & ws.Cells(i, 1).Value & """, ""value"":""" & ws.Cells(i, 2).Value & """}"

        If i < lastRow Then

            jsonData = jsonData & ","

        End If

    Next i

    


    ' Set the Method and open the connection

    xmlhttp.Open "POST", url, False


    ' Bypass SSL Certificates validation (for self-signed certificates only)

    xmlhttp.setOption 2, 13056 ' Ignore SSL certificate errors


    ' Set HTTP Header to indicate that the data is JSON

    xmlhttp.setRequestHeader "Content-Type", "application/json"


    ' Send the JSON data

    xmlhttp.send jsonData


    ' Check the status of the request

    If xmlhttp.Status = 200 Then

        MsgBox "Data sent successfully: " & xmlhttp.responseText

    Else

        MsgBox "Error: " & xmlhttp.Status & " - " & xmlhttp.statusText

    End If


    ' Close the connection

    Set xmlhttp = Nothing

    Exit Sub


ErrorHandler:

    MsgBox "Error occurred: " & Err.Description

End Sub

PHP

<?php

// ตั้งค่า Header เพื่อระบุว่าคำตอบเป็น JSON และอนุญาตการเชื่อมต่อ CORS (ถ้าจำเป็น)

header("Content-Type: application/json");

header("Access-Control-Allow-Origin: *");


// ข้อมูลการเชื่อมต่อฐานข้อมูล MySQL

$servername = "192.168.0.88"; // หรือ IP ของเซิร์ฟเวอร์ฐานข้อมูล

$username = "prapop";        // ชื่อผู้ใช้ MySQL (เปลี่ยนตามจริง)

$password = "";            // รหัสผ่านของ MySQL (เปลี่ยนตามจริง)

$dbname = "test";    // ชื่อฐานข้อมูล


// สร้างการเชื่อมต่อฐานข้อมูล

$conn = new mysqli($servername, $username, $password, $dbname);


// ตรวจสอบการเชื่อมต่อ

if ($conn->connect_error) {

    die(json_encode([

        'status' => 'error',

        'message' => 'Connection failed: ' . $conn->connect_error

    ]));

}


// ตรวจสอบว่าคำขอเป็น POST หรือไม่

if ($_SERVER['REQUEST_METHOD'] == 'POST') {

    // รับข้อมูล JSON ที่ส่งมา

    $json = file_get_contents('php://input');

    

    // แปลง JSON ให้เป็น Array หรือ Object

    $data = json_decode($json, true);


    // ตรวจสอบว่าการแปลงสำเร็จหรือไม่

    if ($data === null) {

        // กรณีที่ข้อมูล JSON ไม่ถูกต้อง

        echo json_encode([

            'status' => 'error',

            'message' => 'Invalid JSON'

        ]);

    } else {

        // เข้าถึงข้อมูลที่ส่งมา

        $name = $data['name'];

        $value = $data['value'];


        // เตรียมคำสั่ง SQL สำหรับบันทึกข้อมูล

        // ตรวจสอบว่า prepare สำเร็จหรือไม่

        $stmt = $conn->prepare("INSERT INTO T1 (name, value) VALUES (?, ?)");


        if ($stmt === false) {

            die(json_encode([

                'status' => 'error',

                'message' => 'Prepare failed: ' . $conn->error

            ]));

        }


        $stmt->bind_param("si", $name, $value); // ผูกตัวแปรเพื่อป้องกัน SQL Injection


        // ตรวจสอบการบันทึกข้อมูล

        if ($stmt->execute()) {

            // สำเร็จ

            echo json_encode([

                'status' => 'success',

                'message' => 'Data inserted successfully',

                'name' => $name,

                'value' => $value

            ]);

        } else {

            // เกิดข้อผิดพลาด

            echo json_encode([

                'status' => 'error',

                'message' => 'Error inserting data: ' . $stmt->error

            ]);

        }


        // ปิด statement

        $stmt->close();

    }

} else {

    // กรณีที่ไม่ใช่คำขอแบบ POST

    echo json_encode([

        'status' => 'error',

        'message' => 'Only POST requests are allowed'

    ]);

}


// ปิดการเชื่อมต่อฐานข้อมูล

$conn->close();

?>


MYSQL

CREATE TABLE T1 (

    id INT AUTO_INCREMENT PRIMARY KEY,

    name VARCHAR(255) NOT NULL,

    value VARCHAR(255) NOT NULL

);


Tuesday, September 17, 2024

complie opencv with gpu support (cuda)

THE BEST


Build and Install OpenCV 4.5.1 with CUDA GPU บน Windows 10 แบบละเอียดยิบ

ติดตั้ง OpenCV v.4.5.1 เพื่อรันบน CUDA GPU บน Windows 10 ด้วยการ makefile มาเริ่มกันเลยครับ

  1. ขั้นตอนการเตรียมความพร้อมของระบบ
  2. ติดตั้ง OpenCV 4.5.1 for CUDA GPU

1.ขั้นตอนการเตรียมความพร้อมของระบบ

1.1 เตรียมความพร้อมของระบบโดยทำการติดตั้ง package ต่อไปนี้ก่อน

  • Ananconda Python 3.8
  • Microsoft Visual C++ 2015–2019 Redistributable (x64)
  • NVIDIA CUDA
  • cuDNN

สามารถดูได้จากบทความ การติดตั้ง TensorFlow GPU v. 2.4.1 Python 3.8 บน Windows 10 แบบง่าย

1.2 ติดตั้ง CMake ในบทความนี้ใช้ cmake-3.19.4-win64-x64.msi

1. https://cmake.org

1.3 สร้างโฟรเดอร์สำหรับ build project ในที่นี้จะสร้างไว้ที่ OpenCV-Build

1.4 Download OpenCV 4.5.1 Source จากเว็ป https://opencv.org/releases/ และทำการแตกไฟล์ไว้ที่พาธ OpenCV-Build

2. https://opencv.org/releases

1.5 Download opencv_contrib จากเว็ป https://github.com/opencv/opencv_contrib และทำการแตกไฟล์ไว้ที่พาธ OpenCV-Build

3. OpenCV_Build

2.ติดตั้ง OpenCV 4.5.1 for CUDA GPU

2.1 สร้างโฟลเดอร์ build และ install ไว้ที่พาธ C:\OpenCV-Build

4. folder for makefile

2.2 เปิดโปรแกรม CMake
- กำหนดพาธ Where is the source code: ไว้ที่ C:/OpenCV-Build/opencv-4.5.1
- กำหนดพาธ Where to build the binaries: ไว้ที่ C:/OpenCV-Build/build
- ติ๊กช่อง Grouped

5. Cmake config #1

2.3 ที่ Configure > Optional platform for generator เลือก x64

6. Cmake config #2

2.4 หากสำเร็จจะได้ผลลัพธ์ตามรูปที่ 7.

7. Result of the first config step

2.5 ค้นหาและเลือกตรงช่อง WITH_CUDA

8. Cmake config #3

2.6 ค้นหาและเลือกตรงช่อง BUILD_opencv_dnn

9. Cmake config #4

2.7 ค้นหาและเลือกตรงช่อง OPENCV_DNN_CUDA

10. Cmake config #5

2.8 ค้นหาและเลือกตรงช่อง ENABLE_FAST_MATH

11. Cmake config #6

2.9 ค้นหาและเลือกตรงช่อง BUILD_opencv_world

12. Cmake config #7

2.10 ให้แน่ใจว่า ได้เลือกทั้งสามตัวนี้แล้ว BUILD_opencv_python3, BUILD_opencv_python_bindings_generator, BUILD_opencv_python_tests

13. Cmake config #8

2.11 กำหนดพาธ ตรงช่อง OPENCV_EXTRA_MODULES_PATH

เป็น C:/OpenCV-Build/opencv_contrib-4.5.1/modules กด Configure

14. Cmake config #9

2.12 หลังจากนั้น ให้ค้นหาและเลือกตรงช่อง CUDA_FAST_MATH

15. Cmake config #10

2.13 หลังจากนั้น ให้ค้นหาและเลือกตรงช่อง CUDA_ARCH_BIN

16. Cmake config #11

ค้นหารุ่นการ์ดจอด้วยคำสั่ง

nvidia-smi

ในที่นี้ใช้ GeForce GTX 1650 ตามรูปที่ 17

17. nvidia-smi

จากนั้นให้ไปที่เว็ป https://en.wikipedia.org/wiki/CUDA เพื่อค้นหา Compute
capability (version)

18. en.wikipedia.org/wiki/CUDA

ในที่นี้คือค่า 7.5 นำไปใส่ในช่อง CUDA_ARCH_BIN ดังรูปที่ 19

19. Compute capability CUDA_ARCH_BIN version

2.14 ค้นหาและเลือกตรงช่อง CMAKE_INSTALL_PREFIX

แล้วแก้ไขพาธเป็น C:/OpenCV-Build/install ดังรูปที่ 20

20. Cmake config #12

2.15 ค้นหาและเลือกตรงช่อง CMAKE_CONFIGURATION_TYPES ลบ Debug ออก เหลือแค่ Releaseดังรูปที่ 21. กด Configure

21. Cmake config #13

2.16 จะได้ผลลัพธ์ตามรูปที่ 22 จากนั้นกดปุ่ม Generate

22. Cmake config #14

2.17 เปิด Command prompt (Run as administrator) และรันคำสั่งนี้

"C:\Program Files\CMake\bin\cmake.exe" --build "C:\OpenCV-Build\build" --target INSTALL --config Release
23. Makefile

ซึ่งขั้นตอนนี้จะใช้เวลานานพอสมควร รอจนกว่าจะเสร็จสิ้นกระบวนการ

24. Makefile complete

หลังจากที่รอกันมานานนม เราก็จะสามารถใช้งาน OpenCV v4.5.1 ได้แล้ว โดยรันคำสั่ง

python
import cv2
print(cv2.__version__)
25. Finally Installation Completed

จะได้ผลลัพธ์การรัน OpenCV บน base environment ดังรูป

++ Special plus การติดตั้ง OpenCV บน environment อื่น !!

conda -n opencv-gpu python==3.8
conda activate opencv-gpu

ที่ CMake กำหนดค่า python3 ให้ชี้ไปที่พาธที่สร้าง environment ไว้ กด Configure, Gennerate และทำขั้นตอนที่ 2.17 อีกครั้ง

กำหนดค่า CMake
ผลลัพธ์การรัน OpenCV บน New Environment

จะได้ผลลัพธ์ดังรูป ขอขอบคุณทุกท่านที่อ่านมาถึงตรงนี้ หวังว่าคงจะมีประโยชน์ไม่มากก็น้อยนะครับ ในบทต่อไป เราจะมารันโปรแกรมที่ใช้ OpenCV บน GPU กันต่อครับ ขอบคุณครับ


CR
1. https://amornpan.medium.com/build-and-install-opencv-4-5-1-with-cuda-gpu-%E0%B8%9A%E0%B8%99-windows-10-%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%A5%E0%B8%B0%E0%B9%80%E0%B8%AD%E0%B8%B5%E0%B8%A2%E0%B8%94%E0%B8%A2%E0%B8%B4%E0%B8%9A-5751c56e8c5c
2. https://www.youtube.com/watch?v=YsmhKar8oOc

3. https://jordanbenge.medium.com/anaconda3-opencv-with-cuda-gpu-support-for-windows-10-e038569e228

  --3. was useful--

4. if install new python need to  --> pip install numpy

5.dnn lib copy lib match version into cuda vX.X