So I have two images, one is a white image with a blurred spot and other is a image of a street(taken from KITTI dataset). I want to blend both the white image with blurred spot and street image such that the whiteness doesnt appear while blending.\
In the first image below, you can see a translucent gray spot. This I achieved by making a copy of the street image and then drawing a circle on it using cv2.circle function. This i blended it back with the original image and controlled the transparency of the circle.
In place of the circular spot, I want the blurred spot in the white image to appear with transparency. How can this be achieved?
When i do normal blending the white shade also appears. I tried converting into RGBA image and then blending but didnt work. Any idea how this could be achieved?
Related
I have some cropped images and i also applied otsu thresholding on it. Now, i want to convert white pixels that are in the background into black pixels
Need solution to solve this problem.
I have a GIF that I am trying to change all the white pixels to black. Not sure where to start.
Alternatively the GIF could be cropped to just the circle graphic on the left side of the GIF. I have used ffmpeg-python to crop the GIF down to a square around the circle but have yet to be able to crop it to a circle.
ffmpeg.crop(stream, 46,117,390,390)
Any insight is appreciated.
I am trying to do iris segmentation using python. After doing some thresholding, in this process I want to get the black circle area (which is pupil) in the image that I attached, is there any process or method that I can get only the black circle area from the image? Eyes Image that already thresholded
This is the original image
Original Image
We have a scanned white page - A4 size that contains multiple thumbnails.
The thumbnails are similar but not exactly the same.
The thumbnails can be in random order and not in a very clear rows and columns. They are not totally random but they are in rows, however these are not a very accurate rows.
A4 page background color is white.
All thumbnails have black border of 5px and border-radius of 10 px
Everyone of the thumbnails contains a green circle (Could be in the center or somewhere close to that).
1. How can we detect the Hard Edges of every thumbnail and store the coordinates so we can crop the thumbnails for later processing and analyzing colors?
2. How can we detect the circle in the center. We want to analyze and get all pixels RGB values contained into this circle and then calculate average RGB value.
Update
This is the image:
Thank you
Main idea: As there are enough blank between the regions, so just crop each region by contours. Then for each region, use houghCircle to detect the circle in it.
Your image is this:
After find external contours and calculate the bounding boxes:
For each contour, crop and find hough circle in it.
Notice: I'll not provide my code for this question.
But post some links maybe useful for you. Learn and do by yourself:
Copy shape to blank canvas (OpenCV, Python)
cv2.drawContours() - unfill circles inside characters (Python, OpenCV)
How to detect colored patches in an image using OpenCV?
Edge detection on colored background using OpenCV
How can I get the minimum enclosing circle with OPENCV?
How can I prepare circle path text image for OCR program?
Update:
To detect the circle, you should select the right parameters, depends on your source image.
Try! Try! TRY!
Here is the circle detection I tried:
circles = cv2.HoughCircles(gray, cv2.HOUGH_GRADIENT,
dp=1, minDist=20, circles=None,
param1=200 , param2=50,
minRadius=120, maxRadius=150
)
I have several images that claim to have a transparent background but are actually white. I'd like to use Python Image Library/PIL to set that white background color to actually be transparent.
Since PNG uses an alpha channel, I'd love to create the alpha channel by finding contiguous areas of white from the edges of the image (so I don't get "holes" of transparency when the image contains white data).
Any tips on how to create the alpha channel this way?
I'd guess you'd want to run across the image in a spiral from the outside, setting a pixel to transparent if it is white, and a pixel further towards the edge is also white transparent. Stop once you've done a whole circle without changing any pixels.
Shouldn't be too difficult to write such a loop.
Do some kind of flood fill, seeded from the white edge pixels.