OpenCV

Accessing a user's webcam in Heroku

泄露秘密 提交于 2021-02-11 15:48:30
问题 I am interested in gathering eye tracking data and would like to create a Heroku app that uses this GazeTracking package (or similar) so I can capture and capture and store data for where people are looking on their screen for given images. After going through dozens of related answers on Stack Overflow and elsewhere, I am still unable to get this working correctly since I can't figure out how to access the user's web camera. Here is the GitHub repo I've got going right now. Is there a way to

Accessing a user's webcam in Heroku

雨燕双飞 提交于 2021-02-11 15:48:09
问题 I am interested in gathering eye tracking data and would like to create a Heroku app that uses this GazeTracking package (or similar) so I can capture and capture and store data for where people are looking on their screen for given images. After going through dozens of related answers on Stack Overflow and elsewhere, I am still unable to get this working correctly since I can't figure out how to access the user's web camera. Here is the GitHub repo I've got going right now. Is there a way to

How do I fix “RuntimeError: Unable to open shape_predictor_68_face_landmarks.dat” while using google colab?

烈酒焚心 提交于 2021-02-11 15:18:12
问题 I am writing the following Python code in Google Colaboratory and get an error: Code : import cv2 import dlib cap = cv2.VideoCapture(0) hog_face_detector = dlib.get_frontal_face_detector() dlib_facelandmark = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat") while True: _, frame = cap.read() gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) faces = hog_face_detector(gray) for face in faces: face_landmarks = dlib_facelandmark(gray, face) for n in range(0, 16): x = face_landmarks.part

OpenCV data of two mats are the same but values when retrieved with Mat::at are corrupted

可紊 提交于 2021-02-11 15:14:51
问题 I serialize and then deserialize a Mat using custom functions. When you compare the uchar* Mat.data of two functions they are the same but when I try to check values directly using Mat.at<> after third element, element values are stuck at some corrupted float values. I tried changing elements to every other value, nothing changed. The problem also doesn't happen when I serialize-deserialize image Mats and histogram Mats. Below is the code and below that is the output. cv::Mat kernelx = (cv:

how to use opencv Tracker parameters without selecting a roi

旧时模样 提交于 2021-02-11 15:01:36
问题 can someone tell me which second parameter I should pass to tracker.init() after detection a pedestrian? there are only parameters with already selected ROI in the internet. I tried to pass a variable rects ,but it gives me an error import numpy as np import cv2 import sys from imutils.object_detection import non_max_suppression cap = cv2.VideoCapture("video.mp4") hog_descriptor = cv2.HOGDescriptor() hog_descriptor.setSVMDetector(cv2.HOGDescriptor_getDefaultPeopleDetector()) tracker = cv2

TypeError: cannot unpack non-iterable numpy.float64 object

蹲街弑〆低调 提交于 2021-02-11 14:40:46
问题 The below piece of code uses openCV module to identify lanes on road. I use the python 3.6 for coding (I use atom IDE for development. This info is being provided because stackoverflow isn't letting me post the info without unnecessary lines of info. so please ignore the comments in bracket) The code runs fine with a given sample video. But when I run it for another video it throws the following error: (base) D:\Self-Driving course\finding-lanes>RayanFindingLanes.py C:\Users\Tarun\Anaconda3

cMakefile for using tesseract and opencv

别等时光非礼了梦想. 提交于 2021-02-11 14:28:12
问题 I am a newbie to cmake and I am writing an application for using tesseract. the g++ command line work fine g++ -O3 -std=c++11 `pkg-config --cflags --libs tesseract opencv` my_first.cpp -o my_first But I wrote the following CMakeFile.txt and building in Clion and it throws a bunch of linking errors cmake_minimum_required(VERSION 2.6) add_compile_options(-std=c++11) project (my_first) find_package(PkgConfig REQUIRED) pkg_check_modules (OPENCV REQUIRED opencv) link_directories(${OPENCV_LIBRARY

how to have full control over a process (start/terminate) which runs in parallel with flask application?

我的未来我决定 提交于 2021-02-11 14:15:23
问题 This is my application architecture: In my code there is a pedestrian.py file which uses a while loop to read frames from rtsp link and after doing pedestrian detection process (available in this link), it caches the frame in Redis. (please note that in the loop each time the output frame is replaced with the previous output from loop. it means that there exists only one frame in redis in any moment.) Then in flask application, I read processed frame from redis and send it for the clients.

Find contours based on edges

ⅰ亾dé卋堺 提交于 2021-02-11 14:13:07
问题 I want to detect the contours of an equipment label. Although the code runs correctly, it never quite detects the contours of the label. Original Image Using this code: import numpy as np import cv2 import imutils #resizeimage import pytesseract # convert img to string pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe" # Read the image file image = cv2.imread('Car Images/5.JPG') # Resize the image - change width to 500 image = imutils.resize(image, width

module 'cv2.cv2' has no attribute 'CalcOpticalFlowBM'

自闭症网瘾萝莉.ら 提交于 2021-02-11 13:52:39
问题 I am trying to get per block motion vectors between two frames. By using CalcOpticalFlowBM() as described in the official documentation However it seems like the function has been removed to another package or something. 来源: https://stackoverflow.com/questions/61802650/module-cv2-cv2-has-no-attribute-calcopticalflowbm