All Questions
14 questions
1
vote
0
answers
72
views
Adjust the edge points of a rectangular shaped contour
I've got a mask with a contour that is shaped similarily to a rectangle.
I currently calculate four edge points of the contour with the help of opencv and it works fine (see blue dots on image below)....
0
votes
0
answers
192
views
Need help removing a contour from image using Open CV python
I am trying to remove this rectangular contour from the binary image of this photo.
I have tried to use this tutorial https://pyimagesearch.com/2015/02/09/removing-contours-image-using-python-opencv/ ...
2
votes
1
answer
694
views
Efficient contours of a non-binary image
I have this image:
I want to get the contours of every unique (none-zero) value, so basically this output:
[array([[1, 1],
[3, 2],
[3, 1]], dtype=int32),
array([[4, 2],
[4, 3]...
0
votes
1
answer
4k
views
Removing Background Around Contour
I am only a couple weeks into learning coding with Python and OpenCV, but StackOverflow has helped me numerous times. However I cant seem to figure this issue out so decided to ask my first question.
...
0
votes
1
answer
208
views
Image preprocessing: contour expansion
I want to do some image preprocessing, but there is one step which I am not sure the best way to do it.
I have MRI Images with interesting zones annotated, I detect the contour and crop the image:
I ...
2
votes
2
answers
6k
views
How to fill a contour plot mask and retain data inside the contour and blackout the rest
I have an image like so,
By using the following code,
import numpy as np
import cv2
# load the image
image = cv2.imread("frame50.jpg", 1)
#color boundaries [B, G, R]
lower = [0, 3, 30]
...
3
votes
1
answer
2k
views
OpenCV, cv2.approxPolyDP() Draws double lines on closed contour
I want to create some polygons out of this mask:
image 1 - Mask
So i created these contours with openCV findcontours():
image 2 - Contours
When creating polygons I get these polygons:
image 3 - ...
2
votes
1
answer
1k
views
Rectify edges of a shape in mask with OpenCV
I need to rectify the edges of a shape (polygon) like the one below.
It is the result of cv2.approxPolyDPm, that approximates cv2.findContours results:
for (i, c) in enumerate(cnts):
peri = cv2....
0
votes
1
answer
759
views
OpenCV Python : how to use a contour as a mask in calcHist?
I'm trying to obtain the RGB histogram of a zone on a picture. I've already isolated my zone by thresholding the picture (the background is bright, and my isolated zone is dark). I know how to make ...
0
votes
1
answer
306
views
How to segment circle from contour?
GOAL: Locate ball in OpenCV
ISSUE: I have a mask I obtained with hsv bounds for my ball but some of the background is bleeding into my mask. How can I segment the circle I want from the background I ...
0
votes
2
answers
8k
views
create a mask and delete inside contour in opencv python
this is the result that I have from my code :
enter image description here
I've made this mask on my face using contour , as I show bellow in the code .
the final result of the project is to delete ...
0
votes
1
answer
2k
views
Android, OpenCV: Detect color & Draw Contours
How do i draw contours on only black object, and filling everything else in the background white?
My code currently is able to draw contours on an image:
Bitmap b = BitmapFactory.decodeByteArray(...
11
votes
1
answer
50k
views
get mask from contour with OpenCV
I would like to get an image mask from the contour (it exists only 1 contour) I have computed thanks to cv.findContours.
However, while my contour variable is not empty, I do not manage to retrieve ...
8
votes
1
answer
12k
views
How to resize a contour in opencv 2.4.11 python? (Goal: Object extraction)
I'm super new to opencv, so pardon my ignorance...
Basically: I have an object of interest in my image. I would like to extract it.
My problems arise from downscaling the original image in order to ...