Opencv 3 1 0
Author: s | 2025-04-24
Problem with Opencv and Python. 0. Python For OpenCV. OpenCV 2.4.3 and Python. 0. OpenCV Python . OpenCV for Python 3.5.1. 3. OpenCV 3 Python. 2. Opencv Pythonprogram. 0. Opencv Raspberry python3. Hot Network Questions How to understand parking rules in Austria (street parking)
0 0 0 3 5 4 0 0 1 3 3 4 4 0 0 0 0 3 3 3 1 0 3 6 1 0 0 - fill-a
Nonzerox[left_lane_inds]lefty = nonzeroy[left_lane_inds] rightx = nonzerox[right_lane_inds]righty = nonzeroy[right_lane_inds]return leftx, lefty, rightx, righty, out_imgdef fit_polynomial_first_lane(binary_warped):leftx, lefty, rightx, righty, out_img = find_lane_pixels(binary_warped)left_fit = np.polyfit(lefty, leftx, 2)right_fit = np.polyfit(righty, rightx, 2)ploty = np.linspace(0, binary_warped.shape[0]-1, binary_warped.shape[0])try:left_fitx = left_fit[0] * ploty2 + left_fit[1] * ploty + left_fit[2]right_fitx = right_fit[0] * ploty2 + right_fit[1] * ploty + right_fit[2]except TypeError:print('The function failed to fit a line!')left_fitx = 1 * ploty2 + 1 * plotyright_fitx = 1 * ploty2 + 1 * plotyout_img[lefty, leftx] = [255, 0, 0]out_img[righty, rightx] = [0, 0, 255]left_pts = np.transpose(np.vstack((left_fitx, ploty))).astype(np.int32)right_pts = np.transpose(np.vstack((right_fitx, ploty))).astype(np.int32)cv2.polylines(out_img, np.int32([left_pts]), False, (255, 255, 0), thickness=5)cv2.polylines(out_img, np.int32([right_pts]), False, (255, 255, 0), thickness=5)return left_fit, right_fit, out_imgbinary_warped pixel range: 0 to 255binary_warped shape: (720, 1280, 3), type: uint8out_img shape: (720, 1280, 9), type: uint8error Traceback (most recent call last) in ()146147 # Find lane pixels and fit polynomial--> 148 left_fit, right_fit, out_img = fit_polynomial_first_lane(binary_warped)149150 # Plot the results1 frames in find_lane_pixels(binary_warped)66 win_xright_high = min(binary_warped.shape[1], win_xright_high)67---> 68 cv2.rectangle(out_img, (win_xleft_low, win_y_low), (win_xleft_high, win_y_high), (0, 255, 0), 2)69 cv2.rectangle(out_img, (win_xright_low, win_y_low), (win_xright_high, win_y_high), (0, 255, 0), 2)70error: OpenCV(4.8.0) /io/opencv/modules/core/src/copy.cpp:71: error: (-215:Assertion failed) cn
Maven Repository: opencv opencv 4.5.0-0
Import streamlit as st import cv2 import tflite_runtime.interpreter as tflite import numpy as np import threading from zipfile import ZipFile BOX_COLOR = (0, 255, 255) #Yellow TF_LITE_MODEL = './lite-model_ssd_mobilenet_v1_1_metadata_2.tflite' CLASSES_OF_INTEREST = ['person', 'car', 'cat', 'dog'] VIDEO_SOURCE = 0 # an integer number for an OpenCV supported camera or any video file def draw_boxes(frame, boxes, threshold, labelmap, obj_of_int): (h, w) = frame.shape[:2] #np array shapes are h,w OpenCV uses w,h for (t, l, b, r), label_id, c in boxes: if c > threshold and label_id in obj_of_int: top_left, bottom_right = (int(l*w), int(t*h)), (int(r*w), int(b*h)) cv2.rectangle(frame, top_left, bottom_right, BOX_COLOR, 2) cv2.putText(frame, f'{labelmap[int(label_id)]} {c:.4f}', top_left, cv2.FONT_HERSHEY_PLAIN, 1, BOX_COLOR) return frame def resize_keep_aspect(img, req_shape): ratio = max((img.shape[1]/req_shape[0], img.shape[0]/req_shape[1])) new_h, new_w = int(img.shape[0]/ratio), int(img.shape[1]/ratio) img = cv2.resize(img, (new_w, new_h)) img = cv2.copyMakeBorder(img, 0, (req_shape[1]-new_h), 0, (req_shape[0]-new_w), cv2.BORDER_CONSTANT) return img, (req_shape[1]/new_h, req_shape[0]/new_w) class CameraThread(threading.Thread): def __init__(self, name='CameraThread'): super().__init__(name=name, daemon=True) self.stop_event = False self.open_camera() self.setup_inference_engine() self._frame, self.results = np.zeros((300,300,3), dtype=np.uint8), [] #initial empty frame self.lock = threading.Lock() self.log_counter = 0 def open_camera(self): self.webcam = cv2.VideoCapture(VIDEO_SOURCE) def setup_inference_engine(self): self.intp = tflite.Interpreter(model_path=TF_LITE_MODEL) self.intp.allocate_tensors() self.input_idx = self.intp.get_input_details()[0]['index'] self.output_idxs = [i['index'] for i in self.intp.get_output_details()[:3]] def process_frame(self, img): _img, (rh, rw) = resize_keep_aspect(img, (300,300)) # cv2.resize(img, (300, 300)) self.intp.set_tensor(self.input_idx, _img[np.newaxis, :]) self.intp.invoke() boxes, label_id, conf = [self.intp.get_tensor(idx).squeeze() for idx in self.output_idxs] boxes = [(t*rh, l*rw, b*rh, r*rw) for (t, l, b, r) in boxes] # scale the coords back return list(zip(boxes, label_id, conf)) def run(self): while not self.stop_event: ret, img = self.webcam.read() if not ret: #re-open camera if read fails. UsefulMaven Repository: opencv opencv 4.0.0-0
A few weeks ago Raspbian Jessie was released, bringing in a ton of new, great features.However, the update to Jessie also broke the previous OpenCV + Python install instructions for Raspbian Wheezy:Install OpenCV 2.4 with Python 2.7 bindings on Raspbian Wheezy.Install OpenCV 3.0 with Python 2.7/Python 3+ bindings on Raspbian Wheezy.Since PyImageSearch has become the online destination for learning computer vision + OpenCV on the Raspberry Pi, I decided to write a new tutorial on installing OpenCV 3 with Python bindings on Raspbian Jessie.As an additional bonus, I’ve also included a video tutorial that you can use to follow along with me as I install OpenCV 3 on my own Raspberry Pi 2 running Raspbian Jessie.This video tutorial should help address the most common questions, doubts, and pitfalls that arise when installing OpenCV + Python bindings on the Raspberry Pi for the first time.AssumptionsFor this tutorial I am going to assume that you already own a Raspberry Pi 2 with Raspbian Jessie installed. Other than that, you should either have (1) physical access to your Pi 2 and can open up a terminal or (2) remote access where you can SSH in. I’ll be doing this tutorial via SSH, but as long as you have access to a terminal, it really doesn’t matter.The quick start video tutorialBefore we get this tutorial underway, let me ask you two quick questions:Is this your first time installing OpenCV?Are you just getting started learning Linux and how to use the command line?If you answered yes to either of these questions, I highly suggest that you watch the video below and follow along with me as a guide you step-by-step on how to install OpenCV 3 with Python bindings on your Raspberry Pi 2 running Raspbian Jessie:Otherwise, if you feel comfortable using the command line or if you have previous experience using the command line, feel free to follow the tutorial below.Installing OpenCV 3 on Raspbian JessieInstalling OpenCV 3 is a multi-step (and even time consuming) process requiring you to install many dependencies and pre-requisites. The remainder of this tutorial will guide you step-by-step through. Problem with Opencv and Python. 0. Python For OpenCV. OpenCV 2.4.3 and Python. 0. OpenCV Python . OpenCV for Python 3.5.1. 3. OpenCV 3 Python. 2. Opencv Pythonprogram. 0. Opencv Raspberry python3. Hot Network Questions How to understand parking rules in Austria (street parking)Maven Repository: opencv opencv 4.10.0-0
🐛 BugI think it's a small problem but I still can't future it out ..I want to accomplish inference feature using libtorch and OpenCV . So I downloaded the last libtorch(GPU) from Pytorch.org. And also build OpenCV(4.0.0) from source.When I build libtorch app and OpenCV app with cmake independently, it succeeds.And when I build libtorch and OpenCV together and don't use 'imread()' function,it succeeds. And the code works in GPU(speed faster than CPU):#include "torch/script.h"#include "torch/torch.h"#include #include #include using namespace std;using namespace cv;int main(int argc, const char* argv[]){ if (argc != 2) { std::cerr \n"; return -1; } std::shared_ptr module = torch::jit::load(argv[1]); std::vector inputs; inputs.push_back(torch::ones({1,3,224,224}).to(at::kCUDA)); module->to(at::kCUDA); // inputs.at[0].to(at::kCUDA); double timeStart = (double)getTickCount(); for(int i = 0 ; i forward(inputs).toTensor(); double nTime = ((double)getTickCount() - timeStart) / getTickFrequency(); cout #include opencv2/opencv.hpp>#include "torch/script.h"#include "torch/torch.h"#include iostream>#include memory>#include ctime>using namespace std;using namespace cv;int main(int argc, const char* argv[]){ if (argc != 2) { std::cerr "usage: example-app \n"; return -1; } std::shared_ptr module = torch::jit::load(argv[1]); std::vector inputs; inputs.push_back(torch::ones({1,3,224,224}).to(at::kCUDA)); module->to(at::kCUDA); // inputs.at[0].to(at::kCUDA); double timeStart = (double)getTickCount(); for(int i = 0 ; i 1000 ; i++) at::Tensor output = module->forward(inputs).toTensor(); double nTime = ((double)getTickCount() - timeStart) / getTickFrequency(); cout "Time used:" 1000 " ms" the CMakeLists:cmake_minimum_required(VERSION 3.12 FATAL_ERROR)project(simnet)find_package(Torch REQUIRED)find_package(OpenCV REQUIRED)if(NOT Torch_FOUND) message(FATAL_ERROR "Pytorch Not Found!")endif(NOT Torch_FOUND)message(STATUS "Pytorch status:")message(STATUS " libraries: ${TORCH_LIBRARIES}")message(STATUS "OpenCV library status:")message(STATUS " version: ${OpenCV_VERSION}")message(STATUS " libraries: ${OpenCV_LIBS}")message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")add_executable(simnet main.cpp)# link_directories(/usr/local/lib) 'find_package' has already done thistarget_link_libraries(simnet ${TORCH_LIBRARIES} ${OpenCV_LIBS})set_property(TARGET simnet PROPERTY CXX_STANDARD 11)and cmake config:/home/prototype/Downloads/clion-2018.3/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/home/prototype/Desktop/Cuda-project/libtorch -G "CodeBlocks - Unix Makefiles" /home/prototype/CLionProjects/simnet-- The C compiler identification is GNU 7.3.0-- The CXX compiler identification is GNU 7.3.0-- Check for working C compiler: /usr/bin/cc-- Check for working C compiler: /usr/bin/cc -- works-- Detecting C compiler ABI info-- Detecting C compiler ABI info - done-- Detecting C compile features-- Detecting C compile features - done-- Check for working CXX compiler: /usr/bin/c++-- Check for working CXX compiler: /usr/bin/c++ -- works-- Detecting CXX compiler ABI info-- Detecting CXX compiler ABI info - done-- Detecting CXX compile features-- Detecting CXX compile features - done-- Looking for pthread.h-- Looking for pthread.h - found-- Looking for pthread_create-- Looking for pthread_create -Maven Repository: opencv opencv 4.3.0-0
Imgproc.morphologyEx(input, output, Imgproc.MORPH_OPEN, erodeElement); }}Thank you! Perhaps that strange problem is a bug in OpenCV 3.4.1 itself. bug will be fixed in the next version OpenCVForUnity.I don’t have the versions of OpenCV for MOBILE devices build with ffmpeg.Thank you for your valuable ideas.Currently, plugin files that exclude the contrib module for Android and iOS platform are included with OpenCVForUnity. When reusing mat used for Utils.matToTexture2D (Mat mat, Texture2D texture2D, bool flip = true, int flipCode = 0, bool flipAfter = false), please set flipAfter flag to true. // Generate mat for mask --- Utils.matToTexture2D(mat_mask, texToDisplay_mask, true, 0, true); --- qwert024 August 10, 2018, 1:35pm 1756 Thank you!! ososmam August 12, 2018, 9:40am 1757 HelloI need to crop the detected face from the webcam feed as 2d texture or even mesh and put it in another place is that possible and how to achieve this I’m using dlib face landmark and please I’m a beginner so I don’t know what to do I think that this example will be helpful for what you want to realize. qwert024 August 15, 2018, 3:34am 1759 Hello!I am trying to set flipAfter flag to true as you said. However I got “No overload for method ‘matToTexture2D’ takes 5 arguments” error and I am not able to figure it out. It would be great if you would tell me what I’ve done wrong. THank you! I am new to OpenCV but working to make a face detection feature.The AsyncFaceDetectionWebCamTextureExample works well on Unity editor but theMaven Repository: opencv opencv 4.2.0-0
Skip to content Navigation Menu GitHub Copilot Write better code with AI Security Find and fix vulnerabilities Actions Automate any workflow Codespaces Instant dev environments Issues Plan and track work Code Review Manage code changes Discussions Collaborate outside of code Code Search Find more, search less Explore Learning Pathways Events & Webinars Ebooks & Whitepapers Customer Stories Partners Executive Insights GitHub Sponsors Fund open source developers The ReadME Project GitHub community articles Enterprise platform AI-powered developer platform Pricing Provide feedback Saved searches Use saved searches to filter your results more quickly /;ref_cta:Sign up;ref_loc:header logged out"}"> Sign up Repository files navigationREADMETiny-Face-Auto-MosiacThis is a video(image) auto face mosaic tool that based on tiny face detector trained on TensorFlow and implemented with OpenCV. About This is a video(image) auto face mosaic tool that based on tiny face detector trained on TensorFlow and implemented with OpenCV. Resources Readme Activity Stars 3 stars Watchers 1 watching Forks 0 forksMaven Repository: opencv opencv 4.9.0-0
12,141 topics in this forum Sort By Recently Updated Title Start Date Most Viewed Most Replies Custom Filter By All Solved Topics Unsolved Topics Prev 1 2 3 4 5 6 7 Next Page 2 of 486 _LevenshteinDistance By WarMan, February 14 1 reply 317 views AspirinJunkie February 15 Run binary 1 2 3 4 11 By trancexx, August 3, 2009 210 replies 155.5k views Damnatio February 11 AutoIt parser in AutoIt By genius257, February 8 parser ast 6 replies 524 views genius257 February 10 Ternary Operators in AutoIt By TreatJ, February 9 8 replies 357 views Werty February 9 QuickLaunch alternative for Windows 11 By dv8, January 13 4 replies 848 views hughmanic February 9 Installer for execute a3x-Files By Schnuffel, January 25 8 replies 636 views Schnuffel February 9 SoundTool Playback Devices Mute Status (Auto Unmute if Muted) By TreatJ, February 6 12 replies 426 views TreatJ February 9 GUIFrame UDF - Melba23 version - 19 May 14 1 2 3 4 8 By Melba23, September 10, 2010 142 replies 110.1k views WildByDesign February 8 _ArrayCopyRange By WarMan, February 4 _arraycopyrange array 0 replies 468 views WarMan February 4 OpenCV v4 UDF 1 2 3 4 9 By smbape, August 10, 2021 opencv 174 replies 48.5k views k_u_x February 2 RustDesk UDF By BinaryBrother, December 30, 2024 13 replies 1.7k views BinaryBrother January 26 Advanced Icon Displayer In Listview By Zohran, March 25, 2012 12 replies 5.4k views manpower January 25 Screen scraping 1 2 3 By Nine, August 20, 2021 47 replies 14.9k views BinaryBrother January 23 Smtp Mailer That Supports Html And Attachments. 1 2 3 4 39 By Jos, March 28, 2006 763 replies 442.6k views SenfoMix January 21 The Taquin Puzzle By Numeric1, January 20 0 replies 375 views Numeric1 January 20 _RunWaitEx() UDF By argumentum, January 18 runwait 0 replies 430 views argumentum January 18 Multi-Task (easily run and mange many processes) 1 2 By Gianni, January 28, 2018 multi-task 22 replies 11.3k views water January 16 Extended Message Box - New Version: 16 Feb 24 1 2 3 4 19 By Melba23, January 29, 2010 360 replies 221.6k views BinaryBrother January 15 Conway's Game of Life: A Fascinating Cellular Automaton By Numeric1, January 13 0 replies 326 views Numeric1 January 13 The GASP Game By Numeric1, January 9 7 replies 503 views orbs January 13 Round buttons By ioa747, March 28, 2024. Problem with Opencv and Python. 0. Python For OpenCV. OpenCV 2.4.3 and Python. 0. OpenCV Python . OpenCV for Python 3.5.1. 3. OpenCV 3 Python. 2. Opencv Pythonprogram. 0. Opencv Raspberry python3. Hot Network Questions How to understand parking rules in Austria (street parking)
Maven Repository: opencv opencv 4.7.0-0
I’ll admit it: Compiling and installing OpenCV 3 on macOS Sierra was a lot more of a challenge than I thought it would be, even for someone who has a compiled OpenCV on hundreds of machines over his lifetime.If you’ve tried to use one of my previous tutorials on installing OpenCV on your freshly updated Mac (Sierra or greater) you likely ran into a few errors, specifically with the QTKit.h header files.And even if you were able to resolve the QTKit problem, you likely ran into more issues trying to get your CMake command configured just right.In order to help resolve any issues, problems, or confusion when installing OpenCV with Python bindings on macOS Sierra (or greater) I’ve decided to create two hyper-detailed tutorials:This first tutorial covers how to install OpenCV 3 with Python 2.7 bindings on macOS.My second tutorial will come next week where I’ll demonstrate how to install OpenCV 3 with Python 3.5 bindings on macOS.I decided to break these tutorials into two separate blog posts because they are quite lengthy.Furthermore, tuning your CMake command to get it exactly right can be a bit of a challenge, especially if you’re new to compiling from OpenCV from source, so I wanted to take the time to devise a foolproof method to help readers get OpenCV installed on macOS.To learn how to install OpenCV with Python 2.7 bindings on your macOS system, keep reading.The first part of this blog post details why I am creating a new tutorial for installing OpenCV 3 with Python bindings on the Mac Operating System. In particular, I explain a common error you may have run across — the QTKit.h header issue from the now deprecated QTKit library.From there, I provide super detailed instructions on how to install OpenCV 3 + Python 2.7 your macOS Sierra system or greater.Avoiding the QTKit/QTKit.h file not found errorIn the Mac OSX environment the QTKit (QuickTime Kit) Objective-C framework is used for manipulating, reading, and writing media. In OSX version 10.9 (Mavericks) QTKit was deprecated (source).However, it wasn’t until the release of macOS Sierra that much of QTKit was removed and instead replaced with AVFoundation, the successor to QTKit. AVFoundation is the new framework for working with audiovisual media in iOS and macOS.This created a big problem when compiling OpenCV on Mac systems — the QTKit headers were not found on the system and were expected to exist.Thus, if you tried to compile OpenCV on your Mac using my previous tutorials your compile likely bombed out and you ended up with an error message similar to this:fatal error: 'QTKit/QTKit.h' file not found#import ^ 1 error generated. make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_qtkit.mm.o]Error 1 make[1]: ***[modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2 make: ***[all] Error 2Even more problematic, both the tagged releases of OpenCV v3.0 and v3.1 do not include fixes to this issue.That said, the latest commits to the OpenCV GitHub repo do address this issue; however, a new tagged release of v3.2 has yet to be released.That said, I’m happy to report that by usingHamachi 1 0 3 0 - Gratuiciel.com
#5: Finishing the installWe’re almost there! Just a few more things and we’ll be 100% done.For Python 2.7:Provided you finished Step #4 without error, OpenCV should now be installed in /usr/local/lib/python2.7/site-packages :$ ls -l /usr/local/lib/python2.7/site-packages/total 1636-rw-r--r-- 1 root staff 1675144 Oct 17 15:25 cv2.soNote: In some instances OpenCV can be installed in /usr/local/lib/python2.7/dist-packages (note the dist-packages rather than site-packages ). If you do not find the cv2.so bindings in site-packages , be sure to check dist-packages as well.The last step here is to sym-link the OpenCV bindings into the cv virtual environment:$ cd ~/.virtualenvs/cv/lib/python2.7/site-packages/$ ln -s /usr/local/lib/python2.7/site-packages/cv2.so cv2.soFor Python 3:OpenCV should now be installed in /usr/local/lib/python3.4/site-packages :$ ls /usr/local/lib/python3.4/site-packages/cv2.cpython-34m.soFor some reason, unbeknownst to me, when compiling the Python 3 bindings the output .so file is named cv2.cpython-34m.so rather than cv2.so .Luckily, this is an easy fix. All we need to do is rename the file:$ cd /usr/local/lib/python3.4/site-packages/$ sudo mv cv2.cpython-34m.so cv2.soFollowed by sym-linking OpenCV into our cv virtual environment:$ cd ~/.virtualenvs/cv/lib/python3.4/site-packages/$ ln -s /usr/local/lib/python3.4/site-packages/cv2.so cv2.soStep #6: Verifying your OpenCV 3 installAt this point, OpenCV 3 should be installed on your Raspberry Pi running Raspbian Jessie!But before we wrap this tutorial up, let’s verify that your OpenCV installation is working by accessing the cv virtual environment and importing cv2 , the OpenCV + Python bindings:$ workon cv$ python>>> import cv2>>> cv2.__version__'3.0.0'You can see a screenshot of my terminal below, indicating that OpenCV 3 has been successfully installed:Figure 5: OpenCV 3 + Python 3 bindings have been successfully installed on my Raspberry Pi 2 running Rasbian Jessie.TroubleshootingQ. When I try to use the mkvirtualenv or workon commands, I get an error saying “command not found”.A. Go back to Step #3 and ensure your ~/.profile file has been updated properly. Once you have updated it, be sure to run source ~/.profile to reload it.Q. After I reboot/logout/open up a new terminal, I cannot run the mkvirtualenv or workon commands.A. Anytime you reboot your system, logout and log back in, or open up a new terminal, you should run source ~/.profile to make sure you have access to your Python virtual environments.Q. When I. Problem with Opencv and Python. 0. Python For OpenCV. OpenCV 2.4.3 and Python. 0. OpenCV Python . OpenCV for Python 3.5.1. 3. OpenCV 3 Python. 2. Opencv Pythonprogram. 0. Opencv Raspberry python3. Hot Network Questions How to understand parking rules in Austria (street parking)0 0 Skyrim.esm 1 1 Update.esm 2 2 RaceCompatibility.esm 3 3
Mupen64Plus-Core READMEMore documentation can be found on the Mupen64Plus websiteand you can find a more complete README file on the wiki.Mupen64Plus is based off of mupen64, originally created by Hacktarux. Thispackage contains only the Mupen64Plus core library. For a fully functionalemulator, the user must also install graphics, sound, input, and RSP plugins,as well as a user interface program (called a front-end).README SectionsRequirements and Prerequisites- Binary- SourceBuilding From SourceInstallation- Binary- Source- Custom Installation PathKey Commands In Emulator1. Requirements and Pre-requisitesBinary Package RequirementsSDL 1.2 or 2.0libpngfreetype 2zlibSource Build RequirementsIn addition to the binary libraries, the following packages are required if youbuild Mupen64Plus from source:GNU C and C++ compiler, libraries, and headersGNU makeNasmDevelopment packages for all the libraries above2. Building From SourceIf you downloaded the binary distribution of Mupen64Plus, skip to theInstallation process (Section 3). To build the source distribution, unzip and cd into theprojects/unix directory, then build using make: $ unzip mupen64plus-core-x-y-z-src.zip $ cd mupen64plus-core-x-y-z-src/projects/unix $ make allType make by itself to view all available build options: $ make Mupen64Plus-core makefile. Targets: all == Build Mupen64Plus core library clean == remove object files install == Install Mupen64Plus core library uninstall == Uninstall Mupen64Plus core library Build Options: BITS=32 == build 32-bit binaries on 64-bit machine LIRC=1 == enable LIRC support NO_ASM=1 == build without assembly (no dynamic recompiler or MMX/SSE code) USE_GLES=1 == build against GLESv2 instead of OpenGL VC=1 == build against Broadcom Videocore GLESv2 NEON=1 == (ARM only) build for hard floating point environments VFP_HARD=1 == (ARM only) full hardware floating point ABI SHAREDIR=path == extra path to search for shared data files OPTFLAGS=flag == compiler optimization (default: -O3 -flto) WARNFLAGS=flag == compiler warning levels (default: -Wall) PIC=(1|0) == Force enable/disable of position independent code OSD=(1|0) == Enable/disable build of OpenGL On-screen display NETPLAY=1 == Enable netplay functionality, requires SDL2_net NEW_DYNAREC=1 == Replace dynamic recompiler with Ari64's experimental dynarec KEYBINDINGS=0 == Disables the default keybindings ACCURATE_FPU=1 == Enables accurate FPU behavior (i.e correct cause bits) OPENCV=1 == Enable OpenCV support VULKAN=0 == Disable vulkan support for the default video extension implementation POSTFIX=name == String added to the name of theComments
Nonzerox[left_lane_inds]lefty = nonzeroy[left_lane_inds] rightx = nonzerox[right_lane_inds]righty = nonzeroy[right_lane_inds]return leftx, lefty, rightx, righty, out_imgdef fit_polynomial_first_lane(binary_warped):leftx, lefty, rightx, righty, out_img = find_lane_pixels(binary_warped)left_fit = np.polyfit(lefty, leftx, 2)right_fit = np.polyfit(righty, rightx, 2)ploty = np.linspace(0, binary_warped.shape[0]-1, binary_warped.shape[0])try:left_fitx = left_fit[0] * ploty2 + left_fit[1] * ploty + left_fit[2]right_fitx = right_fit[0] * ploty2 + right_fit[1] * ploty + right_fit[2]except TypeError:print('The function failed to fit a line!')left_fitx = 1 * ploty2 + 1 * plotyright_fitx = 1 * ploty2 + 1 * plotyout_img[lefty, leftx] = [255, 0, 0]out_img[righty, rightx] = [0, 0, 255]left_pts = np.transpose(np.vstack((left_fitx, ploty))).astype(np.int32)right_pts = np.transpose(np.vstack((right_fitx, ploty))).astype(np.int32)cv2.polylines(out_img, np.int32([left_pts]), False, (255, 255, 0), thickness=5)cv2.polylines(out_img, np.int32([right_pts]), False, (255, 255, 0), thickness=5)return left_fit, right_fit, out_imgbinary_warped pixel range: 0 to 255binary_warped shape: (720, 1280, 3), type: uint8out_img shape: (720, 1280, 9), type: uint8error Traceback (most recent call last) in ()146147 # Find lane pixels and fit polynomial--> 148 left_fit, right_fit, out_img = fit_polynomial_first_lane(binary_warped)149150 # Plot the results1 frames in find_lane_pixels(binary_warped)66 win_xright_high = min(binary_warped.shape[1], win_xright_high)67---> 68 cv2.rectangle(out_img, (win_xleft_low, win_y_low), (win_xleft_high, win_y_high), (0, 255, 0), 2)69 cv2.rectangle(out_img, (win_xright_low, win_y_low), (win_xright_high, win_y_high), (0, 255, 0), 2)70error: OpenCV(4.8.0) /io/opencv/modules/core/src/copy.cpp:71: error: (-215:Assertion failed) cn
2025-04-05Import streamlit as st import cv2 import tflite_runtime.interpreter as tflite import numpy as np import threading from zipfile import ZipFile BOX_COLOR = (0, 255, 255) #Yellow TF_LITE_MODEL = './lite-model_ssd_mobilenet_v1_1_metadata_2.tflite' CLASSES_OF_INTEREST = ['person', 'car', 'cat', 'dog'] VIDEO_SOURCE = 0 # an integer number for an OpenCV supported camera or any video file def draw_boxes(frame, boxes, threshold, labelmap, obj_of_int): (h, w) = frame.shape[:2] #np array shapes are h,w OpenCV uses w,h for (t, l, b, r), label_id, c in boxes: if c > threshold and label_id in obj_of_int: top_left, bottom_right = (int(l*w), int(t*h)), (int(r*w), int(b*h)) cv2.rectangle(frame, top_left, bottom_right, BOX_COLOR, 2) cv2.putText(frame, f'{labelmap[int(label_id)]} {c:.4f}', top_left, cv2.FONT_HERSHEY_PLAIN, 1, BOX_COLOR) return frame def resize_keep_aspect(img, req_shape): ratio = max((img.shape[1]/req_shape[0], img.shape[0]/req_shape[1])) new_h, new_w = int(img.shape[0]/ratio), int(img.shape[1]/ratio) img = cv2.resize(img, (new_w, new_h)) img = cv2.copyMakeBorder(img, 0, (req_shape[1]-new_h), 0, (req_shape[0]-new_w), cv2.BORDER_CONSTANT) return img, (req_shape[1]/new_h, req_shape[0]/new_w) class CameraThread(threading.Thread): def __init__(self, name='CameraThread'): super().__init__(name=name, daemon=True) self.stop_event = False self.open_camera() self.setup_inference_engine() self._frame, self.results = np.zeros((300,300,3), dtype=np.uint8), [] #initial empty frame self.lock = threading.Lock() self.log_counter = 0 def open_camera(self): self.webcam = cv2.VideoCapture(VIDEO_SOURCE) def setup_inference_engine(self): self.intp = tflite.Interpreter(model_path=TF_LITE_MODEL) self.intp.allocate_tensors() self.input_idx = self.intp.get_input_details()[0]['index'] self.output_idxs = [i['index'] for i in self.intp.get_output_details()[:3]] def process_frame(self, img): _img, (rh, rw) = resize_keep_aspect(img, (300,300)) # cv2.resize(img, (300, 300)) self.intp.set_tensor(self.input_idx, _img[np.newaxis, :]) self.intp.invoke() boxes, label_id, conf = [self.intp.get_tensor(idx).squeeze() for idx in self.output_idxs] boxes = [(t*rh, l*rw, b*rh, r*rw) for (t, l, b, r) in boxes] # scale the coords back return list(zip(boxes, label_id, conf)) def run(self): while not self.stop_event: ret, img = self.webcam.read() if not ret: #re-open camera if read fails. Useful
2025-04-15🐛 BugI think it's a small problem but I still can't future it out ..I want to accomplish inference feature using libtorch and OpenCV . So I downloaded the last libtorch(GPU) from Pytorch.org. And also build OpenCV(4.0.0) from source.When I build libtorch app and OpenCV app with cmake independently, it succeeds.And when I build libtorch and OpenCV together and don't use 'imread()' function,it succeeds. And the code works in GPU(speed faster than CPU):#include "torch/script.h"#include "torch/torch.h"#include #include #include using namespace std;using namespace cv;int main(int argc, const char* argv[]){ if (argc != 2) { std::cerr \n"; return -1; } std::shared_ptr module = torch::jit::load(argv[1]); std::vector inputs; inputs.push_back(torch::ones({1,3,224,224}).to(at::kCUDA)); module->to(at::kCUDA); // inputs.at[0].to(at::kCUDA); double timeStart = (double)getTickCount(); for(int i = 0 ; i forward(inputs).toTensor(); double nTime = ((double)getTickCount() - timeStart) / getTickFrequency(); cout #include opencv2/opencv.hpp>#include "torch/script.h"#include "torch/torch.h"#include iostream>#include memory>#include ctime>using namespace std;using namespace cv;int main(int argc, const char* argv[]){ if (argc != 2) { std::cerr "usage: example-app \n"; return -1; } std::shared_ptr module = torch::jit::load(argv[1]); std::vector inputs; inputs.push_back(torch::ones({1,3,224,224}).to(at::kCUDA)); module->to(at::kCUDA); // inputs.at[0].to(at::kCUDA); double timeStart = (double)getTickCount(); for(int i = 0 ; i 1000 ; i++) at::Tensor output = module->forward(inputs).toTensor(); double nTime = ((double)getTickCount() - timeStart) / getTickFrequency(); cout "Time used:" 1000 " ms" the CMakeLists:cmake_minimum_required(VERSION 3.12 FATAL_ERROR)project(simnet)find_package(Torch REQUIRED)find_package(OpenCV REQUIRED)if(NOT Torch_FOUND) message(FATAL_ERROR "Pytorch Not Found!")endif(NOT Torch_FOUND)message(STATUS "Pytorch status:")message(STATUS " libraries: ${TORCH_LIBRARIES}")message(STATUS "OpenCV library status:")message(STATUS " version: ${OpenCV_VERSION}")message(STATUS " libraries: ${OpenCV_LIBS}")message(STATUS " include path: ${OpenCV_INCLUDE_DIRS}")add_executable(simnet main.cpp)# link_directories(/usr/local/lib) 'find_package' has already done thistarget_link_libraries(simnet ${TORCH_LIBRARIES} ${OpenCV_LIBS})set_property(TARGET simnet PROPERTY CXX_STANDARD 11)and cmake config:/home/prototype/Downloads/clion-2018.3/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/home/prototype/Desktop/Cuda-project/libtorch -G "CodeBlocks - Unix Makefiles" /home/prototype/CLionProjects/simnet-- The C compiler identification is GNU 7.3.0-- The CXX compiler identification is GNU 7.3.0-- Check for working C compiler: /usr/bin/cc-- Check for working C compiler: /usr/bin/cc -- works-- Detecting C compiler ABI info-- Detecting C compiler ABI info - done-- Detecting C compile features-- Detecting C compile features - done-- Check for working CXX compiler: /usr/bin/c++-- Check for working CXX compiler: /usr/bin/c++ -- works-- Detecting CXX compiler ABI info-- Detecting CXX compiler ABI info - done-- Detecting CXX compile features-- Detecting CXX compile features - done-- Looking for pthread.h-- Looking for pthread.h - found-- Looking for pthread_create-- Looking for pthread_create -
2025-04-02Imgproc.morphologyEx(input, output, Imgproc.MORPH_OPEN, erodeElement); }}Thank you! Perhaps that strange problem is a bug in OpenCV 3.4.1 itself. bug will be fixed in the next version OpenCVForUnity.I don’t have the versions of OpenCV for MOBILE devices build with ffmpeg.Thank you for your valuable ideas.Currently, plugin files that exclude the contrib module for Android and iOS platform are included with OpenCVForUnity. When reusing mat used for Utils.matToTexture2D (Mat mat, Texture2D texture2D, bool flip = true, int flipCode = 0, bool flipAfter = false), please set flipAfter flag to true. // Generate mat for mask --- Utils.matToTexture2D(mat_mask, texToDisplay_mask, true, 0, true); --- qwert024 August 10, 2018, 1:35pm 1756 Thank you!! ososmam August 12, 2018, 9:40am 1757 HelloI need to crop the detected face from the webcam feed as 2d texture or even mesh and put it in another place is that possible and how to achieve this I’m using dlib face landmark and please I’m a beginner so I don’t know what to do I think that this example will be helpful for what you want to realize. qwert024 August 15, 2018, 3:34am 1759 Hello!I am trying to set flipAfter flag to true as you said. However I got “No overload for method ‘matToTexture2D’ takes 5 arguments” error and I am not able to figure it out. It would be great if you would tell me what I’ve done wrong. THank you! I am new to OpenCV but working to make a face detection feature.The AsyncFaceDetectionWebCamTextureExample works well on Unity editor but the
2025-04-2012,141 topics in this forum Sort By Recently Updated Title Start Date Most Viewed Most Replies Custom Filter By All Solved Topics Unsolved Topics Prev 1 2 3 4 5 6 7 Next Page 2 of 486 _LevenshteinDistance By WarMan, February 14 1 reply 317 views AspirinJunkie February 15 Run binary 1 2 3 4 11 By trancexx, August 3, 2009 210 replies 155.5k views Damnatio February 11 AutoIt parser in AutoIt By genius257, February 8 parser ast 6 replies 524 views genius257 February 10 Ternary Operators in AutoIt By TreatJ, February 9 8 replies 357 views Werty February 9 QuickLaunch alternative for Windows 11 By dv8, January 13 4 replies 848 views hughmanic February 9 Installer for execute a3x-Files By Schnuffel, January 25 8 replies 636 views Schnuffel February 9 SoundTool Playback Devices Mute Status (Auto Unmute if Muted) By TreatJ, February 6 12 replies 426 views TreatJ February 9 GUIFrame UDF - Melba23 version - 19 May 14 1 2 3 4 8 By Melba23, September 10, 2010 142 replies 110.1k views WildByDesign February 8 _ArrayCopyRange By WarMan, February 4 _arraycopyrange array 0 replies 468 views WarMan February 4 OpenCV v4 UDF 1 2 3 4 9 By smbape, August 10, 2021 opencv 174 replies 48.5k views k_u_x February 2 RustDesk UDF By BinaryBrother, December 30, 2024 13 replies 1.7k views BinaryBrother January 26 Advanced Icon Displayer In Listview By Zohran, March 25, 2012 12 replies 5.4k views manpower January 25 Screen scraping 1 2 3 By Nine, August 20, 2021 47 replies 14.9k views BinaryBrother January 23 Smtp Mailer That Supports Html And Attachments. 1 2 3 4 39 By Jos, March 28, 2006 763 replies 442.6k views SenfoMix January 21 The Taquin Puzzle By Numeric1, January 20 0 replies 375 views Numeric1 January 20 _RunWaitEx() UDF By argumentum, January 18 runwait 0 replies 430 views argumentum January 18 Multi-Task (easily run and mange many processes) 1 2 By Gianni, January 28, 2018 multi-task 22 replies 11.3k views water January 16 Extended Message Box - New Version: 16 Feb 24 1 2 3 4 19 By Melba23, January 29, 2010 360 replies 221.6k views BinaryBrother January 15 Conway's Game of Life: A Fascinating Cellular Automaton By Numeric1, January 13 0 replies 326 views Numeric1 January 13 The GASP Game By Numeric1, January 9 7 replies 503 views orbs January 13 Round buttons By ioa747, March 28, 2024
2025-04-11I’ll admit it: Compiling and installing OpenCV 3 on macOS Sierra was a lot more of a challenge than I thought it would be, even for someone who has a compiled OpenCV on hundreds of machines over his lifetime.If you’ve tried to use one of my previous tutorials on installing OpenCV on your freshly updated Mac (Sierra or greater) you likely ran into a few errors, specifically with the QTKit.h header files.And even if you were able to resolve the QTKit problem, you likely ran into more issues trying to get your CMake command configured just right.In order to help resolve any issues, problems, or confusion when installing OpenCV with Python bindings on macOS Sierra (or greater) I’ve decided to create two hyper-detailed tutorials:This first tutorial covers how to install OpenCV 3 with Python 2.7 bindings on macOS.My second tutorial will come next week where I’ll demonstrate how to install OpenCV 3 with Python 3.5 bindings on macOS.I decided to break these tutorials into two separate blog posts because they are quite lengthy.Furthermore, tuning your CMake command to get it exactly right can be a bit of a challenge, especially if you’re new to compiling from OpenCV from source, so I wanted to take the time to devise a foolproof method to help readers get OpenCV installed on macOS.To learn how to install OpenCV with Python 2.7 bindings on your macOS system, keep reading.The first part of this blog post details why I am creating a new tutorial for installing OpenCV 3 with Python bindings on the Mac Operating System. In particular, I explain a common error you may have run across — the QTKit.h header issue from the now deprecated QTKit library.From there, I provide super detailed instructions on how to install OpenCV 3 + Python 2.7 your macOS Sierra system or greater.Avoiding the QTKit/QTKit.h file not found errorIn the Mac OSX environment the QTKit (QuickTime Kit) Objective-C framework is used for manipulating, reading, and writing media. In OSX version 10.9 (Mavericks) QTKit was deprecated (source).However, it wasn’t until the release of macOS Sierra that much of QTKit was removed and instead replaced with AVFoundation, the successor to QTKit. AVFoundation is the new framework for working with audiovisual media in iOS and macOS.This created a big problem when compiling OpenCV on Mac systems — the QTKit headers were not found on the system and were expected to exist.Thus, if you tried to compile OpenCV on your Mac using my previous tutorials your compile likely bombed out and you ended up with an error message similar to this:fatal error: 'QTKit/QTKit.h' file not found#import ^ 1 error generated. make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_qtkit.mm.o]Error 1 make[1]: ***[modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2 make: ***[all] Error 2Even more problematic, both the tagged releases of OpenCV v3.0 and v3.1 do not include fixes to this issue.That said, the latest commits to the OpenCV GitHub repo do address this issue; however, a new tagged release of v3.2 has yet to be released.That said, I’m happy to report that by using
2025-04-14