## connect lines from Canny algorithm

```I get edges from canny algorithm, but between lines are little spaces. I need to connect lines together and reduce this space.
For example: example image
I work with opencv in Android.
Has anyone an idea how to do it?
```

Consider using `cvDilate()` to dilate the image after canny is executed. This is one way to connect the line segments, and if the image gets too dilated for your purpose, you might want to execute Canny on the dilated image.

## Speckle Noise Generation

```Sorry if this seems like a silly or lazy "I-can't-find-it' question but I've been trying for a few days now to find a paper or anything of the like to explain how to generate speckle noise (on 2D images). I have found out that one of the more simple means of removing speckle noise is a mean filter (which I've already implemented) but absolutely nowhere can I find a way of generating the noise. Could someone please direct me to where I can learn to generate speckle noise? Furthermore would it be a stretch to ask if there was a simple way to do it in OpenCV (a C++ image processing library).
```

Speckle noise is essentially a multiplicative noise, which may (or may not) have an additive noise as well (definitions vary depending upon circumstances). This paper provides a good overview of speckle noise, including descriptions and approaches to removing it.

Here is a some simple python code that can produce multiplicative speckle noise:

``````import cv

mult_noise = cv.CreateImage((im.width,im.height), cv.IPL_DEPTH_32F, 1)

cv.RandArr(cv.RNG(6), mult_noise, cv.CV_RAND_NORMAL, 1, 0.1)

cv.Mul(im, mult_noise, im)

cv.ShowImage("tree with speckle noise", im)
cv.WaitKey(0)
``````

no noise:

with speckle noise:

Speckle noise is linked to the physical imaging process, so I’m not sure it’s easy (or even really possible) to simulate it in a general manner.

However, depending on your desired type of images, you can use other forms of noise to approach it. I guess that a multiplicative salt-and-pepper noise should more or less do the trick for simularing a SAR image.

Another (probably better) possibility is to explore the websites of NASA / ESA and look for SAR images (look for programs like Pleiades, Cosmo-Skymed and SAR Lupe). Some gated laser imaging labs have mnybe also released publicly some sample data.

It can be just a matter of adding gaussian noise to your image. `cvRandArr` seems like a good candidate.