The red image above is the health meter for enemy units in a game. I got a python application that takes a screenshot and it must be able to determine the percentage of health remaining. In this case it would be ~70%, given the size of the red bar. I tried several ways from google Bard AI suggestions but none work 100%. How should I proceed?
How to find the width of the red area using opencv or any other python library?
104 Views Asked by Matteus Barbosa At
1
There are 1 best solutions below
Related Questions in PYTHON
- new thread blocks main thread
- Extracting viewCount & SubscriberCount from YouTube API V3 for a given channel, where channelID does not equal userID
- Display images on Django Template Site
- Difference between list() and dict() with generators
- How can I serialize a numpy array while preserving matrix dimensions?
- Protractor did not run properly when using browser.wait, msg: "Wait timed out after XXXms"
- Why is my program adding int as string (4+7 = 47)?
- store numpy array in mysql
- how to omit the less frequent words from a dictionary in python?
- Update a text file with ( new words+ \n ) after the words is appended into a list
- python how to write list of lists to file
- Removing URL features from tokens in NLTK
- Optimizing for Social Leaderboards
- Python : Get size of string in bytes
- What is the code of the sorted function?
Related Questions in OPENCV
- segmentation fault: 11, extracting data in vector
- Disable OpenCL in OpenCV completely
- Python - Writing your own function with opencv giving an error
- Opengl Augmented Reality in Android from solvepnp
- OpenCv Multispectral Image openCV
- Displaying bitmap image on Android (OpenCV)
- Applying homography on non planar surface
- BackgroundSubtractor getBackgroundImage() function return empty Image
- How to choose good SURF feature keypoints?
- opencv python error: Assertion failed (size.width>0 && size.height>0)
- CIDetector to filter rectangle and get cropped image
- How to detect squares in video with OpenCV?
- Python OpenCV error: (-215) size.width>0 && size.height>0 in function imshow
- OpenCV algorithm of contours searching and creation of bounding rectagle
- OpenCV Opening/Closing shifts the positions of the pixels
Related Questions in IMAGE-PROCESSING
- Need help in detecting multiple blobs
- Image based steganography that survives resizing?
- WinRT Extract Thumbnail from RAW image format
- 3D B-Spline approximation
- Qualitative and Quantitative analysis of filtered back projection / iradon in matlab
- How to detect objects in an image based on colour?
- How to make sense (handle) when computes logarithm of zero in prior information
- scilab - Drawing bounding box
- Lowpass filter non working
- Get a single line representation for multiple close by lines clustered together in opencv
- error while drawing several x-marks on a binary image in matlab
- Which method should I use to find gradient direction of pixels in an image?
- Finding Circle Boundary Pixels Coordinates and RGB Intensity Values from An RGB Input Image in Matlab
- using SURF for handdetection
- Using only one tool from CLImageEditor
Related Questions in COMPUTER-VISION
- OpenCV algorithm of contours searching and creation of bounding rectagle
- How to make sense (handle) when computes logarithm of zero in prior information
- Matlab code crashes and gives error: Dimension of matrices being concatenated are not consistent
- Haar Cascade classifier does not detect faces in simple frontal pictures
- Face cropping using facial landmarks
- qtimer and opencv running slow
- Simple RGB to Gray program crashes
- Estimating pose of one camera given another with known baseline
- dealing with dimensions in scikit-learn tree.decisiontreeclassifier
- converting matlab code to c code readiness error
- MATLAB ConnectedComponentLabeler does not work in for loop
- Finding camera position without calibration
- StereoSGBM cannot handle negative minDisparity
- How to speed up caffe classifer in python
- HOG Feature extraction
Related Questions in GAME-AUTOMATION
- Find real-time coordinates python mss and show it
- How to find the width of the red area using opencv or any other python library?
- How to sharpen an image using openCV in Python
- how to wrap all min contours into a box or circle and find the center?
- Is there a way to find a .png template into a screenshot I took with pyautogui?
- Improving OCR accuracy
- how to find corner (x, y) opencv?
- Opencv Python: How to detect rectangular shapes on picture
- I want to make an autocliker app for both android and ios, but it can also take screenshots and recognize a specific image in the screen
- OpenCV / Python - constantly 'read' / 'look at' video game window
- How to write a macro that automatically detects an incoming bot check in-game and clicks the correct answer?
- Find brighter areas in an image
- read text from picture getting lot of color shade
- How to move my crosshair to the bounding box my model creates
- openCV - object detection: should I use YOLO? If not, which algorithm would more appropriate for this case scenario?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?

Here is one way to do that in Python/OpenCV. Just threshold using cv2.inRange(). Then get the bounding box of the white region from the thresholded image. Then get the width of the bounding box as a percentage of the width of the image.
Input:
Thresholded Image:
Text Output: