InTech uses cookies to offer you the best online experience. By continuing to use our site, you agree to our Privacy Policy.

Mathematics » "Modern Fuzzy Control Systems and Its Applications", book edited by S. Ramakrishnan, ISBN 978-953-51-3390-2, Print ISBN 978-953-51-3389-6, Published: August 30, 2017 under CC BY 3.0 license. © The Author(s).

Chapter 15

ANFIS Definition of Focal Length for Zoom Lens via Fuzzy Logic Functions

By Bahadır Ergün, Cumhur Sahin and Ugur Kaplan
DOI: 10.5772/67823

Article top


Fuzzy numbers: (a) triangle and (b) trapezoid.
Figure 1. Fuzzy numbers: (a) triangle and (b) trapezoid.
Conventional system.
Figure 2. Conventional system.
General fuzzy system.
Figure 3. General fuzzy system.
TSK fuzzy system.
Figure 4. TSK fuzzy system.
Fuzzy system with blurring‐clarifying unit.
Figure 5. Fuzzy system with blurring‐clarifying unit.
Clarification of the highest membership degree.
Figure 6. Clarification of the highest membership degree.
Clarification with weighted mean method.
Figure 7. Clarification with weighted mean method.
Averagely the highest membership clarification.
Figure 8. Averagely the highest membership clarification.
ANFIS network system.
Figure 9. ANFIS network system.
Nikon coolpix‐E8700.
Figure 10. Nikon coolpix‐E8700.
Test field shooting plan.
Figure 11. Test field shooting plan.
Camera calibration test field.
Figure 12. Camera calibration test field.
The one obtained by Topcon PI‐3000 program in maximum focal length.
Figure 13. The one obtained by Topcon PI‐3000 program in maximum focal length.
The one obtained by Topcon PI‐3000 program in minimum focal length.
Figure 14. The one obtained by Topcon PI‐3000 program in minimum focal length.
ANFIS data set structure for radial distances.
Figure 15. ANFIS data set structure for radial distances.
ANFIS algorithm.
Figure 16. ANFIS algorithm.
Artificial neural network structure generation.
Figure 17. Artificial neural network structure generation.
Standard deviations graphic for maximum focal length (71.9 mm).
Figure 18. Standard deviations graphic for maximum focal length (71.9 mm).
Standard deviations graphic for minimum focal length (8.9 mm).
Figure 19. Standard deviations graphic for minimum focal length (8.9 mm).

ANFIS Definition of Focal Length for Zoom Lens via Fuzzy Logic Functions

Bahadır Ergün1, Cumhur Sahin1 and Ugur Kaplan2
Show details


The digital cameras have been effected from systematical errors which decreased metric quality of image. The digital cameras have been effected from systematical errors that decreases metric quality of image. The aim of this chapter is to explore usability of fuzzy logic on calibration of digital cameras. Therefore, a 145‐pointed planar test field has been prepared in the laboratories of Department of Geodesy and Photogrammetric Engineering at the Gebze Technical University. The test field has been imaged from five points of view with the digital camera Nikon Coolpix‐E8700 within maximum (71.2 mm) and minimum (8.9 mm) focal length. The input-output data have been determined from 10 calibration images obtained for fuzzy logic process. These data have also been used and formed for the space resection process. Adaptive neuro‐fuzzy inference system (ANFIS) functions have been used for fuzzy process at MATLAB 7.0, and the results of these two distinct methods have been compared. Finally, the most convenient (least squares average error) or the most useful ANFIS “Trimf, trapmf, gbellmf, gaussmf, gauss2mf, pimf, dsigmf and psigmf” functions are determined and compared for space resection method for the conventional bundle adjustment process.

Keywords: ANFIS, zoom lens calibration, focal distance, MATLAB

1. Introduction

Fuzzy inference system (FIS) is a process of mapping from given inputs to outputs by using the theory of fuzzy sets [1]. FIS derives an output by using an inference engine, which is based on a form of IF‐THEN rules. There are two well‐established types of FIS [24]. While Mamdani FIS uses the technique of defuzzification of a fuzzy output, Sugeno FIS uses weighted average to compute the crisp output [4]. In fact, adaptive neuro‐fuzzy inference system (ANFIS) structure is composed of a representation as a network structure, which has the neural learning ability of Sugeno‐type fuzzy systems. This network is made of a combination of nodes, which are placed as layers in order to perform specific functions [5, 6].

Among the neuro‐fuzzy models most used nowadays, the adaptive neuro‐fuzzy inference system (ANFIS), which was proposed in 1992 by J.S Roger in his Ph.D. thesis, must be highlighted [79]. ANFIS adapts its parameters according to training data by using the hybrid learning algorithm. The algorithm consists of the gradient descent for tuning the non‐linear antecedent parameters and the least square for tuning the linear consequent parameters [1]. Most of the success of ANFIS comes from its implementation in the MATLAB Fuzzy Logic Toolbox, with an excellent graphical interface personally developed by J.S. Roger in collaboration with N. Gulley, incorporating also diverse fuzzy logic pattern classification algorithms for the definition and dimensioning of the input membership functions (mf) [9, 10].

In the literature, there are several examples of the ANFIS, which enable it to achieve great success in a wide range of scientific applications. The advantageous features of an ANFIS include easy implementation, fast and accurate learning, strong generalization abilities, excellent explanation facilities through fuzzy rules, and easy to incorporate both linguistic and numeric knowledge for problem solving [11]. ANFIS models have recently gained much popularity not only for calibrating non‐linear relationships because they offer more advantages over conventional modeling techniques, which include the ability to handle large amounts of noisy data from dynamic and non‐linear systems, especially where the underlying physical relationships are not fully understood, but also for solving linear systems which include the interpolation modeling such as time series. Literature shows that lots of ANFIS and FIS methods were proposed for the determination of the uncertainty of pattern recognition, image matching, and three‐dimensional (3D) position definition studies in computer vision applications. For instance, color recognition ANFIS model study for robust vision system has worked in Ref. [12]. Another application for ANFIS method is suggested for appropriate calibration method of stereo camera system used for non‐intrusive distance measurement in [13]. Another example for ANFIS method in remote sensing study, functions for serving and prediction from satellite images of Prionace Glauca for pattern recognition in (Backpropagation network, RBF, functional separability network) and the neuro‐diffuse networks (ANFIS) [14]. In Ref. [15], a new hybrid method of performing eye‐to‐hand coordination and manipulation to produce a working robot named COERSU. The method is an optimized combination of two neuro‐fuzzy approaches developed by the authors: direct fuzzy servoing and fuzzy correction. The fuzzy methods are tuned by the adaptive neuro‐fuzzy inference system (ANFIS). Human action recognition is an important research area in the field of computer vision having a great number of real‐world applications. In Ref. [16], ANFIS controller method has been suggested for path tracking, a virtual field strategy for obstacle avoidance and path planning, and multiple sensors (an ultrasonic array, a thermal sensor, and a video streaming system) for obtaining information about the environment. In Ref. [17], development of a virtual robot tele‐operation platform based on hand gesture recognition has been evolved from visual information by ANFIS and support vector machines (SVM). In Ref. [18], a multi‐view action recognition framework that extracts human silhouette clues from different cameras was presented with fuzzy rule‐based system for analyzing scene dynamics and interpreting human behaviors. The interaction tool has been located in 3D space then the 3D model has obtained by means of a structured light system which is calibrated using only the vanishing points extracted from a simple planar surface. Then, an immersive interaction technique was used to manipulate the 3D model using a fuzzy technique with the advantages of a low memory usage, real‐time operation, and low positioning errors as compared to classical solutions in [19]. Quantitative analysis of the error in the reconstruction of a 3D scene, which has been captured with synthetic aperture integral imaging system, has been worked for two‐dimensional (2D) images which was captured within unknown camera parameters with adaptive neuro-fuzzy inference system (ANFIS) in [20].

In this chapter, an ANFIS approach has been developed for the detection of effective camera focal distance parameters with additional parameters, which help the measurement of image coordinates that provide the basis for three‐dimensional modeling obtained from two‐dimensional images, which are similar to [19, 20] studies. Thus, the photogrammetric studies, which benefit from self‐calibration conventional model, will be more usable with different cameras and different time points.

The main logic of this chapter is to process the selected radial distances via ANFIS functions and to obtain a focus distance value for each of the images. It is seen that ANFIS functions of optical distortion law can be validated by its effect on data sets. This also proves that ANFIS functions validate a physical reality and describe it in a highly reliable way. As a result of the research, it is seen that the approach of fuzzy logic can be used for the calibration process of digital cameras. Thus, it is concluded that it would be beneficial to use and study the fuzzy logic approach more in photogrammetric applications [21].

Information about fuzzy systems is described in the second part of this chapter. Third part of this chapter is the experimental application part. Test field has been photographed from five different angles with Nikon Coolpix‐e8700 digital camera with maximum (71.2 mm) and minimum (8.9 mm) focal distances in the application. Input and output data are determined with the resulting 10 images; space resection approach is created and studied by using ANFIS functions on MATLAB 7.0 software. Trimf, trapmf, gbellmf, gaussmf, gauss2mf, pimf, dsigmf, and psigmf functions in Fuzzy Interface System (FIS), which are used for creating a relation between fuzzy sets, under anfisedit menu in fuzzy logic tools on MATLAB 7.0 software, are studied in terms of space resection approach, and the most appropriate functions are determined for the detection of focal distance. The fourth part presents the results and their interpretations.

2. Fuzzy logic and main principles

Fuzzy logic is based on the logic of clustering and determination of membership degrees depending of this clustering. Membership degrees generate rule‐based work systematic which constitutes the rules of fuzzy systems. Fuzzy cluster sections which are placed in the inlets and outlets of the fuzzy rules express an approximation for each. In this respect, all expressions like “approximately 3,” “nearly 9,” “over 5 and approximate” always express a fuzzy number. Each of these approximations corresponds to a fuzzy cluster. It cannot be possible to solve mathematical operations with these fuzzy numbers. The operations are made with fuzzy numbers by defining some restrictions. In order for a fuzzy number to exist, fuzzy cluster of this needs to have an interval of normal, convex, limited support and at section of membership degree, closed and finite. For the fuzzy numbers to be normal, membership degree of at least one of the real numbers in the fuzzy expression must be 1.

Generally, two fuzzy numbers as a triangle and trapezoid are in question. Mathematical expression of a triangle fuzzy number showed with a fuzzy cluster is given as Eq. (1):


In the expression of mf(x;a,b,c), a and c show the lower and upper limit values relatively and b shows the single number with full membership. Similarly, trapezoid fuzzy numbers are expressed with four full whole numbers as a, b, c, d. Here a and d show lower and upper limit values of trapezoid fuzzy numbers; b and c show the limits of the cluster of the trapezoid numbers whose membership degree is full between these two numbers. Mathematical indication of trapezoid fuzzy number is like Eq. (2):


If we pay attention, when b = c, trapezoid fuzzy number is transformed into triangle fuzzy number. Graphical indication of these fuzzy numbers is as shown in Figure 1 .


Figure 1.

Fuzzy numbers: (a) triangle and (b) trapezoid.

Generally, there are two reasons for the researchers to use fuzzy systems:

  • Since the real‐world incidents are very complicated, these incidents are not possible to be taken under control by being defined with specific equations. As a natural result of this, the researcher always prefers applying to the methods that have approximate solubility even if not certain. As Einstein said, if it can be said that real‐life incidents can be indicated with mathematical equations, either the accuracy of the equation cannot be mentioned or if the result that mathematical equations exactly depicts the reality is taken, then real‐life incidents cannot be mentioned. So, the solutions are approximate to a certain extent in all studies conducted. Otherwise, many non‐linear equations must be solved simultaneously which is known to lead to chaotic unspecified problems according to current information.

  • All theories and equations in engineering express the real world approximately. Even though many real systems are not linear, every effort is given in order to accept the linearity in examination of these with classic methods. In order for the verbal data presented by people to be converted into numerical data and calculated by being perceived by computers and algorithms, fuzzy systems are needed.

Almost all of mathematical, stochastic, or conceptual systems so far are made up of three units given in Figure 2 .


Figure 2.

Conventional system.

These are input unit, a transition function which converts this input to output and is called system behavior and output unit. In all of the units here, numerical data are processed. The difference of the fuzzy systems from the conventional systems is that the system behavior section is divided into two and there are four connected units between each other as shown in Figure 3 .


Figure 3.

General fuzzy system.

Each of the units here has tasks, which are different but can be related to each other:

  • General information base unit: It includes input variants to which the incident to be examined is subjected and all information about these. Because the it includes both numerical and/or textual data, the database is called as ‘general database’.

  • Fuzzy rule base unit: It includes all the rules which can be written in the type of logical IF‐THEN, connecting the inputs in data base to output variants. In writing of these rules, the whole interval connections (fuzzy cluster) which can only be between input and output data are considered. Thus, each rule connects one piece of input space to the output space logically. All of these contexts form the base rule.

  • Fuzzy deduction engine unit: It is a mechanism including the operations, which enable a system to behave as having one output by bringing the relations formed between input and output fuzzy clusters in a fuzzy rule base unit together. This engine serves for determination of what kind of output the whole system will give between the inputs by bringing deductions of each rule together.

  • Output unit: It indicates the output values obtained as a result of the interaction of information and fuzzy rule bases with deduction engine.

Figure 3 represents a general fuzzy system. The point to be paid attention to here is information and outputs in the input; in other words, databases are fuzzy values. So each unit in Figure 3 is made up of fuzzy clusters entirely. The most significant deficiency of basic fuzzy system is that numerical database cannot enter into such a fuzzy system and the outputs are not numerical, so they cannot be directly used in engineering designs.

In order to certainly eliminate the deficiencies of the general fuzzy system is extented to a new system which is proposed in Refs. [3, 22] This is called Takagi-Sugeno-Kank (TSK) fuzzy system. For each inputs and the outputs obtained as a result of operation of fuzzy rule and deduction engine are in the way of a function of inputs which are from input database. So like the input variants in rule base, it was thought that these variants are reflected to rule result section after THEN word as a linear function of these variants [21]. According to this, the rule is presented in the following part.

IF the speed of your car is high, THEN stepping on the gas force can be expressed as y = ax. For example, in the case that three input variants exist (x1, x2, and x3), in one of fuzzy system, y as output variant generally; IF x1 is little and x3 is wide, THEN it can be expressed as y = a0 + a1x1 + a2x2 + a3x3 . Result sections of all rules are made up of a polynomial linear equation. Since in the fuzzy system which has such a structure output variants are not used in the deduction of fuzzy clustering, instead of fuzzy deduction unit in Figure 3 , weighted deduction calculation unit comes as mainly the membership degrees calculated from the input section of each rule. This system is shown in Figure 4 .


Figure 4.

TSK fuzzy system.

Actually in such a fuzzy system, output space is represented as a function of the inputs for being a rule valid in each sub‐space. Even in the case that the output surface is not linear, with TSK approach they are understood as modeled in the way of plain pieces of input variant kind on sub‐spaces.

However, TSK fuzzy systems have deficiencies as there is a mathematical relation after IF part; output sections of the rules cannot model the verbal data given by human, and output sections of all rules, which are possible to be written between input and output variants cannot be written because they are fuzzy. In order to eliminate these deficiencies, fuzzy system, which is respectively blur, and clarification units are used in input and output units given in Figure 5 [21].


Figure 5.

Fuzzy system with blurring‐clarifying unit.

Here, fuzzy rule base and deduction engine in a general fuzzy system remain as they are. In the case that the inputs are numerical, there are blurring agent unit, which is for blurring them with a process, and clarifying agent unit, which is for digitizing the fuzzy outputs. Blurring (fuzzification) and clarifying (defuzzification) mean, respectively, blurring the input numbers and digitizing the fuzzy numbers.

Among the main properties of fuzzy systems, multiple inputs, rule base, and conversion as single output by processing with deduction engine come as the most important issues. In some special situations, outputs may be more than one. Fuzzy system determines the behavior of the system by converting variants forming the inputs to output variant in a way of non‐linear. By this way, it is possible to take the examined system under control in order to reach desired results by subjecting information base to non‐linear conversions. Owing to the fuzzy systems, it becomes possible to process image, make guess based on time series, solve control problems, and perform applications on communication issues. Other than this, fuzzy systems can be used in many areas like engineering, medicine, sociology, psychology, business management, expert systems, artificial intelligence, signal processing, transportation, and signalization.

Exact numerical values are needed in practical applications particularly for sizing in engineering designs. In such cases, fuzzy information must be clarified in order for the required answers to be given by benefiting from information obtained or given as fuzzy. All processes made for conversion of fuzzy information to exact results are called clarification.

There are many clarification methods [23]. A few of them are presented below. In these processes, z indicates fuzzy deduction cluster, indicates components, and z * indicates clarified value.

  • The highest membership principle: Another name of this process is height method. For this method to be used, fuzzy deduction clusters with peaks are needed. This method can be indicated with Figure 6 .

  • Centroid method: Another name of this method is center of gravity method. It could be the most common one of clarification methods. Mathematical expression is as shown in Eq. (3):


Figure 6.

Clarification of the highest membership degree.


Clarification is performed according to the center of gravity of fuzzy expression.

  • Weighted mean method: In order for this method to be used, symmetric membership function (mf) is needed. Mathematical explanation is as shown in Eq. (4):


Here Σ sign indicates algebraic sum. Graphical indication of this method is shown in Figure 7 . Here, each membership function of fuzzy cluster constituting the output is multiplied with the highest membership degree value it has and their weighted mean is calculated. For instance, weighted mean (clarified value) of two fuzzy clusters in Figure 7 is calculated as shown in Eq. (5).


Figure 7.

Clarification with weighted mean method.


Since this clarifying process is valid only for symmetric membership functions, a and b values are the mean of the figures they represent.

  • Averagely the highest membership degree method: This method is also known as the mean of the highest ones. In this respect, it is very close to the first clarification principle. However, the position of the highest membership may not be singular. This means that the one having the highest membership degree in the membership function, mf (z) = 1, may exist in a plain section instead of a point.

Clarified value according to this method in graphical indication in Figure 8 is as shown in Eq. (6):


Figure 8.

Averagely the highest membership clarification.

  • Central management of the sums: It is the fastest one among the clarification methods used. In this method, instead of combination of two fuzzy clusters, their algebraic sum is used. A deficiency of this is overlapping sections entering into the sum twice. Clarified value can be calculated as Eq. (7).


In a way, this calculation form resembles weighted mean clarification. However, in the method of center of sums, weights are the areas of related membership functions. In the average weights method, this is a membership degree.

  • Center of the largest area: If the outlet fuzzy cluster includes at least two convex fuzzy sub‐clusters, center of gravity of the one with the biggest area of convex fuzzy clusters is used in clarification process. Mathematical indication of this method is as shown in Eq. (8):


Here, üebç(z) indicates the sub‐region where the convex fuzzy cluster with the biggest area dominates. This circumstance is used when all fuzzy deduction clusters are not convex; however, in the case that all deductions are convex, the result is the same with the one obtained with z* centroid method.

  • The highest first and last membership degree method: In this method, the lowest (or the highest) fuzzy cluster value with the highest membership degree in the fuzzy cluster that comes up as a combination of all outputs is selected. The equations below are valid for z* value to be given by calculations. At first, the biggest height yeb is determined in the combination of fuzzy cluster deduction, B.


Then, first highest value, z* is found. Another way of this is to find the last highest fuzzy cluster value instead of the first one.

ANFIS name, which means fuzzy deduction system based on open adaptive networks or adaptive neural fuzzy detection system, is made of the first letters of adaptive network‐based fuzzy interface system or adaptive neuro‐fuzzy interface system. This network is the combination of the nodes, which are placed as layers for performing specific functions [5, 21]. ANFIS consists of six layers. This system is presented in Figure 9 .


Figure 9.

ANFIS network system.

Node functions of each layers on ANFIS structure and the operations of layers are briefly explained [23, 24]:

  • First layer: This is called the input layer. Input signals, which are taken from each of the nodes on this layer, are transferred into other layers.

  • Second layer: This is called the fuzzification layer. Jang’s ANFIS model uses the current Bell activation function as the membership function in order to divide input values into fuzzy sets. Here, output of each node is formed of input values, and membership degrees related to membership function and membership degrees, which are obtained from the second layer are shown as µAj (x) and µBj (y).

  • Third layer: This is the rule layer. Each node in this layer expresses the rules and number of Sugeno fuzzy logic deduction system. Output of each rule node µi is the multiplication of membership degrees coming from second layer, and obtaining µi values are such as (j=1,2) and (i=1,….,n);


Here, yi3 represents the output values of the third layer and n represents the number of nodes in this layer.

  • Fourth layer: This is the normalization layer. Each node in this layer assumes all the nodes coming from rule layer as the input value, and it calculates the normalized ignition level of each rule.

Calculation of normalized ignition level i µ is as shown in Eq. (11):

  • Fifth layer: This is the debugging layer. In this layer, weighted result values of a rule, which is given in each node, are calculated. Output value of i node in fifth layer is as shown in Eq. (12):


Here, (pi, qi, ri ) variables are result parameter set for i rule.

  • Sixth layer: This is the sum layer. There is only one node in this layer, and it is tagged with ∑. Here, output values of each node in the fifth layer are added to each other, and a real value of ANFIS system is obtained. System output value y can be calculated with Eq. (13):


3. Application

MATLAB is a software development instrument designed for technical calculations and the solutions of mathematical problems. MATLAB, which is the abbreviation of the words “MATrix LABoratory,” works using matrixes as understood from its name or, in other words, using arrays. MATLAB, which is estimated to be used by over 500,000 academician, researcher, and students, is also described as the most advanced technical and scientific problem solving and application development instrument of the computer world with many interfaces it includes. MATLAB, particularly used in the analysis of the systems in engineering area, can perform the operations of data analysis and examination, visibility and image processing, generating algorithm prototype, modeling and simulation, programming and application development [25].

Application study consists of two basic steps. These are:

  • Geometric camera calibration with conventional method

  • Focal length calculation with ANFIS functions

In the application phase, geometric camera calibration study has been performed with bundle block adjustment method by using conventional method as the first step. In this study made by using zoom lens, camera calibration study has been preferred in both minimum and maximum focal lengths for Nikon Coolpix‐E8700 camera whose focal length has been selected. The image of this camera is shown in Figure 10 .


Figure 10.

Nikon coolpix‐E8700.

Images of test fields on which there are 145 points have been taken with Nikon Coolpix‐E8700 digital camera from five angles in the situations of maximum (71.2 mm) and minimum (8.9 mm) focal length of the objective in the Photogrammetry Laboratory of Department of Geodesy and Photogrammetric Engineering of Gebze Technical University. This process is shown in Figure 11 .


Figure 11.

Test field shooting plan.

Coordinates of 145 points on test field were determined locally, and these values have been regarded as field coordinate (ANNEX‐1). After that, 10 images obtained have been subjected to the evaluation in Topcon Pl‐3000 software, and calibration parameters (inner orientation factors and distortion parameters) have been determined in situations of maximum focal length (71.2 mm) and minimum focal length (8.9 mm) of digital camera. These steps have been explained in Figures 11 and 12 for both focal distances.


Figure 12.

Camera calibration test field.

1    1.0000000e-002 1.0000000e-002 1.0000000e-00273    4.3500000e-001 6.0500000e-001 1.0000000e-002
2    9.5000000e-002 1.0000000e-002 1.0000000e-00274    4.3500000e-001 7.7500000e-001 1.0000000e-002
3    1.8000000e-001 1.0000000e-002 1.0000000e-00275    4.3500000e-001 8.6000000e-001 1.0000000e-002
4    2.6500000e-001 1.0000000e-002 1.0000000e-00276    4.3500000e-001 9.4500000e-001 1.0000000e-002
5    3.5000000e-001 1.0000000e-002 1.0000000e-00277    4.3500000e-001 1.0300000e+000 1.0000000e-002
6    4.3500000e-001 1.0000000e-002 1.0000000e-00278    4.3500000e-001 1.1150000e+000 1.0000000e-002
7    5.2000000e-001 1.0000000e-002 1.0000000e-00279    4.3500000e-001 1.2000000e+000 1.0000000e-002
8    6.0500000e-001 1.0000000e-002 1.0000000e-00280    5.2000000e-001 1.0000000e-002 1.0000000e-002
9    6.9000000e-001 1.0000000e-002 1.0000000e-00281    5.2000000e-001 9.5000000e-002 1.0000000e-002
10    7.7500000e-001 1.0000000e-002 1.0000000e-00282    5.2000000e-001 1.8000000e-001 1.0000000e-002
11    8.6000000e-001 1.0000000e-002 1.0000000e-00283    5.2000000e-001 3.5000000e-001 1.0000000e-002
12    9.4500000e-001 1.0000000e-002 1.0000000e-00284    5.2000000e-001 4.3500000e-001 1.0000000e-002
13    1.0300000e+000 1.0000000e-002 1.0000000e-00285    5.2000000e-001 5.2000000e-001 1.0000000e-002
14    1.1150000e+000 1.0000000e-002 1.0000000e-00286    5.2000000e-001 6.9000000e-001 1.0000000e-002
15    1.2000000e+000 1.0000000e-002 1.0000000e-00287    5.2000000e-001 7.7500000e-001 1.0000000e-002
16    9.5000000e-002 1.0000000e-002 1.0000000e-00288    5.2000000e-001 8.6000000e-001 1.0000000e-002
17    9.5000000e-002 9.5000000e-002 1.0000000e-00289    5.2000000e-001 1.0300000e+000 1.0000000e-002
18    9.5000000e-002 1.8000000e-001 1.0000000e-00290    5.2000000e-001 1.1150000e+000 1.0000000e-002
19    9.5000000e-002 2.6500000e-001 1.0000000e-00291    5.2000000e-001 1.2000000e+000 1.0000000e-002
20    9.5000000e-002 3.5000000e-001 1.0000000e-00292    6.0500000e-001 1.0000000e-002 1.0000000e-002
21    9.5000000e-002 4.3500000e-001 1.0000000e-00293    6.0500000e-001 9.5000000e-002 1.0000000e-002
22    9.5000000e-002 5.2000000e-001 1.0000000e-00294    6.0500000e-001 2.6500000e-001 1.0000000e-002
23    9.5000000e-002 6.0500000e-001 1.0000000e-00295    6.0500000e-001 4.3500000e-001 1.0000000e-002
24    9.5000000e-002 6.9000000e-001 1.0000000e-00296    6.0500000e-001 5.2000000e-001 1.0000000e-002
25    9.5000000e-002 7.7500000e-001 1.0000000e-00297    6.0500000e-001 6.0500000e-001 1.0000000e-002
26    9.5000000e-002 8.6000000e-001 1.0000000e-00298    6.0500000e-001 6.9000000e-001 1.0000000e-002
27    9.5000000e-002 9.4500000e-001 1.0000000e-00299    6.0500000e-001 7.7500000e-001 1.0000000e-002
28    9.5000000e-002 1.0300000e+000 1.0000000e-002100    6.0500000e-001 9.4500000e-001 1.0000000e-002
29    9.5000000e-002 1.1150000e+000 1.0000000e-002101    6.0500000e-001 1.1150000e+000 1.0000000e-002
30    9.5000000e-002 1.2000000e+000 1.0000000e-002102    6.0500000e-001 1.2000000e+000 1.0000000e-002
31    1.8000000e-001 1.0000000e-002 1.0000000e-002103    6.9000000e-001 1.0000000e-002 1.0000000e-002
32    1.8000000e-001 9.5000000e-002 1.0000000e-002104    6.9000000e-001 9.5000000e-002 1.0000000e-002
33    1.8000000e-001 1.8000000e-001 1.0000000e-002105    6.9000000e-001 1.8000000e-001 1.0000000e-002
34    1.8000000e-001 3.5000000e-001 1.0000000e-002106    6.9000000e-001 3.5000000e-001 1.0000000e-002
35    1.8000000e-001 4.3500000e-001 1.0000000e-002107    6.9000000e-001 4.3500000e-001 1.0000000e-002
36    1.8000000e-001 5.2000000e-001 1.0000000e-002108    6.9000000e-001 5.2000000e-001 1.0000000e-002
37    1.8000000e-001 6.0500000e-001 1.0000000e-002109    6.9000000e-001 6.0500000e-001 1.0000000e-002
38    1.8000000e-001 6.9000000e-001 1.0000000e-002110    6.9000000e-001 6.9000000e-001 1.0000000e-002
39    1.8000000e-001 7.7500000e-001 1.0000000e-002111    6.9000000e-001 7.7500000e-001 1.0000000e-002
40    1.8000000e-001 8.6000000e-001 1.0000000e-002112    6.9000000e-001 8.6000000e-001 1.0000000e-002
41    1.8000000e-001 1.0300000e+000 1.0000000e-002113    6.9000000e-001 1.0300000e+000 1.0000000e-002
42    1.8000000e-001 1.1150000e+000 1.0000000e-002114    6.9000000e-001 1.1150000e+000 1.0000000e-002
43    1.8000000e-001 1.2000000e+000 1.0000000e-002115    6.9000000e-001 1.2000000e+000 1.0000000e-002
44    2.6500000e-001 1.0000000e-002 1.0000000e-002116    7.7500000e-001 1.0000000e-002 1.0000000e-002
45    2.6500000e-001 9.5000000e-002 1.0000000e-002117    7.7500000e-001 9.5000000e-002 1.0000000e-002
46    2.6500000e-001 2.6500000e-001 1.0000000e-002118    7.7500000e-001 1.8000000e-001 1.0000000e-002
47    2.6500000e-001 4.3500000e-001 1.0000000e-002119    7.7500000e-001 2.6500000e-001 1.0000000e-002
48    2.6500000e-001 5.2000000e-001 1.0000000e-002120    7.7500000e-001 3.5000000e-001 1.0000000e-002
49    2.6500000e-001 6.0500000e-001 1.0000000e-002121    7.7500000e-001 4.3500000e-001 1.0000000e-002
50    2.6500000e-001 6.9000000e-001 1.0000000e-002122    7.7500000e-001 5.2000000e-001 1.0000000e-002
51    2.6500000e-001 7.7500000e-001 1.0000000e-002123    7.7500000e-001 6.0500000e-001 1.0000000e-002
52    2.6500000e-001 9.4500000e-001 1.0000000e-002124    7.7500000e-001 6.9000000e-001 1.0000000e-002
53    2.6500000e-001 1.1150000e+000 1.0000000e-002125    7.7500000e-001 7.7500000e-001 1.0000000e-002
54    2.6500000e-001 1.2000000e+000 1.0000000e-002126    7.7500000e-001 8.6000000e-001 1.0000000e-002
55    3.5000000e-001 1.0000000e-002 1.0000000e-002127    7.7500000e-001 9.4500000e-001 1.0000000e-002
56    3.5000000e-001 9.5000000e-002 1.0000000e-002128    7.7500000e-001 1.0300000e+000 1.0000000e-002
57    3.5000000e-001 1.8000000e-001 1.0000000e-002129    7.7500000e-001 1.1150000e+000 1.0000000e-002
58    3.5000000e-001 3.5000000e-001 1.0000000e-002130    7.7500000e-001 1.2000000e+000 1.0000000e-002
59    3.5000000e-001 4.3500000e-001 1.0000000e-002131    8.6000000e-001 1.0000000e-002 1.0000000e-002
60    3.5000000e-001 5.2000000e-001 1.0000000e-002132    8.6000000e-001 9.5000000e-002 1.0000000e-002
61    3.5000000e-001 6.9000000e-001 1.0000000e-002133    8.6000000e-001 1.8000000e-001 1.0000000e-002
62    3.5000000e-001 7.7500000e-001 1.0000000e-002134    8.6000000e-001 2.6500000e-001 1.0000000e-002
63    3.5000000e-001 8.6000000e-001 1.0000000e-002135    8.6000000e-001 3.5000000e-001 1.0000000e-002
64    3.5000000e-001 1.0300000e+000 1.0000000e-002136    8.6000000e-001 4.3500000e-001 1.0000000e-002
65    3.5000000e-001 1.1150000e+000 1.0000000e-002137    8.6000000e-001 5.2000000e-001 1.0000000e-002
66    3.5000000e-001 1.2000000e+000 1.0000000e-002138    8.6000000e-001 6.0500000e-001 1.0000000e-002
67    4.3500000e-001 1.0000000e-002 1.0000000e-002139    8.6000000e-001 6.9000000e-001 1.0000000e-002
68    4.3500000e-001 9.5000000e-002 1.0000000e-002140    8.6000000e-001 7.7500000e-001 1.0000000e-002
69    4.3500000e-001 1.8000000e-001 1.0000000e-002141    8.6000000e-001 8.6000000e-001 1.0000000e-002
70    4.3500000e-001 2.6500000e-001 1.0000000e-002142    8.6000000e-001 9.4500000e-001 1.0000000e-002
71    4.3500000e-001 3.5000000e-001 1.0000000e-002143    8.6000000e-001 1.0300000e+000 1.0000000e-002
72    4.3500000e-001 4.3500000e-001 1.0000000e-002144    8.6000000e-001 1.1150000e+000 1.0000000e-002
145 8.6000000e-001 1.2000000e+000 1.0000000e-002


In Figures 13 and 14 , focal length obtained with bundle block adjustment (conventional method), inner orientation parameters, and radial distortion parameters were summarized from Topcon PI‐3000 software interface.


Figure 13.

The one obtained by Topcon PI‐3000 program in maximum focal length.


Figure 14.

The one obtained by Topcon PI‐3000 program in minimum focal length.

As the second step of the application, image coordinates measured over images have been indicated radially with Eq. (14) for maximum focal length and minimum focal length values of digital camera.

ck: calibrated focal length

r1: radial distance

τ: distortion angle

Twenty‐three points have been selected and arranged in the format of training data (smalldata.dat) and remaining 122 points have been arranged in the format of test data (bigdata.dat) as shown in Figure 15 . ANFIS data set which are used in fuzzification and defuzzification have been composed from equation process with radial distance and angle. This process has been repeated for the images taken from 10 different angles for each zoom distance. ANFIS data set has been composed from equation process with radial distance and angles.


Figure 15.

ANFIS data set structure for radial distances.

In Figure 15 , first and fourth columns indicate x values of image coordinates, second and fifth columns indicate y values, and third and sixth columns indicate focal lengths calculated radially.

After ANFIS data set has been generated, an ANFIS application stated below has been performed by using MATLAB software. The basic logic in this application is radial distances selected as input is processed with the help of ANFIS functions, and as a result, a focal length value for each image has been obtained. Algorithm figure determined for this method is indicated below. Here, it is seen that training algorithm determined for generation of ANFIS artificial neural network operates iteratively. Artificial neural network structure shaped with training data described as training data and consisting of 23 points gives result with the last iteration where 122 points are also included for getting the exact result. Thus, a calculation, which includes again the same quantity of measurement (145 radial values) corresponding to focal length distance, is determined with conventional method. For this reason, a logical measurement number equality has been enabled in comparison of ANFIS results with conventional method. In brief, the measurement values in the first and second steps are in the same quantity. This process has been explained in Figure 16 .


Figure 16.

ANFIS algorithm.

Each data set has been subjected to process with eight different ANFIS functions (trimf, trapmf, gbellmf, gaussmf, gauss2mf, pimf, dsigmf, and psigmf) as indicated above and quadratic average error values of Artificial Neural Network and ANFIS functions have been obtained. Artificial neural network structure has been shown in Figure 17 from MATLAB ANFIS interface.


Figure 17.

Artificial neural network structure generation.

Measured radial values and ANFIS artificial neural network structure have been indicated in Figure 17 . Quadratic mean errors (standard deviation) of focal length differences related to radial lengths obtained for function structures used in forming artificial neural network have been generated for 10 images in total according to maximum focal length data as shown in Table 1 and minimum focal length data as shown in Table 2 . While there are standard deviation values here, focal length value obtained (with bundle block adjustment) in the first step has been used as exact value. At the end of the first step, inner orientation parameters obtained by conventional method will be considered as true, and they will constitute reference data to be used in comparison for the results obtained with second step in other word ANFIS.

Maximum focal length (71.9 mm)
Num.ANFIS functionImage 1Image 2Image 3Image 4Image 5

Table 1.

Standard deviation values of maximum focal length obtained with ANFIS functions.

Minimum focal length (8.9 mm)
Num.ANFIS functionImage 1Image 2Image 3Image 4Image 5

Table 2.

Standard deviation values of minimum focal length obtained with ANFIS functions.

The result of determining focal distance with eight ANFIS functions, which are used in the application and square mean errors which are obtained with these functions, are compared to camera calibration values which are calculated with the conventional method (bundle block adjustment), and the differences of focal distances are illustrated image by image.

The results that eight ANFIS functions have given standard deviations for first image to fifth image depending on the maximum and minimum focal lengths have been detailed in the graphs in Figures 18 and 19 . When ANFIS method is examined in terms of reliability and inner reliability parameters between selected functions with this application realized, it has been seen that it gives the most suitable results in determination of focal length of trimf and gaussmf functions.


Figure 18.

Standard deviations graphic for maximum focal length (71.9 mm).


Figure 19.

Standard deviations graphic for minimum focal length (8.9 mm).

4. Conclusion

When the results were obtained at the end of the application, it was seen that data with long focal lengths produce lower quadratic mean errors, and test data produced by using short focal length produce higher quadratic mean error values in the same ANFIS functions. When its mathematical structure is considered from radial distortion focal length graphics, it is seen that the shorter the focal length, the more radial distortion error happens. When this situation is considered, it is seen that radial distortion error directly influences the approach to ANFIS functions, and it has an influence on general error amount in data set. In other words, it has been seen that optical distortion law can be verified with the influence of ANFIS functions to data sets. This at the same time proves a physical fact in general table that it verifies ANFIS functions and depicts it in a very proper way.

When the graphics of the functions between each other are examined, it is seen that the most proper (with the least quadratic mean error) or the most usable ANFIS functions in a bundle block adjustment study to be modeled in ANFIS structure related to spatial resection structure are “trimf, gbellmf and gaussmf.”

It is seen that ANFIS functions, which depict balancing as the weakest (with the highest quadratic mean error), are “pimf, dsigmf and psigmf” functions with this approach. When an assessment is made concerning the general of this study to make an approach of spatial resection by using ANFIS system, advantages and disadvantages below will occur for the calibration studies.


  • There will be no need for generating a separate unreal algorithm for spatial resection step in bundle block adjustment.

  • Study will be able to be made without the need of approximate rotation and reciprocation parameters.

  • It will decrease iteration number for bundle block adjustment.

  • Calibration will be able to be enabled during study not only in minimum and maximum focal lengths but also in all focal lengths.


  • Data sets must be prepared for ANFIS sets. This requires additional time.

  • It is not possible to reach approximate rotation and reciprocation parameters.

  • Since the system will directly give result, focal length necessary for calibration will be known only as approximately depending on data number.

  • It is verified for more than sufficient images that focal length found with additional transaction can be used as calibrated for certain.

  • All images to be determined for the project must be taken from the same focal length.

As a result of the studies conducted, it has been seen that fuzzy logic approach can be used in the study of calibration of digital cameras. It was determined that the accuracy can be increased by increasing the data number of estimation model established with ANFIS method and estimation can be made benefiting from other artificial intelligence methods. For this reason, it was concluded that it will be more beneficial to use and search fuzzy logic approach more in photogrammetric applications.


1 - Kajornrit J, Wong KW, Fung CC. A comparative analysis of soft computing techniques used to estimate missing precipitation records. In: Proceedings of the 19th ITS Biennial Conference; 18-21 November 2012; Bangkok, Thailand.
2 - Mamdani EH, Assilian S. An experiment in linguistic synthesis with a fuzzy logic controller. International Journal of Human‐Computer Studies. 1999;51(2):135-147. doi:10.1006/ijhc.1973.0303.
3 - Takagi T, Sugeno M. Fuzzy identification of systems and its applications to modeling and control. IEEE Transactions on Systems, Man and Cybernetics. 1985;15:116-132. WOS:A1985AFX0900011.
4 - Hamam A, Georganas ND. A comparison of mamdani and sugeno fuzzy ınference systems for evaluating the quality of experience of hapto‐audio‐visual applications. In: Proceeding of the IEEE International Workshop on Haptic Audio Visual Environments and their Applications 18-19 October 2008; Ottawa, Canada. IEEE.
5 - Tsoukalas LH, Uhrig RE. Fuzzy and neural approaches in engineering (1st ed.). New York: John Wiley & Sons; 1996, 600 p. ISBN:0471160032.
6 - Cıtak E. Fuzzy logic approach to determine the factors affecting hand dexterity [thesis]. Unıversıty of Cukurova; 2008.
7 - Roger JS, Sun C. Functional equivalence between radial basis function networks and fuzzy inference systems. IEEE Transactions on Neural Networks. 1993;4:156-159. doi:10.1109/72.182710.
8 - Roger JS. ANFIS: adaptive network based fuzzy inference systems. IEEE Transactions on Systems Man and Cybernetics. 1993;23(3):665-685. doi:10.1109/21.256541.
9 - Perez JA, Gonzalez M, Dopico D. Adaptive neurofuzzy ANFIS modeling of laser surface treatments. Neural Computing & Applications. 2010;19:85-90. doi:10.1007/s00521‐009‐0259‐x.
10 - Roger JS, Gulley N. Matlab fuzzy logic toolbox. User#x2019;s guide. Natick: The MathWorks Inc.; 2007.
11 - Jang JSR, Sun CT, Mizutani E. Neuro‐fuzzy and soft computing: a computational approach to learning and machine intelligence. Englewood Cliffs, NJ: Prentice‐Hall; 1997.
12 - Sabzevari R, Masoumzadeh S, Ghahroudi MR. Employing anfis for object detection in robo‐pong. In: Proceeding of 5th International Symposium on Mechatronics and its Applications (ISMA08); 27-29 May 2008; Amman, Jordan, pp. 707-712.
13 - Orghidan R, Danciu M, Vlaicu A, Oltean G, Gordan M, Florea C. Fuzzy versus crisp stereo calibration: a comparative study. In: Proceeding of 7th International Symposium on Image and processing and analysis (ISPA 2011); 4-6 September 2011; Dubrovnik, Croatia, pp. 627-632.
14 - Nuno AI, Arcay B, Cotos JM, Varela J. Optimisation of fishing predictions by means of artificial neural networks, anfis, functional networks and remote sensing images. Expert Systems with Applications. 2005;29:356-363. doi:10.1016/j.eswa.2005.04.008.
15 - Jafari S, Jarvis R. Robotic hand‐eye coordination: from observation to manipulation. In: Proceedings of the Fourth International Conference on Hybrid Intelligent Systems (HIS’04); 5-8 December 2004; Kitakyushu, Japan. IEEE. doi:10.1109/ICHIS.2004.82.
16 - Gallardo A, Taylor J, Paolini C, Lee HK, Lee GK. An ANFIS‐based multi‐sensor structure for a mobile robotic system. In: Proceeding of Computational Intelligence in Control and Automation; 11-15 April 2011; Paris, France. IEEE. doi:10.1109/CICA.2011.5945755.
17 - Li C, Ma H, Yang C, Fu M. Teleoperation of a virtual iCub robot under framework of parallel system via hand gesture recognition. In: Proceeding of International Conference on Fuzzy Systems (FUZZ‐IEEE); 6-11 July 2014; Beijing, China, pp. 1469-1474.
18 - Orazio TD, Leo M, Mazzeo PL, Spagnolo P. Soccer player activity recognition by a multivariate features integration. In: Proceeding of Seventh IEEE International Conference on Advanced Video and Signal Based Surveillance; 29 August 2010-1 September 2010; Boston, USA, pp. 32-39.
19 - Orghidan R, Gordan M, Danciu M, Vlaicu A. A prototype for the creation and interactive visualization of 3D human face models. Advanced Engineering Forum. 2013; 8-9:45-54. doi:10.4028/‐9.45.
20 - Navarro H, Orghidan R, Gordan M, Saavedra G, Martinez‐Corral M. Fuzzy integral imaging camera calibration for real scale 3D reconstructions. Journal of Dısplay Technology. 2014;10(7): 601-608. doi:0.1109/JDT.2014.2312236.
21 - Ozbilge EU. An approach of matlab about calibration of digital cameras [thesis]. Gebze Institute of Technology; 2010.
22 - Sugeno M, Kang G. Structure identification of fuzzy model. Fuzzy Sets and Systems. 1988;26(1):15-33. doi:10.1016/0165‐0114(88)90113‐3.
23 - Ross TJ. Fuzzy logic with engineering applications. Chichester: McGraw‐Hill; 1995, pp. 134-147. ISBN: 0‐07‐053917‐0.
24 - Hocaoğlu FO, Kurban M. Adaptif ağ tabanlı bulanık mantık çıkarım sistemi ile Eskisehir bolgesi icin güneşlenme süreleri tahmini. Elektrik‐Elektronik‐Bilgisayar Mühendisliği 11. Ulusal Kongresi ve Fuarı, 22-25 Eylul 2005; Istanbul, Turkiye.
25 - Mathworks. 2017. Retrieved 25 January 2017, from