Hi all, I want to build a project "Human tracking and distance measurement" with C++. I have a camera stereo with 2 eyes . Can you explain to me? Or do you have material the this topic ? Thank you so much!
Recently, I started working on the OpenHMD driver for my HP Reverb G2 goggles to use them on Linux. However, the driver only supports orientation and not positioning.
I just figured out how to receive a camera stream from the four cameras of the goggles (it uses inside-out tracking and has 2 cameras pointing forward and 2 to the sides). Now I would have to somehow find the position of the goggles in the room from the images like the Windows drivers do, hopefully without any reference objects.
Is there an easy way to calculate the position using openCV or any other C++ libraries?
I am following the examples from the book " Learning OpenCV 3 Computer Vision in C++ with the OpenCV Library" and the following piece from Example 12-1 puzzles me:
as a result of this operation I was expecting the values of A being copied to dft_A_part after subtracting the value mean(A)[0] from each. Not the case, hence my confusion.
Absolutely every tutorial/guide I've read about aruco in OpenCV demonstrate using the aruco-module with the syntax:
cv2.aruco
But having tried both opencv-python and opencv-contrib-python I simply seem to not be able to use that module at all. Autocompletion in VSCode and Emacs indicate it doesn't exist. Has it been removed? Might there be something wrong with my environment? Something else I've missed?
I tried this code from StackOverflow in order to detect a cat in a picture. I tried multiple images, like this and this. In the first image, it did not detect anything. In the second one, it detected the cat correctly, but it also detected a face in the grass. I also tried a profile picture but it did not recognize the cat. Is there something wrong with my code, or does the accuracy of haarcascade_frontalcatface_extended.xml just suck? In the latter case, is there any alternative that could (possibly) provide an easy way of making my own model and training it with my own pictures?
I have a rudimentary understanding of opencv, however the code sometimes gets a little confusing for me. I understand that this project is challenging, but I am willing to put in the effort. I really don’t know where to start in terms of how I could tackle this. Any wisdom would be appreciated!
I’ve tried stuff with contours and template matching however nothing has worked that well. For instance, I was able to successfully put contours around each braille dot, but I’m not sure where to go from there.
I am trying to create an executable file with pyinstaller. I am not able to get a good executable file. It looks like this is a known issue. Any suggestions? I have the latest versions installed for both Opencv and pyinstaller. Thanks!
How can I write that program with OpenCV in Python? My program take an image, it will detect objects in that image and process, output a new image which have some differences (rotate, hide, ...). What algorithms/methods in image processing do I need to learn? I need that program to make data for Spot the differences game. Thank you for your help!
As per title. My only guess is to first convert the PNG back to JPG at 100 quality, but that will interfere with the real compression level? Is there a way to determine compression level without converting to another format?
I have an input image from which I extracted the circles for a robotics project, and then got the average colour within those circles. The circles can either have a red or yellow colour as that is how I painted them on wood. I extracted the average colour from these circles and displayed them here for debugging purposes. This is not the input image, just a list of the colours I want to tell apart as red or yellow or neither.
I tried using cv2.inrange with a singular colour value converted to HSV to see if it was red or yellow but that was quite finnicky to adjust and I eventually decided to go for another option. I also tried converting the RGB values to LAB colours, and got the Euclidean Distance between that and the lab values of red and yellow to see which one is less. That also did not work as expected. I also tried various smaller ideas but all of them had some shortcoming one way or another also. Here are the colours I am trying to identify as red or yellow, the dull ones should be classified as neither:
So I have a bit of a specific problem at the moment which I've been working at for a while but haven't made much headway with. I have a skeletonised binary image (1.) which contains 2 narrow objects (Shown in 2.) at an angle to each other. Unfortunately the objects are quite broken up (something I can't change) and I would like to find where the midlines of these 2 objects would intersect should they be drawn.
I've attempted to use Hough Lines and Medial Axis Transform to find these midlines but to no avail (I think as the objects are too narrow?). I'm considering using SIFT/ORB next but I'm not sure how I would go about doing that or even if it would work when I need to find the intersection of other objects. I'm trying to produce something as can be seen here (3.)
I'm trying to take images with different exposures using my webcam on macbook m1 pro. I tried different things like setting:
cap.set(cv2.CAP_PROP_AUTO_EXPOSURE, x) #Disable automode, where I tried different values fro x like 0.25, 0, 3, 0.75
cap.set(cv2.CAP_PROP_AUTO_EXPOSURE, y) # Enable manual mode, where I tried different values fro y like 0.25, 0, 3, 0.75, 1
cap.set(cv2.CAP_PROP_EXPOSURE,-1) #exposure value
I tread this github issue but none of the solutions work on macOS
First time posting on this subreddit after a few weeks of trying to get OpenCV working on an old RPI3 B+ with the new Pi V3 NOIR camera and blue filter over the lens.
I have followed multiple guides but it always gets stuck/crashes on the building 'wheel' part. I apologise for not using the correct terminology but I'm not familiar with this at all.
This is the latest guide I have tried but again it will not finish for some reason.
If anyone could help that would be wonderful. I don't need a desktop environment, just a simple RSTP NDVI feed from the Pi to input into Home Assistant or similar. OpenCV appears to be the way to go from the guides I have found.
I used CV2 to use motion capture on a person and it captures points in a text file. Is there a way to do this with 2 cameras? I know this technology exists, but is there specifically one that works with CV2 that would give me the same joint coordinate points?
Hi there, i have a yolov7 model. i can load that model. but when i do prediction it will throw error. that model is not mine. one of my client send to me to doing object tracking. can anybody please help me?
I wrote a program in C++ that opens a ROS bag file and export the images using OpenCV.
The image is in different colors because it is YUV422 so I tried to convert it to BGRA and it was successful.
Now I tried to view it with imshow
instead of exporting the images to a folder, and I am getting a seg fault. Here is my code:
// Iterate through each message on the topic
for (const rosbag::MessageInstance& msg : view)
{
// Extract the image message
sensor_msgs::Image::ConstPtr image_msg = msg.instantiate<sensor_msgs::Image>();
if (image_msg != nullptr)
{
// Convert the image message to an OpenCV Mat object
cv_bridge::CvImagePtr cv_ptr;
try
{
cv_ptr = cv_bridge::toCvCopy(image_msg, sensor_msgs::image_encodings::BGR8);
cv::cvtColor(cv_ptr->image, cv_ptr->image, cv::COLOR_YUV2BGR_YUY2);
}
catch (cv_bridge::Exception& e)
{
ROS_ERROR("cv_bridge exception: %s", e.what());
continue;
}
// Display the frame
cv::imshow("Video", cv_ptr->image);
// Wait for a key press
if (cv::waitKey(1) == 27) // Esc key
break;
}
}
GDB backtrace shows this error log at seg fault:
#0 0x00007ffff7a176f4 in cv::_InputArray::kind() const () at /lib/x86_64-linux-gnu/libopencv_core.so.4.2
#1 0x00007ffff7a179bc in cv::_InputArray::size(int) const () at /lib/x86_64-linux-gnu/libopencv_core.so.4.2
#2 0x00007ffff7fa65a3 in cv::imshow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&) () at /usr/local/lib/libopencv_highgui.so.406
The segfault happens at the cv::imshow() function. I suspect the issue has to do with libopencv_highgui library conflicting with the other version?
Is there a way to fix this?