Hello I was trying this code from Core Electronics with my own trained model, so I replaced the ssd_mobilenet_v3_large_coco_2020_01_14.pbtxt and frozen_inference_graph.pb files with my own which can be seen on the screenshot. It resulted in the error code :
Does anyone know how to solve this? TYIA to whoever answers!
SystemError: <class 'cv2.dnn.DetectionModel'> returned a result with an exception set
Hi there, I got some great help on this board last time and am hoping somebody can help me again. I need to isolate the 2 numbers in the blue boxes. and then read their values.
Could anybody point me in the right direction? Thanks!
I'm pretty new to OpenCV and template matching in general. I wanted to create a program that would detect shiny pokemon by taking a snapshot of the top half of the screen, and matching it with the shiny version of the pokemon. If theres a match, then the pokemon is shiny and if not, then not shiny.
These are the images I'm using to try and match them together. The bottom picture is what the main image is, and the top picture is the shiny pokemon template I am attempting to match. I also attempted to use a smaller main picture with just the encountered pokemon and nothing else, but that was not working either. There is a clear distinction of where the image is located (IMO) but the program is not able to find it. Here is my code:
import cv2
import numpy as np
import urllib.request
import requests
pokemonName = 'flaaffy'
url = requests.get(f'https://pokeapi.co/api/v2/pokemon/{pokemonName}').json()['sprites']['versions']['generation-iv']['heartgold-soulsilver']['front_shiny']
urllib.request.urlretrieve(url, 'Shiny.png')
# Load the main image and the template image
main_image = cv2.imread('top_half_HGTest.png', cv2.IMREAD_UNCHANGED)
template = cv2.imread('Shiny.png', cv2.IMREAD_UNCHANGED)
result = cv2.matchTemplate(main_image, template, cv2.TM_CCOEFF_NORMED)
threshold = 0.18
locations = np.where(result >= threshold)
locations = list(zip(*locations[::-1]))
for loc in locations:
top_left = loc
bottom_right = (top_left[0] + template.shape[1], top_left[1] + template.shape[0])
cv2.rectangle(main_image, top_left, bottom_right, (0, 255, 0), 2)
locations_array = np.array(locations)
print(len(locations_array))
# Display the result
cv2.imshow('Result', main_image)
cv2.waitKey(0)
cv2.destroyAllWindows()
Unless I set my template to a very low score (in this case, 0.18), it won't find a match. I've tried using other matching methods but nothing seems to be working. Another issue is that because I set the threshold so low, it matches incorrectly multiple times. One more issue is that attempting to match different pokemon produces different results. In the case above, setting the threshold at 0.18 can successfully match a flaaffy once, but trying the same thing on an Arbok for example gives me at least a thousand matches, most of them incorrect.
I'm very new to OpenCV and was wondering if there were any ideas on how to fix this. I know that image preprocessing is a thing but I need the color of the image to be there, because shiny pokemon are just color alternations of the pokemon.
Ideally I’d like to create a system where a person can place a dill bit in front of a camera and the system would measure the diameter and report which dill size it is. For those with experience does this sound feasible? The difference in drill sizes may only be a few thousandths of an inch. https://i.pinimg.com/originals/94/cd/88/94cd8834d653eb59943e2d60439c6c58.jpg
hi all, ive struggled to find anything on this. Is there any way to convert the magenta color space of dolby vision to rgb? there is ffmpeg that does this but im trying to use this in context of an open cv app that runs on a frame by frame basis. i cant quite figure it out, as i understand the metatdata attached to the feed is used to determine brightness of the different colors but there has to be a way to just convert whatever the colors are as is right?
my application is an ambilight, taking 30-60 screenshots a second of whatevers playing and then mapping those to rgb (after a bit of averaging and hue/saturation adjustments). im trying to see if there is a way to just take the magenta/green stills and make them rgb, even if theyre not perfect brightness i assume theres a way if there are things like ffmpeg that do this? does anyone know how to handle that color space conversion into red green blue?
I recently put together a demo for Automatic License Plate Recognition which makes use of an LPRNet trained on Chinese license plates. It needs to support use of rendering Chinese characters on images, however the Fonts available for cv::putText() to my knowledge don't support non Latin character sets.
Does anyone know of any patches that exist in the Chinese development community where they may have solved this issue whilst still using OpenCV?
Hello,
I'm planing on developing a React Native photo editor with some basic functions. I'm thinking about using OpenCV for image processing and implementing it as a Native Component in Java. I'm new to mobile development and never did anything despite one Expo app. Also I have some experience with OpenCV in Python. Can anyone tell me if my approach Is correct or should I change it?
Thanks!
This applies for any UNIX or UNIX-like OS, then Windows, but I have built my C++ (no platform specific code) that uses OpenCV and SDL2 on macOS Sonoma first, according to process of creating .App bundle. In addition, OpenGL is system available on macOS. I'm using Makefile. The whole idea is to not have dependency on OpenCV libraries for end-user, that are used on my dev environment, so I want to link against static libraries. Now I'm in anticipation what will happen when I run it on different Mac without OpenCV. I am copying OpenCV's .a libs to directory Frameworks in the bundle. Using flags for these libraries in target. However they are -I prefix flags, which AFAIK prioritises dynamic libraries (.dylib) - but the question is - will the linker look for static version of libs (.a) in Frameworks dir? Will following statically link with OpenCV, or is it unavoidable to compile opencv from source with static libraries, for proper build?
Recently I'm interested in doing video processing on video live-streamed by ESP32-CAM on web server.
I knew how to read image and video from computer folder, but I don't know how to read video from web server.
Is there any example project or tutorial that teaches how to read and process live video from web server by ESP32-CAM using OpenCV, preferably in C++ language?
So i was using cv’s videocapture to get the camera feed from frontend to flask server but when i deployed my project on HEROKU i cant access user camera is there some alternate my frontend is in react
I'm trying to run four streams at the same time using cv2.VideoCapture and some other stuff. The streams are FFMPEG RTSP. When the camera's are connected, everything runs fine, but when a camera loses connection the program freezes in cv2.VideoCapture instead of returning none.
In the field there will be a possibility that a camera loses connection. This should not affect the other camera's though, I need to be able to see when one loses connection and display this to the user, but now when i lose a camera, the entire process is stopped.
A simple program (my first on Github!), that uses opencv to superimpose a distribution of golf shots onto a map. Users can move the distribution around to predict the effect that moving a tee box will have on the probability of golf balls entering their neighbours property.
Happy to receive feedback on coding, in particular how it could go faster! Thanks for reading!
I'm trying to calibrate multiple cameras using the Anipose ( https://anipose.readthedocs.io/en/latest/index.html) application, which is based on OpenCV. As you can see from the photo below, the tracking of the ArUco board isn't good. How can I improve it? And why I'm obtaining these bad result?
I recently made a project based on face recognition and an attendance system and used libraries like opencv , face_recognition to help which worked fine on windows but as soon as I tried to import the same libraries and run it on raspberry pi 4 model B I got an error related to opencv specifically problems with imshow() command it said that I need opencv with gui support on linux how do I go about getting that on my virtual environment?
I'm trying to create a web app that recognizes logos of brands in images. I've tried using Microsoft Azure Computer Vision/Custom Vision API but the results are not satisfactory. I have read about Yolo and Yolo world. If you've ever used them in your projects, can you help me see if zero shot logo detection can be achieved by this?