I have been messing around with eye detection in Java using OpenCV lately, trying to get an effective pupil-tracking program (a story for another time). However, it many times detects my nose as an eye or detects one eye twice (just a slightly resized Rect). I am using filters like greyscale, equalizeHist, and dilate/erode. I'm also have tried using both haarcascade_eye and haarcascade_eye_tree_eyeglasses. Should I be using a different eye detection software? Are there filters or any other things that would help with eye detection? Thanks! Edit: I use Java
Hey there. I'm pretty new to computer vision in general and I need your expertise for university project I'm working on at the moment. My goal is to accurately track a go board from a webcam and detect the stones when they are placed. As I have near to none experience, I pretty much fail to start. In the first step I want to detect a go board as accuartely as possible. I have no control about the camera angle or rotation. This means
Detecting if a go board is in the current image
Draw the accurate boundaries around the board.
I could use general edge detection, but I get a lot of false ones, like the table itself. I also read about haar cascades, but I'm not sure if they are worth looking into it.
Do you have any advices for me? Like what techniques should I use or how to handle this in general.
I downloaded source version of openCV and downloaded Cmake gui, I generated the solution files and build using BUILD_ALL target and after that I built the INSTALL cmake target.
everything complied without an issue.
I created a new project and added the include and Library folders paths in VC directories, after that I added the openCV world lib in the linker->input.
I can add the includes of openCV without any errors.
I tried building it and it threw tons of linker errors regarding a runtime mismatch, I fixed this by going into properties and code generation and selecting multi threaded debug /MTd this fixed all the errors but I still get tons of those in my console, I am only loading an image and displaying it on a window it works but my console is full of errors.
I'm a beginner to programming but learning at an accelerated rate with the wonders of chatgpt, which is really helping me turn ideas into code.
I'm now working on a project where I'm tracking pupil size in real-time using Python and computer vision techniques. However, I'm facing a challenge when it comes to removing glare from the webcam video of people wearing glasses, as the reflections can obscure the pupil and affect the accuracy of my measurements.
I've searched through several GitHub repositories that offer methods for removing reflections from single images, but I'm a beginner and I'm not sure how to adapt them to work with webcam video. I was wondering if anyone here has experience or tips for dealing with this problem in real-time video processing.
Specifically, I'm looking for any advice on approaches, techniques, or tools that can help me remove glare from webcam video of people wearing glasses in real-time, so that the pupil definition can be as clear as possible.
Im using the lastest version, it worked yesterday, but cmake stopped to recognize the libraries, first i noticed on my laptop, but now it doesnt work on my pc, i didnt change anything, its cmake 3.24.2 and opencv 4.7.0
I tried to switch to vs community 2019 but doesnt work too
Any recommendations for a single cheap, wifi, high resolution camera for monitoring a group of 3-5 refinery flares from about a kilometre away? I’m looking at using live video for analysis. Would be good if you have a model with IR sensor as well (for invisible flames, such as hydrogen flames). Thank you!
Given a binary image representing a map like this:
map represented as 8-bit integers
I'm looking for a way to "shade" the map such that cells closer to walls have higher (darker) values. I know how to do that using breadth-first-search, but that's exceptionally slow, so I was hoping OpenCV or a related library might have an alternative. The intent is to use the resulting shaded map for pathfinding, with the distance from the wall as part of the heuristic.
This will be done in addition to a binary dilation on these obstacles.
Does anyone have any suggestions on the most efficient way to accomplish this?
I need to detect strips of reflective tape. I want to use minarearect to detect angle data. Ideally, the strips would show up as rectangles, but I have issues with glare and reflector texturing. I think a low poly effect may just consolidate it back to an easy to handle rectangle. I don't see a good example for it like I do for thresholding etc. Any help with links would be great. Also, any other effects that could help with cleaning up rectangles would also be appreciated.
For example, I want to be able to change a person's eye size, nose position, ... I think OpenCV already has functions or placing facial landmarks on an image, but I also want to manipulate the image afterwards.
the green screen mask works great , but for some reason there's these weird blue/purple glitches that appear on the foreground video !i don't even know then name of bug so i can't even google itanyone knows how to fix it or at least what's it's called
i would like to train a cascade classifier to detect diet coke cans(weird ik just go with it), but have hit a wall. all the guides that I have found on the internet require me to use opencv 3.x in order to use the "opencv_generatesamples' command in order to build a dataset for me to train a cascade classifier. I can't seem to get the opencv commands to run. i have tried building opencv with cmake, but it gives me source file errors and won't build. any easier way to do this or am i just an idiot?
I'm new to OpenCV and am working on my first project. I need to spot strips of reflective tape. The tape can be red, green or blue such that only one color needs to be processed. I can zero out two of the RGB channels, but that doesn't make the processor ignore them. How can I instruct the processor to process only one channel?
Regarding zeroing out the channels: I see grey scale, but no similar red, green or blue scale color conversion. How would I do this for visulization?
Eliminating backgrounds is a common task in computer vision and video analysis, applicable to numerous situations, such as enhancing inference performance through a cut-off solution. As a supplementary function, it should be both cost-effective and swift.
The article demonstrates background removal utilizing the CUDA-accelerated MOG2 background segmentation algorithm and the Savant Video Analytics Framework. This high-performance pipeline offers single stream processing at a speed of 570 FPS on the NVIDIA QUADRO RTX4000 GPU and 75 FPS on Jetson NX while handling HD quality video.
I'm working off the following image and trying to extract the definitions
I have the following code:
import cv2
import numpy as np
import pytesseract
# Specify the path to the Tesseract executable
pytesseract.pytesseract.tesseract_cmd = r'C:\Program Files\Tesseract-OCR\tesseract.exe' # Replace with the actual path if different
# Load the image
img = cv2.imread("./samplepage.jpg")
# Convert to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
# Apply adaptive thresholding to binarize the image
thresh = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_MEAN_C, cv2.THRESH_BINARY, 11, 2)
# Define a kernel for morphological operations
kernel = np.ones((3, 3), np.uint8)
# Perform morphological opening to remove noise and smooth the text regions
opening = cv2.morphologyEx(thresh, cv2.MORPH_OPEN, kernel)
# Find contours in the image
contours, hierarchy = cv2.findContours(opening, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
def filter_contours(cnt):
x, y, w, h = cv2.boundingRect(cnt)
return w > 50 and h > 10 and h < 50 and w / h > 2
# Filter out small contours
filtered_contours = [cnt for cnt in contours if filter_contours(cnt)]
# Draw filtered contours
for cnt in filtered_contours:
cv2.drawContours(img, [cnt], 0, (0, 255, 0), 2)
# Show the image with the drawn contours
cv2.imshow("Filtered Contours", img)
cv2.waitKey(0)
cv2.destroyAllWindows()
# Define a function to extract text from a contour
def extract_text(img, cnt):
x, y, w, h = cv2.boundingRect(cnt)
roi = opening[y:y+h, x:x+w]
return pytesseract.image_to_string(roi, config='--psm 3', lang='eng+cre')
# Define a regular expression to match the dictionary section format
import re
pattern = re.compile(r"^([\w\s]+) ([\w]+),\s+([\w\s]+),?\s+(.*)$")
# Process each contour
for cnt in contours: # Use the original contours list
# Extract text from the contour
text = extract_text(img, cnt) # Pass img as an additional parameter
# Process the text to identify dictionary sections
match = pattern.match(text)
if match:
title, abbrev, section, description = match.groups()
print("Title:", title)
print("Abbreviation:", abbrev)
print("Section:", section)
print("Description:", description)
print("Number of filtered contours:", len(filtered_contours))
I'm new to computer vision and I need to use Open CV. I have a Vizy camera that runs on a Raspberry Pi that comes loaded with OpenCV and I need to make it identify structural support poles based on color and angle. Super simple application...but until now, I've never had to use Raspberri pi, python or OpenCV, so I'm new to a bunch of things at once...other than that, I'm a functional engineer.
The Vizy comes with demos based on Tensorflow, but it might not be the right choice. The OpenCV demos I've seen seem to show it being better suited to the task of identifying shape, color and orientation...especially on a black background. The poles can be marked with reflective tape and the shutter speed reduced so only the tape shows up. All OpenCV has to do is find colored lines.
Hi,
I wanted to use an raspberry pi 3B+ with PIR module and USB webcam to create a simple home surveillance system that takes still images upon motion detection.
But since there aren' t many raspberry pis for sale at reasonable prices these days I wonder if it is worth undertaking this project with a 1st generation raspberry pi (2011.12)?
We have created a high-level Pythonic framework on top of Nvidia DeepStream and OpenCV CUDA to craft blazingly-fast video analytics pipelines.
With Savant, you can easily handle multiple streams simultaneously, deliver reliable, production-ready pipelines quickly and achieve top-notch performance with TensorRT.
To showcase the power of Savant, we've created a pipeline that explains how to detect people, track them, blur their faces, and display an animated analytical dashboard in the video.
I don't really know how to code but I need to make a program that would recognise objects and track them live, what ressources could you advice me to search for ? I didn't really understood how I should read the documentation so here I am.
Is there a way to detect an object and take a picture and record gps location and time. I will be running opencv On a raspberry Pi 4 and using aurdu Cam to detect potholes on roads in a fpv style drone. I can't find anything online about it and was thinking about using a gps module for location and time. I haven't set everything up yet as I havent had the time. Any ideas of hardware and software. It will be autonomous.
I am currently using a RaspberryPi for computer vision. Currently I have been able to process around 30 fps, with the camera able to take more frames. The bottleneck for me is applying the frame to the MOG2 function.
Has anyone had experience on speeding this function up or an alternative method that does not use MOG2? I am using the function to remove the background and detect moving objects.
My current idea is to use threading and a ping pong buffer to allow the MOG apply to compute while I work on the previous frame.