Beautiful contour drawings. Isolating the contours of an image of a moving object

  • 30.06.2020

Drawing by dots for children of lines, shapes and animals. Draw by dots to develop writing skills.

Beautiful handwriting and successful learning to write depends on proper use of a pencil, skillful pressure and the ability to draw lines of all kinds of shapes. Start by teaching dot-to-dot drawing of lines and shapes, and then encourage your child to do dot-to-dot drawing of animals and coloring them.

We draw by dots, developing skills gradually

Drawing lines with a pencil or pen is an excellent practice that helps accustom your hand to writing, develop small muscles, and teach your baby to hold something tightly.

The dotted line serves as a guide and helps the child, because at any time you can slow down the speed of drawing, increase or decrease the pressure on the pencil, without spoiling the picture, and, therefore, without losing interest.

As soon as the child learns to draw lines, straight lines and all kinds of waves using points, move on to shapes and then to animals. The curves of the dotted lines will develop drawing skills enough to begin learning how to spell letters and numbers.

When offering your child printed material with a picture on which you need to draw something dot by dot, first ask the child to trace the lines with the index finger of his right hand (or left if the child is left-handed). Then ask him to draw with his finger not on the sheet, but as if in the air above the picture. Repeat the exercise several times, and then complete the task with a pencil.

When your child learns to draw dots with a pencil, offer him a pen or marker.

Pay attention to drawing animals point by point, without lifting your hand from the paper.

How else to develop fine motor skills, besides drawing with dots?

If your child for some reason is not interested in dot drawing materials, you can have fun developing fine motor skills in other ways.

  1. String large beads together on strings or sort through the beads;
  2. Glue a large sheet of paper or old wallpaper onto the wall and let your child draw his own pictures on the sheet. Drawing on a vertical surface requires more effort and the pens are trained faster;
  3. As soon as your child is already able to hold small things firmly enough in his hands and does not let go of them if he pulls lightly, start teaching him how to tie shoelaces or braid braids from any ribbons or ropes;
  4. If you read newspapers or magazines, give your child a marker and encourage him to circle all the headlines with it;
  5. A good grip between the thumb and forefinger is most easily developed by transferring beans or even peas from one bowl to another, using only two fingers rather than the entire palm.
  6. Frosty windows or foggy bathroom mirrors are a great place to learn to draw with your index finger.

If you wish, you can use each of the ways to develop your child’s fine motor skills in everyday life, this will help him learn to write faster in the future.

Adobe Photoshop is the world's most popular photo editor, where you can create really interesting things. Today you will learn how to get just the outline of an image. This can be useful, for example, for creating a coloring book for a child.

Simple drawings that don't have complex details are easiest to trace using the Pen tool. This will make it faster and easier. With images that have more complex details, the scope of work is somewhat different.

Step-by-step instruction

1. Load your original image into Photoshop.

2. Now let's start working with filters. Go to the menu “Filter” – “Styling” – “Edge Enhancement”.


The image will look like this:


3. Now also open the “Filter” menu and go to “Sketch” - “Photocopy”. A window will open, on the right side of which you need to set the following parameters: “Detailing” – 9; “Darkness” – 5. Click OK. Note: at this point it is not necessary to strictly follow the instructions. Experiment with detail and darkness settings to find the look that suits you best.


4. Go to the menu “Image” - “Correction” - “Brightness / Contrast” and adjust the parameters using the sliders until you achieve the most suitable result.




Save the finished image to your computer in JPEG format. If you created a coloring book for a child, simply print the image on a printer.

In this article you will learn how to paint with a brush based on the created contours.

First let's create a document, I didn't use a fill or gradient as you can do that yourself (I hope).

Using a tool Pen create a line. After that, by right-clicking, we call up an additional menu, where we select “Stroke Path”.


For a deeper understanding, the pen tool is not a drawing, but if we trace a line with a brush, it is actually equivalent to a line drawn with a brush. It’s quite difficult to just draw a beautiful line with a brush, that’s why we used a pen. So, the outline menu.

Now we choose Brush, i.e. what we want to outline our line with.


Check mark “Simulate pressure” is responsible for the thickness of the line. If you select this option, then with my brush parameters the line will start out thinner, then thicken towards the middle, and thin out again towards the end. If you do not use this option, then the line will have the same thickness, equal to the diameter of the previously specified brush.


So here's what I got. Since we no longer need the curve itself created by the pen, we will delete it - right-click, call up an additional menu, where we select “Delete pass”.


Finally, we can create a brush from the resulting drawing. Holding down the key Ctrl, click on the layer in the layers panel, thus loading the selection.


See you in the next lesson!

Institute of Electronic and Information Systems, NovSU, [email protected]

Methods of contour analysis are considered, which are optimally used in real-time systems to highlight the contours of objects in a video sequence.

Keywords: contour, image processing, contour analysis, video surveillance system

Introduction

Image segmentation based on contouring is considered to solve this class of problems due to the fact that changing the parameters of position, rotation and scale of the image has little effect on the amount of calculations. In addition, the contours completely determine the shape of the image, weakly depend on color and brightness, and contain the necessary information for further classification of the object. This approach makes it possible not to consider the internal points of the image and thereby significantly reduce the amount of processed information by moving from analyzing a function of two variables to a function of one variable. The consequence of this is the ability to ensure the operation of the processing system in a time scale closer to real.

Basic Concepts

By image contour we mean a spatially extended discontinuity, drop, or abrupt change in brightness values.

The ideal drop has the properties of the model shown in Fig. 1a - it is a set of connected pixels, each of which is located next to a rectangular jump in brightness, as shown by the horizontal profile in Fig. In reality, optical limitations, sampling, etc. lead to blurry brightness changes. As a result, they are more accurately modeled by an inclined profile similar to that shown in Fig. 1b. In such a model, the point of brightness difference is any point lying on an inclined section of the profile, and the difference itself is a connected set formed by all such points.

Figure 1 Model of ideal (a) and oblique (b) brightness differences

A brightness difference is considered a contour if its height and angle of inclination exceed certain threshold values.

Let us note a number of problems that arise during contour selection:

Contour breaks in places where brightness does not change quickly enough;

False contours due to noise in the image;

Excessively wide contour lines due to blur, noise or due to shortcomings of the algorithm used;

Inaccurate positioning due to line contours having unit width rather than zero width.

Differential methods

One of the most obvious and simple ways to detect edges is to differentiate the brightness, considered as a function of spatial coordinates.

Detecting edges for an image with brightness values ​​f(x1,x2) perpendicular to the x1 axis provides the partial derivative df/dx1, and those perpendicular to the x2 axis - the partial derivative df/dx2. These derivatives characterize the rate of brightness change in the x1 and x2 directions, respectively. To calculate the derivative in an arbitrary direction, you can use a brightness gradient:

grad f (x1, x2) = f (x1, x2).

The gradient is a vector in two-dimensional space, oriented in the direction of the fastest increase in the function f (x1, x2) and having a length proportional to this maximum speed. The gradient module is calculated by the formula

Figure 2 Graphical representation of the gradient

To highlight a contour of an arbitrary direction, we will use the brightness field gradients module. For images, instead of derivatives, we take discrete differences.

Roberts operator

One option for calculating a discrete gradient is the Roberts operator. Since differences in any two mutually perpendicular directions can be used to calculate the gradient modulus, diagonal differences are taken in the Roberts operator:

The difference definition is generated by two finite impulse response filters (FIR filters), whose impulse responses correspond to 2x2 masks

The disadvantages of this operator include high sensitivity to noise and the orientation of area boundaries, the possibility of discontinuities in the contour, and the absence of a clearly defined center element. But it has one advantage - low resource consumption.

Sobel and Prewitt operators

In practice, it is more convenient to use the Sobel and Prewitt operators to calculate discrete gradients. The Sobel operator has a slightly less influence of corner element noise than the Prewitt operator, which is important when working with derivatives. For each of the masks, the sum of the coefficients is equal to zero, i.e. these operators will give a zero response in regions of constant brightness.

FIR filters are 3x3 masks.

Sobel Operator Masks:

Prewitt Operator Masks:

The Sobel operator uses a weighting factor of 2 for the middle elements. This increased value is used to reduce the effect of smoothing by giving more weight to the midpoints.

To address the issue of rotation invariance, so-called diagonal masks are used to detect discontinuities in diagonal directions.

Sobel operator diagonal masks:

Diagonal Prewitt operator masks:

In the presence of a central element and low resource consumption, this operator is characterized by high sensitivity to noise and the orientation of area boundaries, as well as the possibility of discontinuities in the contour.

Figure 3. Identification of boundaries using the Sobel operator: a) original image; b) the result of applying the Sobel operator

Laplacian

To solve the problem of identifying brightness differences, you can use higher order differential operators, for example Laplace operator:

In the discrete case, the Laplace operator can be implemented as a procedure for linear image processing with a 3x3 window. Second derivatives can be approximated by second differences:

The Laplacian takes both positive and negative values, so you must take its absolute value in the edge selection operator. Thus, we obtain a procedure for identifying boundaries that is insensitive to their orientation

The role of the Laplacian in segmentation problems is to use its zero-crossing property to localize the contour and find out whether the pixel in question is on the dark or light side of the contour.

The main disadvantage of the Laplacian is its very high sensitivity to noise. In addition, breaks in the circuit may appear, as well as their doubling. Its advantages include the fact that it is insensitive to the orientation of the boundaries of areas, and low resource consumption.

Local processing

Ideally, edge detection methods should select only pixels in the image that lie on the contour. In practice, this set of pixels rarely displays the contour accurately enough due to noise, contour breaks due to illumination inhomogeneity, etc. Therefore, edge detection algorithms are usually complemented with linking procedures to generate sets of edge points containing edges.

One way to associate contour points is to analyze the characteristics of the pixels in a small neighborhood of each image point that has been marked as a contour. All points that are similar according to some criteria are associated and form an outline consisting of pixels that meet these criteria. In this case, two main parameters are used to establish the similarity of the contour pixels: the magnitude of the response of the gradient operator, which determines the value of the contour pixels, and the direction of the gradient vector.

A pixel in a given neighborhood is merged with the central pixel (x,y) if the similarity criteria in both magnitude and direction are met. This process is repeated at each point in the image while simultaneously storing the found connected pixels as the center of the neighborhood moves. A simple way to account for the data is to assign each set of linked contour pixels its own brightness value.

Canny Boundary Detector

The Canny edge detector focuses on three main criteria: good detection (increased signal-to-noise ratio); good localization (correct determination of the position of the border); the only response to one boundary.

From these criteria, a target error cost function is constructed, by minimizing which the optimal linear operator for convolution with the image is found.

To reduce the sensitivity of the algorithm to noise, the first derivative of the Gaussian is applied. After applying the filter, the image becomes slightly blurry. This is what a Gaussian mask looks like:

After calculating the gradient of the smoothed image, only the maximum points of the image gradient are left in the boundary contour. Information about the direction of the boundary is used in order to remove points exactly near the boundary and not break the boundary itself near local maxima of the gradient.

The Sobel operator is used to determine the direction of the gradient. The resulting direction values ​​are rounded to one of four angles - 0, 45, 90 and 135 degrees.

Then weak edges are removed using two thresholds. The border fragment is processed as a whole. If the gradient value somewhere on the traced fragment exceeds the upper threshold, then this fragment also remains an “acceptable” boundary in those places where the gradient value falls below this threshold, until it falls below the lower threshold. If there is not a single point in the entire fragment with a value above the upper threshold, then it is deleted. This hysteresis makes it possible to reduce the number of discontinuities in the output boundaries.

Including noise reduction in the algorithm improves the robustness of the results, but increases the computational cost and leads to distortion and loss of edge detail. The algorithm rounds the corners of objects and destroys boundaries at connection points.

The disadvantages of this method are the complexity of implementation and very high resource consumption, as well as the fact that some rounding of the object’s corners is possible, which leads to a change in the contour parameters.

The advantages of the method include weak sensitivity to noise and the orientation of area boundaries, the fact that it clearly identifies the contour and allows you to identify the internal contours of the object. In addition, it eliminates the erroneous detection of a contour where there are no objects.

Figure 4. Boundary extraction using the Canny method: a) original image; b) after processing by the Canny algorithm

Analysis using graph theory

Based on representation in the form of a graph and searching on this graph for paths with the lowest cost that correspond to significant contours, it is possible to construct a method that works well in the presence of noise. This procedure turns out to be quite complex and requires more processing time.

Figure 5. Contour element located between pixels p and q

A contour element is the boundary between two pixels p and q, which are neighbors. Contour elements are identified by the coordinates of points p and q. The contour element in Fig. 5 is determined by pairs (xp, ur)(xq, yq). A contour is a sequence of contour elements connected to each other.

The task of finding the minimum cost path on a graph is non-trivial in terms of computational complexity, and one has to sacrifice optimality in favor of computational speed.

The complexity of implementation and high resource consumption are the main disadvantages of such an analysis, the advantage of which is its low sensitivity to noise.

Conclusion

The methods presented in the work describe optimal approaches for identifying contours in real-time systems. The methods allow solving a wide range of contouring problems, which are used in many areas where image segmentation is necessary.

Literature

1. Gonzalez R., Woods R. Digital image processing. M.: Tekhnosphere, 2005. P.812-850.

2. Jane B. Digital image processing. M.: Technosphere, 2007. P.331-356.

3. Methods of computer image processing / Ed. V.A. Soifer. M.: Fizmatlit, 2003. P.192-203.

4. Pret U. Digital image processing. M.: Mir, 1982. P.499-512.

5. See: http://www.cs.berkeley.edu/~jfc/