Skip to content
Advertisement

Tag: opencv

Python opencv/cvzone – UnboundLocalError

I am trying to make a ar mouse (camera vould detect your hand and than your finger vould be the mouse). But when checking which fingers are up I get an error. When making this program I followed this tutorial: https://www.youtube.com/watch?v=8gPONnGIPgw&t=332s. When doing that I made one thing different which is that I didn’t make a program file called HandTrackingModule.py

How to extract, modify and restore correctly modified bounding boxes

I’m trying to do relatively simple code where I extract contours of some areas in the image and draw 1 or multiple rectangles on them (normally with a “Object Detection model”) (works fine). However, I then need to transform the coordinates of the rectangles drawn on the cropped areas back to the original image (and draw them over it to

Replace cv2.warpPerspective for big images

I use python OpenCV to register images, and once I’ve found the homography matrix H, I use cv2.warpPerspective to compute final the transformation. However, it seems that cv2.warpPerspective is limited to short encoding for performance purposes, see here. I didn’t some test, and indeed the limit of image dimension is 32767 pixels so 2^15, which makes sense with the explanation

How to change pixel value based on a condition

The image is 1920 by 1080. How can I change the value of a pixel when a channel value is higher than the other? Here is what I did. Is there a more efficient way than iterating on each pixel? Answer Don’t use any loop for this, use ndarray capability and logical indexing. What you want to achieve is something

Remove white borders from segmented images

I am trying to segment lung CT images using Kmeans by using code below: The problem is the segmented lung still contains white borderers like this: Segmented lung (output): Unsegmented lung (input): The full code can be found in Google Colab Notebook. code. And sample of the dataset is here. Answer For this problem, I don’t recommend using Kmeans color

Advertisement