Introduction

Deep-fat frying is a unit operation which is performed by immersing the food material in hot (generally between 150 and 200 °C) edible oil until it is cooked (Farkas et al. 1996). During the frying process, heat is transferred from the hot oil to the surface of the food material, while moisture is transferred from the interior to the surface. As a result, high temperature and low moisture conditions are developed as frying proceeds and cause the desirable characteristics (Yıldız et al. 2007).

Snack foods play very important roles in the diet of the modern consumer. They are designed to be less perishable, more durable and more appealing than natural foods. Different types of snack foods are available in which the new generation snacks fall into several categories such as low fat, baked but not fried, high fiber products made from rice/ wheat bran and coated snacks, etc (Mazumder et al. 2007).

Snack foods extrusion consists of subjecting selected grains to a variety of complex physical processes to yield snacks with various shapes and textures (White 1994). Direct expanded snacks, coextruded snacks and indirect expanded ones are three types of extruded snacks. Indirect expanded products said as ‘third-generation snacks’ and ‘half-products’ are not expanded directly through the die. The additional processes which contribute to the appearance or texture include frying or hot-air puffing to remove moisture and achieve the final texture. Pellets and fabricated chips are two sub-categories of these products (Bawa and Sidhu 2003).

Computer vision systems are very popular choices for delivering fast, reliable and robust food classification; since the grading of foodstuffs by human graders has essential weaknesses of subjectivity, inconsistency and unreliability (Du and Sun 2004, 2006; Jackman and Sun 2011a, b, c; Jackman et al. 2008; Sun 2008). The application of computer vision technology has been highly successful in food classification and quality prediction in the past and it has continued this success in recent times (Jackman and Sun 2013).

Among the different classes of physical properties of foods and foodstuffs, color and texture are considered the most important attributes in the perception of product quality. Color is an important visual characteristic of food, and it also affects consumer preference and purchase decisions. Moreover, color correlates well with other physical, chemical and sensory quality indicators in food (Esteve et al. 2005; Tiwari et al. 2008). In fact, color plays a major role in assessment of internal quality in food industry (Cornforth 1994; Segnini et al. 1999; Abdullah et al. 2001; Mancini and Hunt 2005; Alcicek and Balaban 2012). The aspect and color of the food surface are the first quality parameter evaluated by consumers and are critical in the acceptance of the product, even before entering in the mouth. The color appearance is dependent on the amount and distribution of brown regions developed during frying as well as the remnant oil absorbed on the surface after frying, which produces oily areas with transparent appearance (Marquez and Anon 1986; Mackay et al. 1990).

Consumers tend to associate color with flavor, safety, storage time, nutrition and level of satisfaction due to the fact that it correlates with physical, chemical and sensorial evaluations of food quality. Conditions in immersion frying lead to high heat transfer rates, rapid cooking, browning, texture and flavor development (Pedreschi et al. 2006). The consumer trends are moving toward healthier foods and low fat products however the consumption of snack foods is increasing in developed and developing countries. The appearance of brown spots and the development of taste are related to the chemical composition. The non-enzymatic browning reaction is a complex chemical reaction that produces brown pigments with a condensation of various derivatives during a food processing or storage (Hodge 1953). Brown pigment formation is desirable during some types of food processing (baking, cocoa and coffee roasting, or cooking of meat), while it is undesirable for other technologies (milk drying, thermal treatments for the stabilization of milk, fruit juices, and tomatoes) (Fernandez-Artigas et al. 1999; Martins et al. 2001). Reducing sugars and free amino compounds are involved in the non-enzymatic browning reactions, known as the Maillard reaction. The Maillard reaction depends on the reducing sugars and proteins, temperature and frying time (Marquez and Anon 1986; Mackay et al. 1990).

The meaning of the term texture in image processing is completely different from the usual meaning of texture in foods. Image texture can be defined as the spatial organization of intensity variations in an image at various wavelengths, such as the visible and infrared portions of the spectrum (Haralick et al. 1973). Image texture is an important aspect of images and textural features play major role in image analysis (Li et al. 1999). These features provide summary information defined from intensity maps of the scene which may be related to visual characteristics (coarseness of the texture, regularity, presence of a privileged direction, etc.), and also to characteristics that cannot be visually differentiated (Basset et al. 2000). Fractals are crinkly objects that defy conventional measures, such as length and area, and are most often characterized by their fractional dimension. During some processes, such as drying and frying, physical properties of foods change primarily due to the loss of moisture from the interior regions to the surfaces and surrounding air. Fractal analysis has been used to study surface and morphology of food materials after processing. Development of fractal theory as well as image analysis has allowed the description the inherent heterogeneity of food materials (Theiler 1990). Fractal dimension of a two-dimensional profile theoretically ranges from 1 to 2. Fractal value close to 1 indicates that the border of the analyzed object has smooth boundaries, and a value close to 2 indicates a high degree of tortuosity or roughness (Barletta and Barbosa 1993).

Many researchers have been studying the physical properties of foods such as color appearance, browning and oily areas on the surface, image texture and others by image analysis techniques, such as Marquez et al for fried potatoes (1986); Gerrard et al. for Beef (1996); Rodriguez-Saona and Wrolstad for chips (1997); Leemans et al. for apples (1998); Li et al. for beef (1999); Marique et al. for fried potato (2003); Pedreschi et al. (2006) and Mendoza et al (2007) for potato chips; Du and Sun (2008) for pizza; Pallottino et al., for hazelnut (2010); Arzate-Vazquez et al. (2011) for avocado; Girolami for meat (2013); Rodraguez-Pulido for Cabbages, oranges, apples, seeds from grapes and tomatoes (2013). However, there is no recorded data concerning image analysis of pellet snacks. Therefore, the objectives of this study were: (i) to evaluate the potential of L*a*b* intensities, (ii) image texture information (correlation, entropy, contrast, homogeneity and fractal dimension) to characterize quality of pellet snacks at three temperatures (150, 170, and 190 °C) and five different frying times (0.5, 1.5, 2.5, 3.5 and 4.5 min).

Materials and methods

Materials

Pellet snacks (Alvand processing Co. Behzad Persian food industrial group, Tehran, Iran) in green color and vegetable frying oil (Bahar, Behshahr Industrial Co., Behshahr, Iran) were bought from local markets. Snack products contained wheat flour, emulsifier, salt and food-grade colors. The approximate composition of wheat flour was 12.68 % moisture, 1.24 % fat, 0.6 % ash, 10.50 % protein and 74.43 % carbohydrates. Average length, width and thickness of snacks were 26.47, 7.75 and 7.52 mm, respectively. For snacks to be prepared, mixed materials were extruded using a single screw cooking extruder. The extrudates were dried at an air temperature of about 70 °C for 15 min in a tray drier. The samples were placed in sealed polyethylene bags at 4–5 °C for 12 h to equilibrate moisture.

Frying conditions

The pellet snacks were placed in a removable mesh basket and fried with sunflower oil in an automatic fryer (Crown Co., XB5356 model, China). Three different temperatures (150, 170 and 190 °C) and five different frying times (0.5, 1.5, 2.5, 3.5 and 4.5 min) were used. Frying temperature was kept almost constant (±1 °C). The oil was preheated for 0.5 h prior to frying and discarded after 1 h of use. After frying, samples were allowed to drain for 10 min so that excessive oil could drain off and then were analyzed by the computer vision.

Image analysis

The pellet snacks samples were scanned with a flatbed scanner, HP Scan jet G4010, Hewlett Pakard Co., CA, USA. All images were scanned at the same conditions. Segmentation of the image from the background is critical first step in processing snack images. Background was removed from the image using the Photoshop software cs2, version 9. Thus, the true images of the snacks were separated from the background. All snacks images in their different times and temperatures were processed and segmented using the same procedure. After segmentation of the images, the color data was converted to L*a*b* as using ImagJ software version 1.40 g.

Fractal analysis

To measure the fractal dimension of pellet snack background interface lines, images were analyzed using ImagJ software version 1.40 g. Red-green-blue (RGB) chromatic space images of pellet snacks were gray-scaled and transformed into binary images. The pellet snack background interface lines (edge lines) were found using automatic thresholding based on an isoda algorithm (Ridler and Calvard 1978) combined with an edge detection approach according to the Laplacian-of-Gaussian (LoG) filter (Castleman 1996) based on the following equation:

$$ LoG\left(x,y\right)=-\frac{1}{\pi {\sigma_G}^4}\left[1-\frac{x^2+{y}^2}{2{\sigma_G}^2}\right]{e}^{-\frac{x^2+{y}^2}{2{\sigma}_{G^2}}} $$
(1)

Where x and y are coordinates of each pixel and σG is a Gaussian standard deviation. Fractal dimension of pellet snack-background interface lines was calculated by means of a box counting method (BCM) which is one of the most widely used techniques in the literature (Alamilla-Beltrán et al. 2005; Campos-Mendiola et al. 2006; Salvador et al. 2009). The BCM method consists of carrying out a progressive process by placing a grid of decreasing size over an image and counting the number of boxes that contain some parts of an interface line (Nr), for each grid size (r). The box sizes of 2, 3, 4, 6, 8, 12, 16, 32, and 64 pixels were chosen and fractal dimension was calculated as:

$$ {D}_f={ \lim}_{\to 0}\frac{ \log \left({N}_r\right)}{ \log \left(\raisebox{1ex}{$1$}\!\left/ \!\raisebox{-1ex}{$r$}\right.\right)} $$
(2)

It is noteworthy that, based on classical Euclidian geometry, a point has a zero dimension, a straight line one, plane two and cube three. However, according to fractal geometry an irregular line has a fractal dimension between 1 and 2 regarding its complexity.

To measure the color and fractal dimension of snacks-background interface lines, images were analyzed using ImagJ software version 1.40 g.

Image texture analysis

Image texture was analyzed studying the spatial dependence of pixel values represented by a co-ocurrence matrix Pd, θ with entry Pd, θ(i, j) being the relative frequency or distance for two pixels d-pixels apart in direction θ to have values i and j, respectively. For a given directional orientation and distance of the patterns, 14 textural features can be extracted from a grayscale image using this matrix (Haralick et al. 1973). Since the texture of pellet snacks images can reflect characteristics such as color, size and arrangement of brown spots or defects it may be directly or indirectly related to the quality categories and consumers’ preferences. Four textural features: correlation, entropy, contrast and homogeneity were extracted from the segmented images at RGB, R, G, B, U, V, H and S channels (correlations 3–6) and were analyzed using the texture average of four directions, θ = 0, 45, 90, 135° and distance 1 and 2. They are computed by correlations 7–10.

$$ U channel=\left[886 Red-587 Green-299 Blue\right]/1772 $$
(3)
$$ V channel=\left[701 Blue-114 Red-587 Green\right]/1402 $$
(4)
$$ H\; channel=\left[ Color\; Phase or hue= Phase\left(V+ iU\right)\right] $$
(5)
$$ S channel=\left[ Color Saturation= Magnitude\left(V+ iU\right)\right] $$
(6)
$$ Contrast={\displaystyle \sum_i{\displaystyle \sum_j{\left(i-j\right)}^2.\Big({P}_{d\theta}\left(i,j\right)}} $$
(7)
$$ Entropy=-{\displaystyle \sum_i{\displaystyle \sum_j{P}_{d\theta}\left(i,j\right). \log \left({P}_{d\theta}\left(i,j\right)\right)}} $$
(8)
$$ Correlation=\frac{{\displaystyle \sum_{i=1}^{N_x}{\displaystyle \sum_{j=1}^{N_y} ijp\left(i,j\right)-{\mu}_x{\mu}_y}}}{p_x{p}_y} $$
(9)
$$ Homogeneity={\displaystyle \sum_i{\displaystyle \sum_j\frac{P_{d\theta}\left(i,j\right)}{1+{\left(i-j\right)}^2}}} $$
(10)

where μx, μy and px and py are the mean and standard deviations, respectively, of the sums of rows and columns in the matrix.

Entropy measures disorder or randomness of the image and it is an indication of the ‘complexity’ of the image with regards to the spatial location of grey levels in the image; thus more complex images have higher entropy values. Contrast is a measure of the local variations present in the image, so higher contrast values indicate large local variations. Contrast is 0 for a constant image. Homogeneity (also called an inverse difference moment) is inversely proportional to contrast at constant energy. The higher value of this feature indicates that the intensity varies less in an image. It is high when the pixels are very similar. Similarly at constant, homogeneity is inversely proportional to energy. Correlation is a measure of linear dependency of intensity values in an image. For an image with large areas of similar intensities, correlation is much higher than for an image with noisier, uncorrelated intensities (Park et al. 2002). Image texture was analyzed using MaZda software version 4.6 (Szczypiński et al. 2009).

Statistical analysis

Analysis of variance (ANOVA) by Minitab software (version 13, Minitab Inc., State College, PA) was used to determine significant differences (P ≤ 0.05) among pellet snacks with frying times and temperatures. Partial Least Square (PLS) was also applied to explore relationships between image texture properties and color parameters. Minitab statistical software (Minitab Release 16, Minitab Inc., USA) was used for PLS analysis in the present research.

Results and discussion

Effect of frying temperature and time on color measurements

In Table 1 the L*a*b* color values were measured on the pellet snacks at each frying temperature (0, 150, 170, and 190 °C) and time (0.5, 1.5, 2.5, 3.5 and 4.5 min). The increase of the frying temperature increased b* values and decreased a* values (P > 0.05). The L* values were increased up to 170 °C; however, they were decreased from 170 °C to 190 °C (P ≤ 0.05).

Table 1 Effect of frying temperature and time on color parameters of pellet snacks

Increasing the frying time up to 1.5 min led to enhancement of L* value, however this value decreased when frying time was higher than 1.5 min. It was probably due to decrease in color intensity with puffing of sample during frying as well as influence of higher temperatures and times on burning of snacks. It can be found that a* values were increased significantly (P ≤ 0.05) by increasing the frying time. The b* values increased up to 2.5 min, then decreased. The L*, a* and b* were in the range of 51.77–64.93, −2.60–(−8.67) and 15.62–22.92, respectively. The changes of L*, a* and b* values by frying time and temperature were significant (P ≤ 0.05). Table 2 shows the pellet snacks images at different frying temperatures and times. It can be seen that time and temperature of frying can affect the color of pellet snacks.

Table 2 The pellet snacks images at different frying temperatures and times

Senthil et al. (2002) studied the quality of fried snacks based on blends of wheat flour and soya flour. Color values expressed as L*, a*, b* showed that development of color during deep fat frying of snacks was not markedly affected by the levels of soya flour.

Effect of frying temperature and time on fractal dimension

Effect of frying temperature and time on fractal dimensions of pellet snacks is given in Fig. 1. The results showed that enhancing the frying temperature increased the fractal dimensions (Fig. 1). This increase might be due to increasing in volume and puffing of samples with temperature. The fractal dimensions of pellet snacks increased when the frying time enhanced from 0.5 min to 2.5 min (Fig. 1). It seems that the highest volume of pellet snacks was in 2.5 min. Increasing frying time from 2.5 min to 4.5 min could not expand the samples higher than 2.5 min and the fractal dimensions decreased. This decrease might be due to increased rigidity in surface, increase in oil surface absorption and decrease in irregularity of surface. The fractal dimensions of pellet snacks were in the range of 1.096–1.187. Table 2 shows that time and temperature of frying can affect fractal dimension of pellet snacks. Kerdpiboon et al. (2006) used fractal dimension to study and quantify structural changes in dried carrots and potato cubes. Fractal dimension proved to be a generalized structure-quality index of foods undergoing drying. Fathi et al. (2011) found that shrinkage and fractal dimension of dried kiwifruit increased as the drying time and temperature increased.

Fig. 1
figure 1

Effect of frying temperature and time on fractal dimension of pellet snacks (○ 150 °C, □ 170 °C and ∆ 190 °C)

Effect of frying temperature and time on texture parameters

The U channel had the most importance in identifying pellet snacks at different frying temperatures and times. Figures 2, 3, 4 and 5 show the effect of frying temperature and time on texture parameters of pellet snacks for U channel. Effect of frying temperature and time on contrast of pellet snacks are given in Fig. 2. The results showed that frying time increased the contrast significantly (P < 0.05). Increase in frying temperature up to 170 °C decreased contrast of image; however this parameter increased when frying temperature was 190 °C (Fig. 2). The highest and lowest values for contrast were observed for pellets deep-fat fried at 190 °C for 3.5 min and 170 °C for 0.5 min, respectively.

Fig. 2
figure 2

Effect of frying temperature and time on contrast of pellet snacks (○ 150 °C, □ 170 °C and ∆ 190 °C)

Fig. 3
figure 3

Effect of frying temperature and time on entropy of pellet snacks (○ 150 °C, □ 170 °C and ∆ 190 °C)

Fig. 4
figure 4

Effect of frying temperature and time correlation of pellet snacks (○ 150 °C, □ 170 °C and ∆ 190 °C)

Fig. 5
figure 5

Effect of frying temperature and time on homogeneity of pellet snacks (○ 150 °C, □ 170 °C and ∆ 190 °C)

The entropy of the snacks images increased significantly (P < 0.05) with increasing the time of frying (Fig. 3). It can be said that increasing the time of frying increased complexity within images. A complex image produces a high entropy value. Changes in entropy value for pellet snacks in different frying temperatures are plotted in Fig. 3. Similar to contrast results, the entropy of pellet snacks decreased significantly (P < 0.05) with increasing the temperature from 150 °C to 170 °C, whereas it increased significantly (P < 0.05) when the temperature elevated to 190 °C. The lowest entropy was found in pellets fried at 170 °C for 0.5 min, while samples processed at 190 °C for 4.5 had the highest entropy.

As shown in Fig. 4, correlation value of snacks was reduced slightly with increasing the temperature from 150 °C to 170 °C and raised when the temperature increased to 190 °C (P < 0.05). The results showed that frying time increased the correlation of pellet snacks slightly (P < 0.05) (Fig. 4). The samples fried at 190 °C for 4.5 min and 170 °C for 0.5 min gained the highest and lowest correlation value, respectively.

As shown in Fig. 5, increase in frying time decreased the homogeneity of samples (P < 0.05). The results indicated that increasing in homogeneity value occurred when the frying temperature is augmented from 150 °C to 170 °C and it was decreased when the temperature was increased to 190 °C (Fig. 5). Pellets deep-fat fried at 190 °C for 3.5 min gained the lowest homogeneity value. In contrast, products processed at 170 °C for 0.5 min had the most homogeneity. Mendoza et al. (2007) used the image texture information (energy, entropy, contrast and homogeneity) from L*a*b*, HSV and gray scale intensities to characterize and classify quality of commercial potato chips and to model the quality preferences of a group of consumers. Textural features had potential to model consumer behavior in the respect of visual preferences of potato chips. A regression model was able to explain the preferences variability when classified into acceptable and non-acceptable chips.

Correlation between image texture properties and color parameters of pellet snacks

Figure 6 shows the relations between image texture properties and color parameters of pellet snacks. The PLS analysis showed a positive relation between L*, homogeneity and fractal dimensions (Fig. 6). These properties were negatively correlated with contrast and entropy. A positive relation has also been showed between contrast and entropy. There were negative correlations with L* and other textural characteristics and a positive relation with a* and b* as well. This figure also indicated that fractal dimension has the most changes with frying time and temperature. The first two PLS components (PLS1 and PLS2) accounted for 100 % of the total variation in the image textural properties and color parameters of pellet snacks. The first and second PLS were represented 44 % and 66 % of the variation, respectively.

Fig. 6
figure 6

Partial Least Square regression (PLS) of image texture properties and color parameters for fried pellet snacks

Conclusions

An imaging-based technique was developed to evaluate the color and texture properties of pellet snacks at different conditions of frying. The color and texture parameters studied included L٭, a٭, b٭, fractal dimension, correlation, entropy, contrast and homogeneity. Results of this study showed that the image texture features contain better information than the average color features to objectively distinguish different quality of pellet snacks. Enhancing frying temperature increased the fractal dimensions. The highest volume of pellet snacks was at 2.5 min. Increase in frying times decreased the homogeneity and increased the contrast, entropy and correlation. It seems that samples fried at 150 °C for 0.5 min and 190 °C for 0.5 min have the lowest and the highest quality, respectively. The results showed a strong potential for measuring color parameters and textural characteristics of fried pellet snacks using non-destructive image-based indices. Moreover, the PLS results showed a clear relationship between image texture properties and color parameters. This finding may have practical importance in attempts to predict eating quality (acceptability) from image measurements. Therefore, the objective of this study, which was the use of low cost and less time consuming equipment to develop an accurate and desirable analytical method of food quality monitoring, was met. Image processing can be used to investigate the effect of frying on the volume, dimensions, amount of puffing, density, appearance, color and texture of snacks bulks in the packaging. The image processing system provides a simple, rapid and convenient way to detect color and texture information on food surfaces, and it can be mounted on a conveyor to monitor product quality without breaking or interrupting processing.