'잡동사니'에 해당되는 글 13676건

  1. 2025.08.06 mbpoll
  2. 2025.08.06 지름...신?
  3. 2025.08.05 어우 피곤
  4. 2025.08.04 줍줍
  5. 2025.08.04 python openCV 빌드 옵션
  6. 2025.08.04 python 빌드 정보
  7. 2025.08.04 python용 얼굴탐지, 인식
  8. 2025.08.03
  9. 2025.08.02 rpi pico pwm 으로 음악재생하기
  10. 2025.08.02 rpi pico, circuit python, HW-504를 이용하여 빨콩 만들기

modpoll을 매번 받아서 쓰기 싫어서 패키지로 있는지 보는데, 이름도 비슷한 mbpoll을 ai 님께서 추천!

그나저나 도움말이 왜이렇게 유사해 보이지?

[링크 : https://launchpad.net/ubuntu/+source/mbpoll]

[링크 : https://www.modbusdriver.com/]

 

modpoll/i686-linux-gnu$ ./modpoll --help
modpoll 3.10 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2021 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.

Usage: modpoll [OPTIONS] SERIALPORT|HOST [WRITEVALUES...]
Arguments: 
SERIALPORT    Serial port when using Modbus ASCII or Modbus RTU protocol 
              COM1, COM2 ...                on Windows 
              /dev/ttyS0, /dev/ttyS1 ...    on Linux 
HOST          Host name or dotted IP address when using MDBUS/TCP protocol
WRITEVALUES   List of values to be written. If none specified (default) modpoll reads data.
General options: 
-m ascii      Modbus ASCII protocol
-m rtu        Modbus RTU protocol (default if SERIALPORT contains a /)
-m tcp        MODBUS/TCP protocol (default otherwise)
-m udp        MODBUS UDP
-m enc        Encapsulated Modbus RTU over TCP
-a #          Slave address (1-247 for serial, 0-255 for TCP, 1 is default)
-r #          Start reference (1-65536, 100 is default)
-c #          Number of values to read (1-125, 1 is default), optional for writing (use -c 1 to force FC5 or FC6)
-t 0          Discrete output (coil) data type
-t 1          Discrete input data type
-t 3          16-bit input register data type
-t 3:hex      16-bit input register data type with hex display
-t 3:int      32-bit integer data type in input register table
-t 3:mod      32-bit module 10000 data type in input register table
-t 3:float    32-bit float data type in input register table
-t 4          16-bit output (holding) register data type (default)
-t 4:hex      16-bit output (holding) register data type with hex display
-t 4:int      32-bit integer data type in output (holding) register table
-t 4:mod      32-bit module 10000 type in output (holding) register table
-t 4:float    32-bit float data type in output (holding) register table
-i            Slave operates on big-endian 32-bit integers
-f            Slave operates on big-endian 32-bit floats
-e            Use Daniel/Enron single register 32-bit mode (implies -i and -f)
-0            First reference is 0 (PDU addressing) instead 1
-1            Poll only once only, otherwise every poll rate interval
-l #          Poll rate in ms, (1000 is default)
-o #          Time-out in seconds (0.01 - 10.0, 1.0 s is default)
Options for MODBUS/TCP, UDP and RTU over TCP:
-p #          IP protocol port number (502 is default)
Options for Modbus ASCII and Modbus RTU:
-b #          Baudrate (e.g. 9600, 19200, ...) (19200 is default)
-d #          Databits (7 or 8 for ASCII protocol, 8 for RTU)
-s #          Stopbits (1 or 2, 1 is default)
-p none       No parity
-p even       Even parity (default)
-p odd        Odd parity
-4 #          RS-485 mode, RTS on while transmitting and another # ms after
$ mbpoll -help
usage : mbpoll [ options ] device|host [ writevalues... ] [ options ]

ModBus Master Simulator. It allows to read and write in ModBus slave registers
                         connected by serial (RTU only) or TCP.

Arguments :
  device        Serial port when using ModBus RTU protocol
                  COM1, COM2 ...              on Windows
                  /dev/ttyS0, /dev/ttyS1 ...  on Linux
                  /dev/ser1, /dev/ser2 ...    on QNX
  host          Host name or dotted IP address when using ModBus/TCP protocol
  writevalues   List of values to be written.
                If none specified (default) mbpoll reads data.
                If negative numbers are provided, it will precede the list of
                data to be written by two dashes ('--'). for example :
                mbpoll -t4:int /dev/ttyUSB0 -- 123 -1568 8974 -12
General options : 
  -m #          mode (rtu or tcp, TCP is default)
  -a #          Slave address (1-255 for rtu, 0-255 for tcp, 1 is default)
                for reading, it is possible to give an address list
                separated by commas or colons, for example :
                -a 32,33,34,36:40 read [32,33,34,36,37,38,39,40]
  -r #          Start reference (1 is default)
  -c #          Number of values to read (1-125, 1 is default)
  -u            Read the description of the type, the current status, and other
                information specific to a remote device (RTU only)
  -t 0          Discrete output (coil) data type (binary 0 or 1)
  -t 1          Discrete input data type (binary 0 or 1)
  -t 3          16-bit input register data type
  -t 3:hex      16-bit input register data type with hex display
  -t 3:int      32-bit integer data type in input register table
  -t 3:float    32-bit float data type in input register table
  -t 4          16-bit output (holding) register data type (default)
  -t 4:hex      16-bit output (holding) register data type with hex display
  -t 4:int      32-bit integer data type in output (holding) register table
  -t 4:float    32-bit float data type in output (holding) register table
  -0            First reference is 0 (PDU addressing) instead 1
  -B            Big endian word order for 32-bit integer and float
  -1            Poll only once only, otherwise every poll rate interval
  -l #          Poll rate in ms, ( > 10, 1000 is default)
  -o #          Time-out in seconds (0.01 - 10.00, 1.00 s is default)
Options for ModBus / TCP : 
  -p #          TCP port number (502 is default)
Options for ModBus RTU : 
  -b #          Baudrate (1200-921600, 19200 is default)
  -d #          Databits (7 or 8, 8 for RTU)
  -s #          Stopbits (1 or 2, 1 is default)
  -P #          Parity (none, even, odd, even is default)
  -R            RS-485 mode (/RTS on (0) after sending)
  -F            RS-485 mode (/RTS on (0) when sending)

  -h            Print this help summary page
  -V            Print version and exit
  -v            Verbose mode.  Causes mbpoll to print debugging messages about
                its progress.  This is helpful in debugging connection...

'프로그램 사용 > libmodbus' 카테고리의 다른 글

libmodbus backend  (0) 2025.03.13
libmodbus pi 함수들  (0) 2022.05.10
libmodbus modbus_mapping_new()  (0) 2022.05.10
libmodbus poll 적용  (0) 2022.05.04
modbus tcp  (0) 2022.05.04
Posted by 구차니

이번에 주운녀석중 가장 작은 녀석이 남았다.

cpu는 g1840 인데 성능이 많이 낮아서 g3460 으로 갈아 타려고 하는데

같은 하스웰/하스웰 리프레시인데 네이밍이 왜 이따구야 싶었는데

셀러론과 펜티엄을 같은 g 접두를 쓰다니.. -_- 숫자로 판별하게 하지 말라고!!!

 

인텔® 셀러론® 프로세서 G1840
2MB 캐시, 2.80GHz

[링크 : https://www.intel.co.kr/content/www/kr/ko/products/sku/80800/intel-celeron-processor-g1840-2m-cache-2-80-ghz/specifications.html]

 

인텔® 펜티엄® 프로세서 G3460
3MB 캐시, 3.50GHz

[링크 : https://www.intel.co.kr/content/www/kr/ko/products/sku/83428/intel-pentium-processor-g3460-3m-cache-3-50-ghz/specifications.html]

 

아무튼 메인보드는 아담해서 이걸 담을수 있는 tfx 케이스가 있으면 딱이겠다 싶은데

mATX 폼펙터
190mm x 170mm

[링크 : https://www.ecs.com.tw/kr/Product/Motherboard/H81H3-M4/specification]

 

중고 판매자가

와콤 타블렛도 같이 파는 사람이 있어서 묶음(!)배송으로 살까 고민중 ㅋㅋ

'개소리 왈왈 > 컴퓨터' 카테고리의 다른 글

pth-651 on linux  (0) 2025.08.07
pth-651 on 윈도우  (0) 2025.08.07
줍줍  (0) 2025.08.04
지름신이 솔솔  (0) 2025.07.29
ultarnav fn 키와 access ibm  (0) 2025.07.28
Posted by 구차니

날씨도 덥고 습하지 않아서 그나마 다행인가

 

그 와중에 오전에 외근 들러서 회사 갔더니 하루가 그냥 훅 날아가는 느낌이다

오후에는 회의만 하다 끝나고..

'개소리 왈왈 > 직딩의 비애' 카테고리의 다른 글

외근  (0) 2025.09.09
압박붕대  (2) 2025.08.25
절래절래  (0) 2025.07.09
난 멀하고 싶은걸까?  (1) 2025.06.27
이번달 k-pass 환급액은 적겠군..  (0) 2025.06.26
Posted by 구차니

웬일로 컴퓨터가 나왔네

i5-4440 / B85

G1840 / H81 보드

 

이제 10세대 전 꺼가 되어버렸구나

'개소리 왈왈 > 컴퓨터' 카테고리의 다른 글

pth-651 on 윈도우  (0) 2025.08.07
지름...신?  (0) 2025.08.06
지름신이 솔솔  (0) 2025.07.29
ultarnav fn 키와 access ibm  (0) 2025.07.28
어라 갑자기 크롬 잘 된다?  (0) 2025.07.23
Posted by 구차니
Programming/openCV2025. 8. 4. 16:17

getBuildInformation() 을 이용하면 빌드시 옵션을 볼 수 있다.

python 에서 안보이더니 openCV 에서 가속여부를 결정하는건가..

암튼 여기에는 -O3 가 보인다.

 

>>> import cv2
>>> print(cv2.getBuildInformation())

General configuration for OpenCV 4.9.0 =====================================
  Version control:               4.9.0-dirty

  Extra modules:
    Location (extra):            /io/opencv_contrib/modules
    Version control (extra):     4.9.0

  Platform:
    Timestamp:                   2023-12-31T11:19:02Z
    Host:                        Linux 5.15.0-1053-azure x86_64
    CMake:                       3.28.1
    CMake generator:             Unix Makefiles
    CMake build tool:            /bin/gmake
    Configuration:               Release

  CPU/HW features:
    Baseline:                    SSE SSE2 SSE3
      requested:                 SSE3
    Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
      requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
      SSE4_1 (16 files):         + SSSE3 SSE4_1
      SSE4_2 (1 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
      FP16 (0 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
      AVX (8 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
      AVX2 (36 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
      AVX512_SKX (5 files):      + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX

  C/C++:
    Built as dynamic libs?:      NO
    C++ standard:                11
    C++ Compiler:                /opt/rh/devtoolset-10/root/usr/bin/c++  (ver 10.2.1)
    C++ flags (Release):         -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /opt/rh/devtoolset-10/root/usr/bin/cc
    C flags (Release):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -msse -msse2 -msse3 -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a -L/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    Linker flags (Debug):        -Wl,--exclude-libs,libippicv.a -Wl,--exclude-libs,libippiw.a -L/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined  
    ccache:                      YES
    Precompiled headers:         NO
    Extra dependencies:          /lib64/libopenblas.so Qt5::Test Qt5::Concurrent /usr/local/lib/libpng.so /lib64/libz.so Qt5::Core Qt5::Gui Qt5::Widgets Iconv::Iconv dl m pthread rt
    3rdparty dependencies:       libprotobuf ade ittnotify libjpeg-turbo libwebp libtiff libopenjp2 IlmImf ippiw ippicv

  OpenCV modules:
    To be built:                 aruco bgsegm bioinspired calib3d ccalib core cvv datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking video videoio videostab wechat_qrcode xfeatures2d ximgproc xobjdetect xphoto
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 alphamat cannops cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev freetype hdf java julia matlab ovis python2 sfm ts viz
    Applications:                -
    Documentation:               NO
    Non-free algorithms:         NO

  GUI:                           QT5
    QT:                          YES (ver 5.15.0 )
      QT OpenGL support:         NO
    GTK+:                        NO
    VTK support:                 NO

  Media I/O: 
    ZLib:                        /lib64/libz.so (ver 1.2.7)
    JPEG:                        libjpeg-turbo (ver 2.1.3-62)
    WEBP:                        build (ver encoder: 0x020f)
    PNG:                         /usr/local/lib/libpng.so (ver 1.6.40)
    TIFF:                        build (ver 42 - 4.2.0)
    JPEG 2000:                   build (ver 2.5.0)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES
      avcodec:                   YES (59.37.100)
      avformat:                  YES (59.27.100)
      avutil:                    YES (57.28.100)
      swscale:                   YES (6.7.100)
      avresample:                NO
    GStreamer:                   NO
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            pthreads

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Intel IPP:                   2021.10.0 [2021.10.0]
           at:                   /io/_skbuild/linux-x86_64-3.7/cmake-build/3rdparty/ippicv/ippicv_lnx/icv
    Intel IPP IW:                sources (2021.10.0)
              at:                /io/_skbuild/linux-x86_64-3.7/cmake-build/3rdparty/ippicv/ippicv_lnx/iw
    VA:                          NO
    Lapack:                      YES (/lib64/libopenblas.so)
    Eigen:                       NO
    Custom HAL:                  NO
    Protobuf:                    build (3.19.1)
    Flatbuffers:                 builtin/3rdparty (23.5.9)

  OpenCL:                        YES (no extra features)
    Include path:                /io/opencv/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /opt/python/cp37-cp37m/bin/python3.7 (ver 3.7.17)
    Libraries:                   libpython3.7m.a (ver 3.7.17)
    numpy:                       /home/ci/.local/lib/python3.7/site-packages/numpy/core/include (ver 1.17.0)
    install path:                python/cv2/python-3

  Python (for build):            /opt/python/cp37-cp37m/bin/python3.7

  Java:                          
    ant:                         NO
    Java:                        NO
    JNI:                         NO
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    /io/_skbuild/linux-x86_64-3.7/cmake-install
-----------------------------------------------------------------


[링크 : https://answers.opencv.org/question/224485/simd-optimizations-get-no-performance-gains-on-arm-neon/]

 

+

2025.08.11

armbian / Python 3.12.3 / openCV 4.12.0

오.. neon 가속이 있다!

>>> print(cv2.getBuildInformation())

General configuration for OpenCV 4.12.0 =====================================
  Version control:               4.12.0-dirty

  Platform:
    Timestamp:                   2025-07-04T16:42:37Z
    Host:                        Linux 6.8.0-51-generic aarch64
    CMake:                       4.0.3
    CMake generator:             Unix Makefiles
    CMake build tool:            /bin/gmake
    Configuration:               Release
    Algorithm Hint:              ALGO_HINT_ACCURATE

  CPU/HW features:
    Baseline:                    NEON FP16
      requested:                 DETECT
    Dispatched code generation:  NEON_DOTPROD NEON_FP16 NEON_BF16
      requested:                 NEON_FP16 NEON_BF16 NEON_DOTPROD
      NEON_DOTPROD (2 files):    + NEON_DOTPROD
      NEON_FP16 (2 files):       + NEON_FP16
      NEON_BF16 (0 files):       + NEON_BF16

  C/C++:
    Built as dynamic libs?:      NO
    C++ standard:                11
    C++ Compiler:                /opt/rh/devtoolset-10/root/usr/bin/c++  (ver 10.2.1)
    C++ flags (Release):         -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG  -DNDEBUG
    C++ flags (Debug):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Wsuggest-override -Wno-delete-non-virtual-dtor -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -fvisibility-inlines-hidden -g  -O0 -DDEBUG -D_DEBUG
    C Compiler:                  /opt/rh/devtoolset-10/root/usr/bin/cc
    C flags (Release):           -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -O3 -DNDEBUG  -DNDEBUG
    C flags (Debug):             -Wl,-strip-all   -fsigned-char -W -Wall -Wreturn-type -Waddress -Wsequence-point -Wformat -Wformat-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wuninitialized -Wno-comment -Wimplicit-fallthrough=3 -Wno-strict-overflow -fdiagnostics-show-option -pthread -fomit-frame-pointer -ffunction-sections -fdata-sections  -fvisibility=hidden -g  -O0 -DDEBUG -D_DEBUG
    Linker flags (Release):      -L/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined
    Linker flags (Debug):        -L/ffmpeg_build/lib  -Wl,--gc-sections -Wl,--as-needed -Wl,--no-undefined
    ccache:                      YES
    Precompiled headers:         NO
    Extra dependencies:          /usr/lib64/libopenblas.so Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Test Qt5::Concurrent avif /usr/local/lib/libpng.so /usr/lib64/libz.so dl m pthread rt
    3rdparty dependencies:       libprotobuf ade ittnotify libjpeg-turbo libwebp libtiff libopenjp2 IlmImf tegra_hal

  OpenCV modules:
    To be built:                 calib3d core dnn features2d flann gapi highgui imgcodecs imgproc ml objdetect photo python3 stitching video videoio
    Disabled:                    world
    Disabled by dependency:      -
    Unavailable:                 java python2 ts
    Applications:                -
    Documentation:               NO
    Non-free algorithms:         NO

  GUI:                           QT5
    QT:                          YES (ver 5.15.16 )
      QT OpenGL support:         NO
    GTK+:                        NO
    VTK support:                 NO

  Media I/O:
    ZLib:                        /usr/lib64/libz.so (ver 1.2.7)
    JPEG:                        build-libjpeg-turbo (ver 3.1.0-70)
      SIMD Support Request:      YES
      SIMD Support:              YES
    WEBP:                        build (ver decoder: 0x0209, encoder: 0x020f, demux: 0x0107)
    AVIF:                        avif (ver 1.3.0)
    PNG:                         /usr/local/lib/libpng.so (ver 1.6.48)
    TIFF:                        build (ver 42 - 4.6.0)
    JPEG 2000:                   build (ver 2.5.3)
    OpenEXR:                     build (ver 2.3.0)
    GIF:                         YES
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    FFMPEG:                      YES
      avcodec:                   YES (59.37.100)
      avformat:                  YES (59.27.100)
      avutil:                    YES (57.28.100)
      swscale:                   YES (6.7.100)
      avresample:                NO
    GStreamer:                   NO
    v4l/v4l2:                    YES (linux/videodev2.h)

  Parallel framework:            pthreads

  Trace:                         YES (with Intel ITT(3.25.4))

  Other third-party libraries:
    Lapack:                      YES (/usr/lib64/libopenblas.so)
    Eigen:                       NO
    Custom HAL:                  YES (carotene (ver 0.0.1))
    Protobuf:                    build (3.19.1)
    Flatbuffers:                 builtin/3rdparty (23.5.9)

  OpenCL:                        YES (no extra features)
    Include path:                /io/opencv/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 /opt/python/cp39-cp39/bin/python3.9 (ver 3.9.23)
    Libraries:                   libpython3.9m.a (ver 3.9.23)
    Limited API:                 YES (ver 0x03060000)
    numpy:                       /home/ci/.local/lib/python3.9/site-packages/numpy/_core/include (ver 2.0.2)
    install path:                python/cv2/python-3

  Python (for build):            /opt/python/cp39-cp39/bin/python3.9

  Java:
    ant:                         NO
    Java:                        NO
    JNI:                         NO
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    /io/_skbuild/linux-aarch64-3.9/cmake-install
-----------------------------------------------------------------
Posted by 구차니

문득 python을 빌드할때 어떤 옵션을 주고 했을까 궁금해서 찾아보는 중

import sysconfig
print(sysconfig.get_config_vars())

[링크 : https://stackoverflow.com/questions/10192758/how-to-get-the-list-of-options-that-python-was-compiled-with]

 

online python object beautifier로 이쁘게~

ubuntu 22.04 LTS desktop 64bit / Python 3.10.12

{
    "prefix": "/usr",
    "exec_prefix": "/usr",
    "py_version": "3.10.12",
    "py_version_short": "3.10",
    "py_version_nodot": "310",
    "installed_base": "/usr",
    "base": "/usr",
    "installed_platbase": "/usr",
    "platbase": "/usr",
    "projectbase": "/usr/bin",
    "platlibdir": "lib",
    "abiflags": "",
    "py_version_nodot_plat": "",
    "ABIFLAGS": "",
    "AC_APPLE_UNIVERSAL_BUILD": 0,
    "AIX_BUILDDATE": 0,
    "AIX_GENUINE_CPLUSPLUS": 0,
    "ALIGNOF_LONG": 8,
    "ALIGNOF_SIZE_T": 8,
    "ALT_SOABI": 0,
    "ANDROID_API_LEVEL": 0,
    "AR": "x86_64-linux-gnu-gcc-ar",
    "ARFLAGS": "rcs",
    "BASECFLAGS": "-Wno-unused-result -Wsign-compare",
    "BASECPPFLAGS": "-IObjects -IInclude -IPython",
    "BASEMODLIBS": "",
    "BINDIR": "/usr/bin",
    "BINLIBDEST": "/usr/lib/x86_64-linux-gnu/python3.10",
    "BLDLIBRARY": "-lpython3.10",
    "BLDSHARED": "x86_64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions      -g -fwrapv -O2   ",
    "BUILDEXE": "",
    "BUILDPYTHON": "python",
    "BUILD_GNU_TYPE": "x86_64-pc-linux-gnu",
    "BYTESTR_DEPS": "\\",
    "CC": "x86_64-linux-gnu-gcc",
    "CCSHARED": "-fPIC",
    "CFLAGS": "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g       -fstack-protector-strong -Wformat -Werror=format-security  -g -fwrapv -O2   ",
    "CFLAGSFORSHARED": "-fPIC",
    "CFLAGS_ALIASING": "",
    "CFLAGS_NODIST": "",
    "CONFIGFILES": "configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in",
    "CONFIGURE_CFLAGS": "-g       -fstack-protector-strong -Wformat -Werror=format-security",
    "CONFIGURE_CFLAGS_NODIST": "-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden",
    "CONFIGURE_CPPFLAGS": "-Wdate-time -D_FORTIFY_SOURCE=2",
    "CONFIGURE_LDFLAGS": "-Wl,-Bsymbolic-functions      -g -fwrapv -O2   ",
    "CONFIGURE_LDFLAGS_NODIST": "",
    "CONFIG_ARGS": "'--enable-shared' '--prefix=/usr' '--libdir=/usr/lib/x86_64-linux-gnu' '--enable-ipv6' '--enable-loadable-sqlite-extensions' '--with-dbmliborder=bdb:gdbm' '--with-computed-gotos' '--without-ensurepip' '--with-system-expat' '--with-dtrace' '--with-system-libmpdec' '--with-wheel-pkg-dir=/usr/share/python-wheels/' 'MKDIR_P=/bin/mkdir -p' '--with-system-ffi' 'CC=x86_64-linux-gnu-gcc' 'CFLAGS=-g       -fstack-protector-strong -Wformat -Werror=format-security ' 'LDFLAGS=-Wl,-Bsymbolic-functions      -g -fwrapv -O2   ' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2'",
    "CONFINCLUDEDIR": "/usr/include",
    "CONFINCLUDEPY": "/usr/include/python3.10",
    "COREPYTHONPATH": "",
    "COVERAGE_INFO": "/build/python3.10-rtDYKr/python3.10-3.10.12/build-shared/coverage.info",
    "COVERAGE_REPORT": "/build/python3.10-rtDYKr/python3.10-3.10.12/build-shared/lcov-report",
    "COVERAGE_REPORT_OPTIONS": '--no-branch-coverage --title "CPython lcov report"',
    "CPPFLAGS": "-IObjects -IInclude -IPython -I. -I../Include -Wdate-time -D_FORTIFY_SOURCE=2",
    "CXX": "x86_64-linux-gnu-g++",
    "DESTDIRS": "/usr /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/python3.10 /usr/lib/python3.10/lib-dynload",
    "DESTLIB": "/usr/lib/python3.10",
    "DESTPATH": "",
    "DESTSHARED": "/usr/lib/python3.10/lib-dynload",
    "DFLAGS": "",
    "DIRMODE": 755,
    "DIST": "README.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummy",
    "DISTDIRS": "Include Lib Misc Ext-dummy",
    "DISTFILES": "README.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in",
    "DLINCLDIR": ".",
    "DLLLIBRARY": "",
    "DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754": 0,
    "DOUBLE_IS_BIG_ENDIAN_IEEE754": 0,
    "DOUBLE_IS_LITTLE_ENDIAN_IEEE754": 1,
    "DTRACE": "/usr/bin/dtrace",
    "DTRACE_DEPS": "\\",
    "DTRACE_HEADERS": "Include/pydtrace_probes.h",
    "DTRACE_OBJS": "Python/pydtrace.o",
    "DYNLOADFILE": "dynload_shlib.o",
    "ENABLE_IPV6": 1,
    "ENSUREPIP": "no",
    "EXE": "",
    "EXEMODE": 755,
    "EXPERIMENTAL_ISOLATED_SUBINTERPRETERS": 0,
    "EXPORTSFROM": "",
    "EXPORTSYMS": "",
    "EXTRATESTOPTS": "",
    "EXT_SUFFIX": ".cpython-310-x86_64-linux-gnu.so",
    "FILEMODE": 644,
    "FLOAT_WORDS_BIGENDIAN": 0,
    "FLOCK_NEEDS_LIBBSD": 0,
    "GETPGRP_HAVE_ARG": 0,
    "GITBRANCH": "",
    "GITTAG": "",
    "GITVERSION": "",
    "GNULD": "yes",
    "HAVE_ACCEPT4": 1,
    "HAVE_ACOSH": 1,
    "HAVE_ADDRINFO": 1,
    "HAVE_ALARM": 1,
    "HAVE_ALIGNED_REQUIRED": 0,
    "HAVE_ALLOCA_H": 1,
    "HAVE_ALTZONE": 0,
    "HAVE_ASINH": 1,
    "HAVE_ASM_TYPES_H": 1,
    "HAVE_ATANH": 1,
    "HAVE_BIND_TEXTDOMAIN_CODESET": 1,
    "HAVE_BLUETOOTH_BLUETOOTH_H": 1,
    "HAVE_BLUETOOTH_H": 0,
    "HAVE_BROKEN_MBSTOWCS": 0,
    "HAVE_BROKEN_NICE": 0,
    "HAVE_BROKEN_PIPE_BUF": 0,
    "HAVE_BROKEN_POLL": 0,
    "HAVE_BROKEN_POSIX_SEMAPHORES": 0,
    "HAVE_BROKEN_PTHREAD_SIGMASK": 0,
    "HAVE_BROKEN_SEM_GETVALUE": 0,
    "HAVE_BROKEN_UNSETENV": 0,
    "HAVE_BUILTIN_ATOMIC": 1,
    "HAVE_CHFLAGS": 0,
    "HAVE_CHOWN": 1,
    "HAVE_CHROOT": 1,
    "HAVE_CLOCK": 1,
    "HAVE_CLOCK_GETRES": 1,
    "HAVE_CLOCK_GETTIME": 1,
    "HAVE_CLOCK_SETTIME": 1,
    "HAVE_CLOSE_RANGE": 1,
    "HAVE_COMPUTED_GOTOS": 1,
    "HAVE_CONFSTR": 1,
    "HAVE_CONIO_H": 0,
    "HAVE_COPYSIGN": 1,
    "HAVE_COPY_FILE_RANGE": 1,
    "HAVE_CRYPT_H": 1,
    "HAVE_CRYPT_R": 1,
    "HAVE_CTERMID": 1,
    "HAVE_CTERMID_R": 0,
    "HAVE_CURSES_FILTER": 1,
    "HAVE_CURSES_H": 1,
    "HAVE_CURSES_HAS_KEY": 1,
    "HAVE_CURSES_IMMEDOK": 1,
    "HAVE_CURSES_IS_PAD": 1,
    "HAVE_CURSES_IS_TERM_RESIZED": 1,
    "HAVE_CURSES_RESIZETERM": 1,
    "HAVE_CURSES_RESIZE_TERM": 1,
    "HAVE_CURSES_SYNCOK": 1,
    "HAVE_CURSES_TYPEAHEAD": 1,
    "HAVE_CURSES_USE_ENV": 1,
    "HAVE_CURSES_WCHGAT": 1,
    "HAVE_DECL_ISFINITE": 1,
    "HAVE_DECL_ISINF": 1,
    "HAVE_DECL_ISNAN": 1,
    "HAVE_DECL_RTLD_DEEPBIND": 1,
    "HAVE_DECL_RTLD_GLOBAL": 1,
    "HAVE_DECL_RTLD_LAZY": 1,
    "HAVE_DECL_RTLD_LOCAL": 1,
    "HAVE_DECL_RTLD_MEMBER": 0,
    "HAVE_DECL_RTLD_NODELETE": 1,
    "HAVE_DECL_RTLD_NOLOAD": 1,
    "HAVE_DECL_RTLD_NOW": 1,
    "HAVE_DECL_TZNAME": 0,
    "HAVE_DEVICE_MACROS": 1,
    "HAVE_DEV_PTC": 0,
    "HAVE_DEV_PTMX": 1,
    "HAVE_DIRECT_H": 0,
    "HAVE_DIRENT_D_TYPE": 1,
    "HAVE_DIRENT_H": 1,
    "HAVE_DIRFD": 1,
    "HAVE_DLFCN_H": 1,
    "HAVE_DLOPEN": 1,
    "HAVE_DUP2": 1,
    "HAVE_DUP3": 1,
    "HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH": 0,
    "HAVE_DYNAMIC_LOADING": 1,
    "HAVE_ENDIAN_H": 1,
    "HAVE_EPOLL": 1,
    "HAVE_EPOLL_CREATE1": 1,
    "HAVE_ERF": 1,
    "HAVE_ERFC": 1,
    "HAVE_ERRNO_H": 1,
    "HAVE_EVENTFD": 1,
    "HAVE_EXECV": 1,
    "HAVE_EXPLICIT_BZERO": 1,
    "HAVE_EXPLICIT_MEMSET": 0,
    "HAVE_EXPM1": 1,
    "HAVE_FACCESSAT": 1,
    "HAVE_FCHDIR": 1,
    "HAVE_FCHMOD": 1,
    "HAVE_FCHMODAT": 1,
    "HAVE_FCHOWN": 1,
    "HAVE_FCHOWNAT": 1,
    "HAVE_FCNTL_H": 1,
    "HAVE_FDATASYNC": 1,
    "HAVE_FDOPENDIR": 1,
    "HAVE_FDWALK": 0,
    "HAVE_FEXECVE": 1,
    "HAVE_FINITE": 1,
    "HAVE_FLOCK": 1,
    "HAVE_FORK": 1,
    "HAVE_FORKPTY": 1,
    "HAVE_FPATHCONF": 1,
    "HAVE_FSEEK64": 0,
    "HAVE_FSEEKO": 1,
    "HAVE_FSTATAT": 1,
    "HAVE_FSTATVFS": 1,
    "HAVE_FSYNC": 1,
    "HAVE_FTELL64": 0,
    "HAVE_FTELLO": 1,
    "HAVE_FTIME": 1,
    "HAVE_FTRUNCATE": 1,
    "HAVE_FUTIMENS": 1,
    "HAVE_FUTIMES": 1,
    "HAVE_FUTIMESAT": 1,
    "HAVE_GAI_STRERROR": 1,
    "HAVE_GAMMA": 1,
    "HAVE_GCC_ASM_FOR_MC68881": 0,
    "HAVE_GCC_ASM_FOR_X64": 1,
    "HAVE_GCC_ASM_FOR_X87": 1,
    "HAVE_GCC_UINT128_T": 1,
    "HAVE_GETADDRINFO": 1,
    "HAVE_GETC_UNLOCKED": 1,
    "HAVE_GETENTROPY": 1,
    "HAVE_GETGRGID_R": 1,
    "HAVE_GETGRNAM_R": 1,
    "HAVE_GETGROUPLIST": 1,
    "HAVE_GETGROUPS": 1,
    "HAVE_GETHOSTBYNAME": 0,
    "HAVE_GETHOSTBYNAME_R": 1,
    "HAVE_GETHOSTBYNAME_R_3_ARG": 0,
    "HAVE_GETHOSTBYNAME_R_5_ARG": 0,
    "HAVE_GETHOSTBYNAME_R_6_ARG": 1,
    "HAVE_GETITIMER": 1,
    "HAVE_GETLOADAVG": 1,
    "HAVE_GETLOGIN": 1,
    "HAVE_GETNAMEINFO": 1,
    "HAVE_GETPAGESIZE": 1,
    "HAVE_GETPEERNAME": 1,
    "HAVE_GETPGID": 1,
    "HAVE_GETPGRP": 1,
    "HAVE_GETPID": 1,
    "HAVE_GETPRIORITY": 1,
    "HAVE_GETPWENT": 1,
    "HAVE_GETPWNAM_R": 1,
    "HAVE_GETPWUID_R": 1,
    "HAVE_GETRANDOM": 1,
    "HAVE_GETRANDOM_SYSCALL": 1,
    "HAVE_GETRESGID": 1,
    "HAVE_GETRESUID": 1,
    "HAVE_GETSID": 1,
    "HAVE_GETSPENT": 1,
    "HAVE_GETSPNAM": 1,
    "HAVE_GETWD": 1,
    "HAVE_GLIBC_MEMMOVE_BUG": 0,
    "HAVE_GRP_H": 1,
    "HAVE_HSTRERROR": 1,
    "HAVE_HTOLE64": 1,
    "HAVE_HYPOT": 1,
    "HAVE_IEEEFP_H": 0,
    "HAVE_IF_NAMEINDEX": 1,
    "HAVE_INET_ATON": 1,
    "HAVE_INET_PTON": 1,
    "HAVE_INITGROUPS": 1,
    "HAVE_INTTYPES_H": 1,
    "HAVE_IO_H": 0,
    "HAVE_IPA_PURE_CONST_BUG": 0,
    "HAVE_KILL": 1,
    "HAVE_KILLPG": 1,
    "HAVE_KQUEUE": 0,
    "HAVE_LANGINFO_H": 1,
    "HAVE_LARGEFILE_SUPPORT": 0,
    "HAVE_LCHFLAGS": 0,
    "HAVE_LCHMOD": 0,
    "HAVE_LCHOWN": 1,
    "HAVE_LGAMMA": 1,
    "HAVE_LIBDL": 1,
    "HAVE_LIBDLD": 0,
    "HAVE_LIBIEEE": 0,
    "HAVE_LIBINTL_H": 1,
    "HAVE_LIBREADLINE": 1,
    "HAVE_LIBRESOLV": 0,
    "HAVE_LIBSENDFILE": 0,
    "HAVE_LIBUTIL_H": 0,
    "HAVE_LIBUUID": 1,
    "HAVE_LINK": 1,
    "HAVE_LINKAT": 1,
    "HAVE_LINUX_AUXVEC_H": 1,
    "HAVE_LINUX_CAN_BCM_H": 1,
    "HAVE_LINUX_CAN_H": 1,
    "HAVE_LINUX_CAN_J1939_H": 1,
    "HAVE_LINUX_CAN_RAW_FD_FRAMES": 1,
    "HAVE_LINUX_CAN_RAW_H": 1,
    "HAVE_LINUX_CAN_RAW_JOIN_FILTERS": 1,
    "HAVE_LINUX_MEMFD_H": 1,
    "HAVE_LINUX_NETLINK_H": 1,
    "HAVE_LINUX_QRTR_H": 1,
    "HAVE_LINUX_RANDOM_H": 1,
    "HAVE_LINUX_TIPC_H": 1,
    "HAVE_LINUX_VM_SOCKETS_H": 1,
    "HAVE_LINUX_WAIT_H": 1,
    "HAVE_LOCKF": 1,
    "HAVE_LOG1P": 1,
    "HAVE_LOG2": 1,
    "HAVE_LONG_DOUBLE": 1,
    "HAVE_LSTAT": 1,
    "HAVE_LUTIMES": 1,
    "HAVE_MADVISE": 1,
    "HAVE_MAKEDEV": 1,
    "HAVE_MBRTOWC": 1,
    "HAVE_MEMFD_CREATE": 1,
    "HAVE_MEMORY_H": 0,
    "HAVE_MEMRCHR": 1,
    "HAVE_MKDIRAT": 1,
    "HAVE_MKFIFO": 1,
    "HAVE_MKFIFOAT": 1,
    "HAVE_MKNOD": 1,
    "HAVE_MKNODAT": 1,
    "HAVE_MKTIME": 1,
    "HAVE_MMAP": 1,
    "HAVE_MREMAP": 1,
    "HAVE_NCURSES_H": 1,
    "HAVE_NDIR_H": 0,
    "HAVE_NETPACKET_PACKET_H": 1,
    "HAVE_NET_IF_H": 1,
    "HAVE_NICE": 1,
    "HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION": 0,
    "HAVE_OPENAT": 1,
    "HAVE_OPENPTY": 1,
    "HAVE_PATHCONF": 1,
    "HAVE_PAUSE": 1,
    "HAVE_PIPE2": 1,
    "HAVE_PLOCK": 0,
    "HAVE_POLL": 1,
    "HAVE_POLL_H": 1,
    "HAVE_POSIX_FADVISE": 1,
    "HAVE_POSIX_FALLOCATE": 1,
    "HAVE_POSIX_SPAWN": 1,
    "HAVE_POSIX_SPAWNP": 1,
    "HAVE_PREAD": 1,
    "HAVE_PREADV": 1,
    "HAVE_PREADV2": 1,
    "HAVE_PRLIMIT": 1,
    "HAVE_PROCESS_H": 0,
    "HAVE_PROTOTYPES": 1,
    "HAVE_PTHREAD_CONDATTR_SETCLOCK": 1,
    "HAVE_PTHREAD_DESTRUCTOR": 0,
    "HAVE_PTHREAD_GETCPUCLOCKID": 1,
    "HAVE_PTHREAD_H": 1,
    "HAVE_PTHREAD_INIT": 0,
    "HAVE_PTHREAD_KILL": 1,
    "HAVE_PTHREAD_SIGMASK": 1,
    "HAVE_PTY_H": 1,
    "HAVE_PWRITE": 1,
    "HAVE_PWRITEV": 1,
    "HAVE_PWRITEV2": 1,
    "HAVE_READLINK": 1,
    "HAVE_READLINKAT": 1,
    "HAVE_READV": 1,
    "HAVE_REALPATH": 1,
    "HAVE_RENAMEAT": 1,
    "HAVE_RL_APPEND_HISTORY": 1,
    "HAVE_RL_CATCH_SIGNAL": 1,
    "HAVE_RL_COMPLETION_APPEND_CHARACTER": 1,
    "HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK": 1,
    "HAVE_RL_COMPLETION_MATCHES": 1,
    "HAVE_RL_COMPLETION_SUPPRESS_APPEND": 1,
    "HAVE_RL_PRE_INPUT_HOOK": 1,
    "HAVE_RL_RESIZE_TERMINAL": 1,
    "HAVE_ROUND": 1,
    "HAVE_RTPSPAWN": 0,
    "HAVE_SCHED_GET_PRIORITY_MAX": 1,
    "HAVE_SCHED_H": 1,
    "HAVE_SCHED_RR_GET_INTERVAL": 1,
    "HAVE_SCHED_SETAFFINITY": 1,
    "HAVE_SCHED_SETPARAM": 1,
    "HAVE_SCHED_SETSCHEDULER": 1,
    "HAVE_SEM_CLOCKWAIT": 1,
    "HAVE_SEM_GETVALUE": 1,
    "HAVE_SEM_OPEN": 1,
    "HAVE_SEM_TIMEDWAIT": 1,
    "HAVE_SEM_UNLINK": 1,
    "HAVE_SENDFILE": 1,
    "HAVE_SETEGID": 1,
    "HAVE_SETEUID": 1,
    "HAVE_SETGID": 1,
    "HAVE_SETGROUPS": 1,
    "HAVE_SETHOSTNAME": 1,
    "HAVE_SETITIMER": 1,
    "HAVE_SETLOCALE": 1,
    "HAVE_SETPGID": 1,
    "HAVE_SETPGRP": 1,
    "HAVE_SETPRIORITY": 1,
    "HAVE_SETREGID": 1,
    "HAVE_SETRESGID": 1,
    "HAVE_SETRESUID": 1,
    "HAVE_SETREUID": 1,
    "HAVE_SETSID": 1,
    "HAVE_SETUID": 1,
    "HAVE_SETVBUF": 1,
    "HAVE_SHADOW_H": 1,
    "HAVE_SHM_OPEN": 1,
    "HAVE_SHM_UNLINK": 1,
    "HAVE_SIGACTION": 1,
    "HAVE_SIGALTSTACK": 1,
    "HAVE_SIGFILLSET": 1,
    "HAVE_SIGINFO_T_SI_BAND": 1,
    "HAVE_SIGINTERRUPT": 1,
    "HAVE_SIGNAL_H": 1,
    "HAVE_SIGPENDING": 1,
    "HAVE_SIGRELSE": 1,
    "HAVE_SIGTIMEDWAIT": 1,
    "HAVE_SIGWAIT": 1,
    "HAVE_SIGWAITINFO": 1,
    "HAVE_SNPRINTF": 1,
    "HAVE_SOCKADDR_ALG": 1,
    "HAVE_SOCKADDR_SA_LEN": 0,
    "HAVE_SOCKADDR_STORAGE": 1,
    "HAVE_SOCKETPAIR": 1,
    "HAVE_SPAWN_H": 1,
    "HAVE_SPLICE": 1,
    "HAVE_SSIZE_T": 1,
    "HAVE_STATVFS": 1,
    "HAVE_STAT_TV_NSEC": 1,
    "HAVE_STAT_TV_NSEC2": 0,
    "HAVE_STDARG_PROTOTYPES": 1,
    "HAVE_STDINT_H": 1,
    "HAVE_STDLIB_H": 1,
    "HAVE_STD_ATOMIC": 1,
    "HAVE_STRFTIME": 1,
    "HAVE_STRINGS_H": 1,
    "HAVE_STRING_H": 1,
    "HAVE_STRLCPY": 0,
    "HAVE_STROPTS_H": 0,
    "HAVE_STRSIGNAL": 1,
    "HAVE_STRUCT_PASSWD_PW_GECOS": 1,
    "HAVE_STRUCT_PASSWD_PW_PASSWD": 1,
    "HAVE_STRUCT_STAT_ST_BIRTHTIME": 0,
    "HAVE_STRUCT_STAT_ST_BLKSIZE": 1,
    "HAVE_STRUCT_STAT_ST_BLOCKS": 1,
    "HAVE_STRUCT_STAT_ST_FLAGS": 0,
    "HAVE_STRUCT_STAT_ST_GEN": 0,
    "HAVE_STRUCT_STAT_ST_RDEV": 1,
    "HAVE_STRUCT_TM_TM_ZONE": 1,
    "HAVE_SYMLINK": 1,
    "HAVE_SYMLINKAT": 1,
    "HAVE_SYNC": 1,
    "HAVE_SYSCONF": 1,
    "HAVE_SYSEXITS_H": 1,
    "HAVE_SYS_AUDIOIO_H": 0,
    "HAVE_SYS_AUXV_H": 1,
    "HAVE_SYS_BSDTTY_H": 0,
    "HAVE_SYS_DEVPOLL_H": 0,
    "HAVE_SYS_DIR_H": 0,
    "HAVE_SYS_ENDIAN_H": 0,
    "HAVE_SYS_EPOLL_H": 1,
    "HAVE_SYS_EVENTFD_H": 1,
    "HAVE_SYS_EVENT_H": 0,
    "HAVE_SYS_FILE_H": 1,
    "HAVE_SYS_IOCTL_H": 1,
    "HAVE_SYS_KERN_CONTROL_H": 0,
    "HAVE_SYS_LOADAVG_H": 0,
    "HAVE_SYS_LOCK_H": 0,
    "HAVE_SYS_MEMFD_H": 0,
    "HAVE_SYS_MKDEV_H": 0,
    "HAVE_SYS_MMAN_H": 1,
    "HAVE_SYS_MODEM_H": 0,
    "HAVE_SYS_NDIR_H": 0,
    "HAVE_SYS_PARAM_H": 1,
    "HAVE_SYS_POLL_H": 1,
    "HAVE_SYS_RANDOM_H": 1,
    "HAVE_SYS_RESOURCE_H": 1,
    "HAVE_SYS_SELECT_H": 1,
    "HAVE_SYS_SENDFILE_H": 1,
    "HAVE_SYS_SOCKET_H": 1,
    "HAVE_SYS_STATVFS_H": 1,
    "HAVE_SYS_STAT_H": 1,
    "HAVE_SYS_SYSCALL_H": 1,
    "HAVE_SYS_SYSMACROS_H": 1,
    "HAVE_SYS_SYS_DOMAIN_H": 0,
    "HAVE_SYS_TERMIO_H": 0,
    "HAVE_SYS_TIMES_H": 1,
    "HAVE_SYS_TIME_H": 1,
    "HAVE_SYS_TYPES_H": 1,
    "HAVE_SYS_UIO_H": 1,
    "HAVE_SYS_UN_H": 1,
    "HAVE_SYS_UTSNAME_H": 1,
    "HAVE_SYS_WAIT_H": 1,
    "HAVE_SYS_XATTR_H": 1,
    "HAVE_TCGETPGRP": 1,
    "HAVE_TCSETPGRP": 1,
    "HAVE_TEMPNAM": 1,
    "HAVE_TERMIOS_H": 1,
    "HAVE_TERM_H": 1,
    "HAVE_TGAMMA": 1,
    "HAVE_TIMEGM": 1,
    "HAVE_TIMES": 1,
    "HAVE_TMPFILE": 1,
    "HAVE_TMPNAM": 1,
    "HAVE_TMPNAM_R": 1,
    "HAVE_TM_ZONE": 1,
    "HAVE_TRUNCATE": 1,
    "HAVE_TZNAME": 0,
    "HAVE_UCS4_TCL": 0,
    "HAVE_UNAME": 1,
    "HAVE_UNISTD_H": 1,
    "HAVE_UNLINKAT": 1,
    "HAVE_USABLE_WCHAR_T": 0,
    "HAVE_UTIL_H": 0,
    "HAVE_UTIMENSAT": 1,
    "HAVE_UTIMES": 1,
    "HAVE_UTIME_H": 1,
    "HAVE_UUID_CREATE": 0,
    "HAVE_UUID_ENC_BE": 0,
    "HAVE_UUID_GENERATE_TIME_SAFE": 1,
    "HAVE_UUID_H": 0,
    "HAVE_UUID_UUID_H": 1,
    "HAVE_VFORK": 1,
    "HAVE_WAIT3": 1,
    "HAVE_WAIT4": 1,
    "HAVE_WAITID": 1,
    "HAVE_WAITPID": 1,
    "HAVE_WCHAR_H": 1,
    "HAVE_WCSCOLL": 1,
    "HAVE_WCSFTIME": 1,
    "HAVE_WCSXFRM": 1,
    "HAVE_WMEMCMP": 1,
    "HAVE_WORKING_TZSET": 1,
    "HAVE_WRITEV": 1,
    "HAVE_ZLIB_COPY": 1,
    "HAVE__GETPTY": 0,
    "HOST_GNU_TYPE": "x86_64-pc-linux-gnu",
    "INCLDIRSTOMAKE": "/usr/include /usr/include /usr/include/python3.10 /usr/include/python3.10",
    "INCLUDEDIR": "/usr/include",
    "INCLUDEPY": "/usr/include/python3.10",
    "INSTALL": "/usr/bin/install -c",
    "INSTALL_DATA": "/usr/bin/install -c -m 644",
    "INSTALL_PROGRAM": "/usr/bin/install -c",
    "INSTALL_SCRIPT": "/usr/bin/install -c",
    "INSTALL_SHARED": "/usr/bin/install -c -m 755",
    "INSTSONAME": "libpython3.10.so.1.0",
    "IO_H": "Modules/_io/_iomodule.h",
    "IO_OBJS": "\\",
    "LDCXXSHARED": "x86_64-linux-gnu-g++ -shared -Wl,-O1 -Wl,-Bsymbolic-functions",
    "LDFLAGS": "-Wl,-Bsymbolic-functions      -g -fwrapv -O2   ",
    "LDFLAGS_NODIST": "",
    "LDLIBRARY": "libpython3.10.so",
    "LDLIBRARYDIR": "",
    "LDSHARED": "x86_64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions      -g -fwrapv -O2   ",
    "LDVERSION": "3.10",
    "LIBC": "",
    "LIBDEST": "/usr/lib/python3.10",
    "LIBDIR": "/usr/lib/x86_64-linux-gnu",
    "LIBFFI_INCLUDEDIR": "",
    "LIBM": "-lm",
    "LIBOBJDIR": "Python/",
    "LIBOBJS": "",
    "LIBPC": "/usr/lib/x86_64-linux-gnu/pkgconfig",
    "LIBPL": "/usr/lib/python3.10/config-3.10-x86_64-linux-gnu",
    "LIBPYTHON": "",
    "LIBRARY": "libpython3.10.a",
    "LIBRARY_DEPS": "libpython3.10.a libpython3.10.so libpython3.so",
    "LIBRARY_OBJS": "\\",
    "LIBRARY_OBJS_OMIT_FROZEN": "\\",
    "LIBS": "-lcrypt -ldl  -lm",
    "LIBSUBDIRS": "asyncio \\",
    "LINKCC": "x86_64-linux-gnu-gcc",
    "LINKFORSHARED": "-Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions",
    "LIPO_32BIT_FLAGS": "",
    "LIPO_INTEL64_FLAGS": "",
    "LLVM_PROF_ERR": "no",
    "LLVM_PROF_FILE": "",
    "LLVM_PROF_MERGER": "true",
    "LN": "ln",
    "LOCALMODLIBS": "-lexpat                       -L/usr/lib -lz                       -lexpat",
    "MACHDEP": "linux",
    "MACHDEP_OBJS": "",
    "MACHDESTLIB": "/usr/lib/x86_64-linux-gnu/python3.10",
    "MACOSX_DEPLOYMENT_TARGET": "",
    "MAINCC": "x86_64-linux-gnu-gcc",
    "MAJOR_IN_MKDEV": 0,
    "MAJOR_IN_SYSMACROS": 1,
    "MAKESETUP": "../Modules/makesetup",
    "MANDIR": "/usr/share/man",
    "MKDIR_P": "/bin/mkdir -p",
    "MODBUILT_NAMES": "array  cmath  math  _struct  _random  _elementtree  _pickle  _datetime  _bisect  _heapq  _statistics  unicodedata  fcntl  spwd  grp  select  _csv  _socket  _posixsubprocess  _md5  _sha1  _sha256  _sha512  _sha3  _blake2  syslog  binascii  zlib  posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  pyexpat  xxsubtype",
    "MODDISABLED_NAMES": "",
    "MODLIBS": "-lexpat                       -L/usr/lib -lz                       -lexpat",
    "MODOBJS": "$(sort   Modules/arraymodule.o  Modules/cmathmodule.o Modules/_math.o  Modules/mathmodule.o Modules/_math.o  Modules/_struct.o  Modules/_randommodule.o  Modules/_elementtree.o  Modules/_pickle.o  Modules/_datetimemodule.o  Modules/_bisectmodule.o  Modules/_heapqmodule.o  Modules/_statisticsmodule.o  Modules/unicodedata.o  Modules/fcntlmodule.o  Modules/spwdmodule.o  Modules/grpmodule.o  Modules/selectmodule.o  Modules/_csv.o  Modules/socketmodule.o  Modules/_posixsubprocess.o  Modules/md5module.o  Modules/sha1module.o  Modules/sha256module.o  Modules/sha512module.o  Modules/sha3module.o  Modules/blake2module.o Modules/blake2b_impl.o Modules/blake2s_impl.o  Modules/syslogmodule.o  Modules/binascii.o  Modules/zlibmodule.o  Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o  Modules/symtablemodule.o  Modules/pyexpat.o  Modules/xxsubtype.o)",
    "MODULE_OBJS": "\\",
    "MULTIARCH": "x86_64-linux-gnu",
    "MULTIARCH_CPPFLAGS": '-DMULTIARCH=\\"x86_64-linux-gnu\\"',
    "MVWDELCH_IS_EXPRESSION": 1,
    "NO_AS_NEEDED": "-Wl,--no-as-needed",
    "OBJECT_OBJS": "\\",
    "OPENSSL_INCLUDES": "",
    "OPENSSL_LDFLAGS": "",
    "OPENSSL_LIBS": "-lssl -lcrypto",
    "OPENSSL_RPATH": "",
    "OPT": "-DNDEBUG -g -fwrapv -O2 -Wall",
    "OTHER_LIBTOOL_OPT": "",
    "PACKAGE_BUGREPORT": 0,
    "PACKAGE_NAME": 0,
    "PACKAGE_STRING": 0,
    "PACKAGE_TARNAME": 0,
    "PACKAGE_URL": 0,
    "PACKAGE_VERSION": 0,
    "PARSER_HEADERS": "\\",
    "PARSER_OBJS": "\\ \\ Parser/myreadline.o Parser/tokenizer.o",
    "PEGEN_HEADERS": "\\",
    "PEGEN_OBJS": "\\",
    "PGO_PROF_GEN_FLAG": "-fprofile-generate",
    "PGO_PROF_USE_FLAG": "",
    "PLATLIBDIR": "lib",
    "POBJS": "\\",
    "POSIX_SEMAPHORES_NOT_ENABLED": 0,
    "PROFILE_TASK": "-m test --pgo --timeout=1200",
    "PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT": 1,
    "PTHREAD_SYSTEM_SCHED_SUPPORTED": 1,
    "PURIFY": "",
    "PY3LIBRARY": "libpython3.so",
    "PYLONG_BITS_IN_DIGIT": 0,
    "PYTHON": "python",
    "PYTHONFRAMEWORK": "",
    "PYTHONFRAMEWORKDIR": "no-framework",
    "PYTHONFRAMEWORKINSTALLDIR": "",
    "PYTHONFRAMEWORKPREFIX": "",
    "PYTHONPATH": "",
    "PYTHON_FOR_BUILD": "./python -E",
    "PYTHON_FOR_REGEN": "",
    "PYTHON_HEADERS": "\\",
    "PYTHON_OBJS": "\\",
    "PY_BUILTIN_HASHLIB_HASHES": '"md5,sha1,sha256,sha512,sha3,blake2"',
    "PY_BUILTIN_MODULE_CFLAGS": "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g       -fstack-protector-strong -Wformat -Werror=format-security  -g -fwrapv -O2    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I../Include/internal -IObjects -IInclude -IPython -I. -I../Include -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPy_BUILD_CORE_BUILTIN",
    "PY_CFLAGS": "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g       -fstack-protector-strong -Wformat -Werror=format-security  -g -fwrapv -O2   ",
    "PY_CFLAGS_NODIST": "-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I../Include/internal",
    "PY_COERCE_C_LOCALE": 1,
    "PY_CORE_CFLAGS": "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g       -fstack-protector-strong -Wformat -Werror=format-security  -g -fwrapv -O2    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I../Include/internal -IObjects -IInclude -IPython -I. -I../Include -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DPy_BUILD_CORE",
    "PY_CORE_LDFLAGS": "-Wl,-Bsymbolic-functions      -g -fwrapv -O2   ",
    "PY_CPPFLAGS": "-IObjects -IInclude -IPython -I. -I../Include -Wdate-time -D_FORTIFY_SOURCE=2",
    "PY_ENABLE_SHARED": 1,
    "PY_FORMAT_SIZE_T": '"z"',
    "PY_LDFLAGS": "-Wl,-Bsymbolic-functions      -g -fwrapv -O2   ",
    "PY_LDFLAGS_NODIST": "",
    "PY_SSL_DEFAULT_CIPHERS": 1,
    "PY_SSL_DEFAULT_CIPHER_STRING": 0,
    "PY_STDMODULE_CFLAGS": "-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g       -fstack-protector-strong -Wformat -Werror=format-security  -g -fwrapv -O2    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I../Include/internal -IObjects -IInclude -IPython -I. -I../Include -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC",
    "Py_DEBUG": 0,
    "Py_ENABLE_SHARED": 1,
    "Py_HASH_ALGORITHM": 0,
    "Py_TRACE_REFS": 0,
    "QUICKTESTOPTS": "-x test_subprocess test_io test_lib2to3 \\",
    "READELF": "readelf",
    "RESSRCDIR": "Mac/Resources/framework",
    "RETSIGTYPE": "void",
    "RUNSHARED": "LD_LIBRARY_PATH=/build/python3.10-rtDYKr/python3.10-3.10.12/build-shared",
    "SCRIPTDIR": "/usr/lib",
    "SETPGRP_HAVE_ARG": 0,
    "SHELL": "/bin/sh",
    "SHLIBS": "-lcrypt -ldl  -lm",
    "SHLIB_SUFFIX": ".so",
    "SHM_NEEDS_LIBRT": 0,
    "SIGNED_RIGHT_SHIFT_ZERO_FILLS": 0,
    "SITEPATH": "",
    "SIZEOF_DOUBLE": 8,
    "SIZEOF_FLOAT": 4,
    "SIZEOF_FPOS_T": 16,
    "SIZEOF_INT": 4,
    "SIZEOF_LONG": 8,
    "SIZEOF_LONG_DOUBLE": 16,
    "SIZEOF_LONG_LONG": 8,
    "SIZEOF_OFF_T": 8,
    "SIZEOF_PID_T": 4,
    "SIZEOF_PTHREAD_KEY_T": 4,
    "SIZEOF_PTHREAD_T": 8,
    "SIZEOF_SHORT": 2,
    "SIZEOF_SIZE_T": 8,
    "SIZEOF_TIME_T": 8,
    "SIZEOF_UINTPTR_T": 8,
    "SIZEOF_VOID_P": 8,
    "SIZEOF_WCHAR_T": 4,
    "SIZEOF__BOOL": 1,
    "SOABI": "cpython-310-x86_64-linux-gnu",
    "SRCDIRS": "Parser Objects Python Modules Modules/_io Programs",
    "SRC_GDB_HOOKS": "../Tools/gdb/libpython.py",
    "STATIC_LIBPYTHON": 1,
    "STDC_HEADERS": 1,
    "STRICT_SYSV_CURSES": "/* Don't use ncurses extensions */",
    "STRIPFLAG": "-s",
    "SUBDIRS": "",
    "SUBDIRSTOO": "Include Lib Misc",
    "SYSLIBS": "-lm",
    "SYS_SELECT_WITH_SYS_TIME": 1,
    "TCLTK_INCLUDES": "-I/usr/include/tcl8.6",
    "TCLTK_LIBS": "-ltk8.6 -ltkstub8.6 -ltcl8.6 -ltclstub8.6",
    "TESTOPTS": "",
    "TESTPATH": "",
    "TESTPYTHON": "LD_LIBRARY_PATH=/build/python3.10-rtDYKr/python3.10-3.10.12/build-shared ./python",
    "TESTPYTHONOPTS": "",
    "TESTRUNNER": "LD_LIBRARY_PATH=/build/python3.10-rtDYKr/python3.10-3.10.12/build-shared ./python ../Tools/scripts/run_tests.py",
    "TESTSUBDIRS": "ctypes/test \\",
    "TESTTIMEOUT": 1200,
    "TEST_MODULES": "yes",
    "THREAD_STACK_SIZE": 0,
    "TIMEMODULE_LIB": 0,
    "TIME_WITH_SYS_TIME": 1,
    "TM_IN_SYS_TIME": 0,
    "TZPATH": "/usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/zoneinfo",
    "UNICODE_DEPS": "\\",
    "UNIVERSALSDK": "",
    "UPDATE_FILE": "../Tools/scripts/update_file.py",
    "USE_COMPUTED_GOTOS": 1,
    "VERSION": "3.10",
    "VPATH": "..",
    "WHEEL_PKG_DIR": "/usr/share/python-wheels/",
    "WINDOW_HAS_FLAGS": 1,
    "WITH_DECIMAL_CONTEXTVAR": 1,
    "WITH_DOC_STRINGS": 1,
    "WITH_DTRACE": 1,
    "WITH_DYLD": 0,
    "WITH_EDITLINE": 0,
    "WITH_LIBINTL": 0,
    "WITH_NEXT_FRAMEWORK": 0,
    "WITH_PYMALLOC": 1,
    "WITH_VALGRIND": 0,
    "X87_DOUBLE_ROUNDING": 0,
    "XMLLIBSUBDIRS": "xml xml/dom xml/etree xml/parsers xml/sax",
    "abs_builddir": "/build/python3.10-rtDYKr/python3.10-3.10.12/build-shared",
    "abs_srcdir": "/build/python3.10-rtDYKr/python3.10-3.10.12/build-shared/..",
    "datarootdir": "/usr/share",
    "srcdir": "/usr/lib/python3.10/config-3.10-x86_64-linux-gnu",
    "SO": ".cpython-310-x86_64-linux-gnu.so",
    "userbase": "/home/falinux/.local",
    "multiarchsubdir": "/x86_64-linux-gnu",
}

 

 대충검색해봐도 아키텍쳐 설정은 없는데 SSE, MMX, AVX 관련 설정은 없는 것 같고

-march=cpu-type
Generate instructions for the machine type cpu-type. In contrast to -mtune=cpu-type, which merely tunes the generated code for the specified cpu-type, -march=cpu-type allows GCC to generate code that may not run at all on processors other than the one indicated. Specifying -march=cpu-type implies -mtune=cpu-type, except where noted otherwise.

The choices for cpu-type are:

‘native’
This selects the CPU to generate code for at compilation time by determining the processor type of the compiling machine. Using -march=native enables all instruction subsets supported by the local machine (hence the result might not run on different machines). Using -mtune=native produces code optimized for the local machine under the constraints of the selected instruction set.

‘x86-64’
A generic CPU with 64-bit extensions, MMX, SSE, SSE2, and FXSR instruction set support.

[링크 : https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html]

 

그렇다고 해서 -O2 까지만 보이니 vectorization은 지원안할꺼 같고...

Vectorization in GCC is enabled at -O3. That's why at -O0, you see only the ordinary scalar SSE2 instructions (movsd, addsd, etc). 

[링크 : https://stackoverflow.com/questions/7919304/gcc-sse-code-optimization]

'Programming > python(파이썬)' 카테고리의 다른 글

pip 패키지 완전 삭제하기  (0) 2025.08.13
pip install cmake build multi core support  (0) 2025.08.13
python용 얼굴탐지, 인식  (0) 2025.08.04
python struct  (0) 2024.12.13
python matplotlib 동시 여러개 띄우기  (0) 2024.05.29
Posted by 구차니

테스트 해보니 haar 보다 프레임은 안나오고(한 10프레임?)

cpu 점유율은 1개 조지지만, 전체 로드율은 낮은 듯

 

[링크 : https://github.com/ageitgey/face_recognition]

     [링크 : https://wikidocs.net/227902]

[링크 : https://dlib.net/]

 

haar cascade

[링크 : https://bkshin.tistory.com/entry/컴퓨터-비전-1-하르-캐스케이드-얼굴-검출-Haar-Cascade-Face-Detection]



face_recognition 패키지

import cv2
import face_recognition

webcam = cv2.VideoCapture(0)

if not webcam.isOpened():
    print("Could not open webcam")
    exit()

while webcam.isOpened():
    status, frame = webcam.read()

    if status:
        face_locations = face_recognition.face_locations(frame)
        print(face_locations)
        if len(face_locations) > 0:
            for iter in face_locations:
                cv2.rectangle(frame, (iter[1], iter[0]), (iter[3], iter[2]), (0,255,0), 2)
        cv2.imshow("test", frame)

    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

webcam.release()
cv2.destroyAllWindows()

 

opencv2 / haar cascade

import cv2
import time

dirname = '/home/falinux/.local/lib/python3.10/site-packages/cv2/data/'

face_cascade = cv2.CascadeClassifier(dirname + 'haarcascade_frontalface_default.xml')
eye_cascade = cv2.CascadeClassifier(dirname + 'haarcascade_eye.xml')

cam = cv2.VideoCapture(0)
# cam.set(3, 160) # CV_CAP_PROP_FRAME_WIDTH
# cam.set(4, 120) # CV_CAP_PROP_FRAME_HEIGHT
# cam.set(5, 20) # CV_CAP_PROP_FPS
# print(cam.get(3))
# print(cam.get(4))
# print(cam.get(5))

while True:
 ret_val, img = cam.read()
 gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
 
 faces = face_cascade.detectMultiScale(gray, 1.05, 5)
 print(faces)
 for (x, y, w, h) in faces:
  img = cv2.rectangle(img, (x, y), (x+w, y+h), (255, 0, 0), 2)
  roi_gray = gray[y:y+h, x:x+w]
  roi_color = img[y:y+h, x:x+w]
  eyes = eye_cascade.detectMultiScale(roi_gray)
  for (ex, ey, ew, eh) in eyes:
   cv2.rectangle(roi_color, (ex, ey), (ex+ew, ey+eh), (0, 255, 0), 2)

 time.sleep(0.15)
 cv2.imshow("Cam Viewer", img)
#  cv2.imshow("Cam Viewer gray", gray)
 if cv2.waitKey(1) == 27:
     break

'Programming > python(파이썬)' 카테고리의 다른 글

pip install cmake build multi core support  (0) 2025.08.13
python 빌드 정보  (0) 2025.08.04
python struct  (0) 2024.12.13
python matplotlib 동시 여러개 띄우기  (0) 2024.05.29
python matplotlib 그래프 갱신하기  (0) 2024.05.27
Posted by 구차니

오랫만에 비가 오는데

또 팔당댐 열만큼 오진 않길 ㅜㅠ

'개소리 왈왈 > 육아관련 주저리' 카테고리의 다른 글

시승(?)  (1) 2025.08.15
타이어 펑크, 교체  (0) 2025.08.13
더워서 멀 못해먹겠네  (0) 2025.07.27
중문 수리  (0) 2025.07.23
다이소 투어  (1) 2025.07.20
Posted by 구차니
embeded/rpi pico2025. 8. 2. 18:52

나중에 한번 시도해봐야지~

[링크 : https://gregchadwick.co.uk/blog/playing-with-the-pico-pt3/]

Posted by 구차니
embeded/rpi pico2025. 8. 2. 15:57

조이스틱인데 이걸 이용해 빨콩을 만들어 봄

divider와 막판에 세제곱 하는걸 어떻게 건드리면

적절하게 최소 움직임과 빠른 움직임을 잡을수 있을 것 같은데 좋은 아이디어가 안나네..

 

 

import board
import digitalio
import analogio
import time
import usb_hid
from adafruit_hid.mouse import Mouse

adc_x = analogio.AnalogIn(board.A0)
adc_y = analogio.AnalogIn(board.A1)

click = digitalio.DigitalInOut(board.GP22)
click.direction = digitalio.Direction.INPUT
click.pull = digitalio.Pull.UP

mouse = Mouse(usb_hid.devices)

divider = 256 * 16
thres = 0 # degree
last_btn = True

calib_x = 0;
calib_y = 0;

for i in range(10):
    calib_x += adc_x.value
    calib_y += adc_y.value
    
calib_x = int(calib_x / 10)
calib_y = int(calib_y / 10)

thres_x = int(calib_x * thres / 90)
thres_y = int(calib_y * thres / 90)

print("calib : ",calib_x,",",calib_y)
print("thres : ",thres_x,",",thres_y)

while True:
#    print(adc_x.value,",",adc_y.value," ",click.value)

    if(last_btn != click.value):
        last_btn = click.value
        if last_btn is False:
            mouse.press(Mouse.LEFT_BUTTON)
            time.sleep(0.2)  # Debounce delay
        else:
            mouse.release(Mouse.LEFT_BUTTON)
            time.sleep(0.2)  # Debounce delay
    
    if adc_x.value > calib_x + thres_x:
        step = int(((adc_x.value - (calib_x + thres_x))) / divider)
        if abs(step) > 0:
            mouse.move(x = step * step * step);
        
    if adc_x.value < calib_x - thres_x:
        step = int(((adc_x.value - (calib_x - thres_x))) / divider)
        if abs(step) > 0:
            mouse.move(x = (step * step * step));

    if adc_y.value > calib_y + thres_y:
        step = int(((adc_y.value - (calib_y + thres_y))) / divider)
        if abs(step) > 0:
            mouse.move(y = step * step * step);
        
    if adc_y.value < calib_y - thres_y:
        step = int(((adc_y.value - (calib_y - thres_y))) / divider)
        if abs(step) > 0:
            mouse.move(y = (step * step * step));

 

일단은 내가 구매한 녀석이 이상해서, Y 축에 대해 점퍼를 날려주어야 정상적으로 값이 변화된다.

2025.08.02 - [잡동사니] - HW-504 이상해..

[링크 : http://chipgu.ru/viewtopic.php?t=3764&start=100]

 

요건 adafruit usb mouse 라이브러리 설명

[링크 : https://learn.adafruit.com/circuitpython-essentials/circuitpython-hid-keyboard-and-mouse]

'embeded > rpi pico' 카테고리의 다른 글

rpi pico pwm 으로 음악재생하기  (0) 2025.08.02
rpi pico circuit python 에서 code 실행하기  (0) 2025.08.02
rpi pico sdk  (0) 2025.03.23
rpi pico usb joystick  (0) 2024.10.07
pico real plus 윈도우에 연결하기  (0) 2024.07.31
Posted by 구차니