Questions tagged [dilation]

22 questions
5
votes
0 answers

detecting articles, titles, and images in newspaper documents opencv

I have a collection of newspapers were my goal is to get bounding boxes around several ROIs. Specifically these ROIs are: articles titles images I am using opencv with python for achieving the desired result. My approach is as follows: Canny Edge…
Perl Del Rey
  • 959
  • 1
  • 11
  • 25
5
votes
2 answers

Using dilation in only one direction?

This is my first post on Stack Overflow, so I am sorry if the problem isn't defined enough. I am currently working on extracting table data from images and I need a way to dilate the text only in a vertical direction so that I can get clear column…
2
votes
2 answers

Is it possible for a dilation or erosion algorithm to not use a separate array?

I have an assignment where I am to write an inline x86 assembly code for a dilation and an erosion function. My problem is that we are not given a separate array and can't touch the non-asm part of the program. So I need to find a way to alter the…
2
votes
1 answer

Efficient image dilation in TensorFlow

I'm looking for an efficient way to implement morphological image dilation with a square kernel in TensorFlow. It looks like the obvious ways of doing it are extremely inefficient compared to what they could be, as shown by OpenCV. See results of…
Peter
  • 12,274
  • 9
  • 71
  • 86
2
votes
1 answer

Why does open cv dilation only work downwards?

Initial Question: I thought the following code should lead to the initial white pixel expanding, but this does not happen. How can I make dilate work in all directions? img = np.zeros((11, 11), dtype='uint8') img[5][5] = 255 dilated =…
Jason Oliver
  • 21
  • 1
  • 4
2
votes
1 answer

Is OpenCV able to perform a grayscale morphological dilate?

I want to use OpenCV to perform a grayscale morphological dilation. This seems very easy but I did not manage to do it. Therefore, I am wondering if it is possible to do it with OpenCV? To check the results I created a MWE comparing OpenCV and…
R. N
  • 707
  • 11
  • 31
1
vote
1 answer

PIL/Numpy: enlarging white areas of black/white mask image

I want to produce a Python algorithm which takes in a 'mask' RGB image comprised exclusively of black and white pixels. Basically, each mask is a black image with one or more white shapes on it (see below). I want to transform this image by…
Ben123
  • 335
  • 2
  • 11
1
vote
1 answer

1D-CNN Keras Dilation Toy Example InvalidArgumentError

I am having a InvalidArgumentError with shapes using a toy dilation 1D-CNN example. My input train_generator has the shape TensorShape([128, 1]) with 128 values and 1 expanded dimension to fit the convolutional features in. def model(): return…
Slayahh
  • 373
  • 4
  • 14
1
vote
2 answers

Implement "same" padding for convolution operations with dilation > 1, in Pytorch

I am using Pytorch 1.8.1 and although I know the newer version has padding "same" option, for some reasons I do not want to upgrade it. To implement same padding for CNN with stride 1 and dilation >1, I put padding as follows: …
1
vote
1 answer

Dilate in only one direction

I have an issue using erode and dilate, I'm not sure I understand how to properly use the parameters. I have this picture: Using this piece of code: def dilate_and_erode(self): img = self.img gray_img = cv2.cvtColor(img,…
Achille G
  • 748
  • 6
  • 19
1
vote
0 answers

Can i use both dilated convolution and maxpooling layer both at the same time?

In my DCNN architecture, where I am using a dilation factor of '2' in each convolution layer and the Maxpooling Layer.I am using both in concatenation. Though it is improving my accuracy, but I am thinking is it right to do so? As in dilation we…
0
votes
1 answer

Can I share weights between keras layers but have other parameters differ tf2?

is there a solution to sharing the weights of convolution layers with different paramters in dilation? like here I want to train the weights of the layer with different dilations meaning that every dilation should have an impact to the weights I've…
0
votes
0 answers

tf.nn.conv3d No algorithm worked! when appying dilation in "D" dimension

I am tying to implement a Depthwise 3D convolution. In the process, I am using a tf.nn.conv3d operation, where I utilize as input a 5D tensor, with shapes [batch, depth, height, width, channels] and a filter with exactly the same dimension than…
0
votes
0 answers

How to measure Time Dilation in Nanoseconds on iOS?

Disclaimer: This a very theoretical idea that I'm experimenting with and I get that there are hard limits to CPU hardware and physics; this is more about seeing how far I can get. The Question: How do you measure the difference in Nanoseconds…
Sam Carlton
  • 1,190
  • 1
  • 17
  • 18
0
votes
0 answers

How to get regions from points in a mask image?

Point space: Dilated: I used dilation (morphological process) but this is not the result i expected. I want more smooth regions, not squares. How to define contours and fill in them? Maybe i can use k-means like algorithms to het regions from…
c0dderBoy
  • 1
  • 2
1
2