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.
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?
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 used cv2.matchTemplate() to identify target objects in an image. Now I want to convert below image into binary image(black and white) in such a way that detected target object(white frames) should be in white color and rest of the objects in image should be in black color.
This is how I want an output(Binary output illustrative). Wherever white frames (in input image) is there, image area should be white and rest are in black color.