image-processing

Morphological operations merges lines with edges of pictures

三世轮回 提交于 2020-02-04 01:30:11
问题 I have an image with nearly constant lines in it and I use algorythm with morphological operations to clear them out of the image. The thing is, that morphological opening or closing merges the lines with the edges of the image instead of only just melting the neighbor contours. I need only neighbor contours melted with morphological operations and to avoid that line merging with edge, because later I am unable to clear that merged peace of the line out of the image. The problem stays even if

OpenCV : Python equivalent of `setTo` in C++

时间秒杀一切 提交于 2020-02-03 23:22:16
问题 What is the python equivalent of Mat::setTo in C++ ? What I'm trying to do is to set value by mask: Mat img; ... img.setTo(0, mask); Update: Here is possible solution: #set by mask area to zero img= np.random.rand(200, 200, 3) * 255 img= img.astype(np.uint8) mask = np.zeros((200, 200), np.uint8) mask[10:100, 60:140] = 255 inv_mask= cv2.bitwise_not(mask) n_channels= img.shape[2] for i in range(0,n_channels): img[..., i]= img[..., i] * (inv_mask/255) #to set arbitary value img= np.random.rand

OpenCV : Python equivalent of `setTo` in C++

…衆ロ難τιáo~ 提交于 2020-02-03 23:22:13
问题 What is the python equivalent of Mat::setTo in C++ ? What I'm trying to do is to set value by mask: Mat img; ... img.setTo(0, mask); Update: Here is possible solution: #set by mask area to zero img= np.random.rand(200, 200, 3) * 255 img= img.astype(np.uint8) mask = np.zeros((200, 200), np.uint8) mask[10:100, 60:140] = 255 inv_mask= cv2.bitwise_not(mask) n_channels= img.shape[2] for i in range(0,n_channels): img[..., i]= img[..., i] * (inv_mask/255) #to set arbitary value img= np.random.rand

OpenCV : Python equivalent of `setTo` in C++

橙三吉。 提交于 2020-02-03 23:18:41
问题 What is the python equivalent of Mat::setTo in C++ ? What I'm trying to do is to set value by mask: Mat img; ... img.setTo(0, mask); Update: Here is possible solution: #set by mask area to zero img= np.random.rand(200, 200, 3) * 255 img= img.astype(np.uint8) mask = np.zeros((200, 200), np.uint8) mask[10:100, 60:140] = 255 inv_mask= cv2.bitwise_not(mask) n_channels= img.shape[2] for i in range(0,n_channels): img[..., i]= img[..., i] * (inv_mask/255) #to set arbitary value img= np.random.rand

From image to numbers [closed]

丶灬走出姿态 提交于 2020-02-03 19:07:26
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I have some images that contain numbers written perfectly. These numbers can go from one to 4 characters. Is there a way to recognize and convert these numbers to text with PHP or Javascript? Thank you, Regards.

From image to numbers [closed]

泄露秘密 提交于 2020-02-03 19:07:20
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I have some images that contain numbers written perfectly. These numbers can go from one to 4 characters. Is there a way to recognize and convert these numbers to text with PHP or Javascript? Thank you, Regards.

From image to numbers [closed]

五迷三道 提交于 2020-02-03 19:05:50
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I have some images that contain numbers written perfectly. These numbers can go from one to 4 characters. Is there a way to recognize and convert these numbers to text with PHP or Javascript? Thank you, Regards.

Improve rectangle contour detection in image using OpenCV

爷,独闯天下 提交于 2020-02-03 10:14:27
问题 I am trying to detect the rectangular boxes in the given image Original image: but the image is not good enough to detect rectangles, how can i improve it and detect all the rectangles in image? I tried to convert the image into binary image using canny edge detection and applied dilation ,bilateral filter then the output is this: I tried to apply all the morphologyEx, sobel then to i was not able to detect all rectangles in the image. If i am able to find all the boundary of rectangle then i

What's the most simple way to crop a circle thumbnail from an image?

﹥>﹥吖頭↗ 提交于 2020-02-03 08:27:07
问题 I am trying to crop a centered (or not centered) circle from this image: I stole this code from the existing questions regarding this topic on stack overflow, something goes wrong though: import cv2 file = 'dog.png' img = cv2.imread(file) img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) circle = cv2.HoughCircles(img, 3, dp=1.5, minDist=10, minRadius=1, maxRadius=10) x = circle[0][0][0] y = circle[0][0][1] r = circle[0][0][2] rectX = (x - r) rectY = (y - r) crop_img = img[rectY:(rectY+2*r), rectX:

What's the most simple way to crop a circle thumbnail from an image?

人走茶凉 提交于 2020-02-03 08:25:30
问题 I am trying to crop a centered (or not centered) circle from this image: I stole this code from the existing questions regarding this topic on stack overflow, something goes wrong though: import cv2 file = 'dog.png' img = cv2.imread(file) img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) circle = cv2.HoughCircles(img, 3, dp=1.5, minDist=10, minRadius=1, maxRadius=10) x = circle[0][0][0] y = circle[0][0][1] r = circle[0][0][2] rectX = (x - r) rectY = (y - r) crop_img = img[rectY:(rectY+2*r), rectX: