
 the increased application of self - constructed labview - based chemical virtual instruments ( vis ) is due to their flexibility and ability to satisfy all the specific user requirements combined with the simplicity of the construction .
many configurations of labview - based vi have been reported until now corresponding to their specific chemical application defined by the user needs .
described a vi system based on labview 8.0 for ion analyzer which can measure and analyze ion concentrations in solution , comprising a high input impedance voltmeter ( widely used in measuring the em generated by ion selective electrode ) , a homemade conditioning circuit , data acquisition board , and a computer .
when applied to determine the reaction rate constant by px , it achieved live acquiring , real - time displaying , automatic processing of testing data , generating a report of results , and other functions .
this method simplifies the experimental operation , avoids complicated procedures of manual data processing and personal error , and improves veracity and repeatability of the experiment results .
wang et al .   reported a labview - based chemical virtual instrument ( vi ) for temperatures and pressures measurement . by selecting hardware modules , such as the pci - daq card or serial port method , and the software modules , different kinds of sensors
can be used for creating different chemical instruments allowing extremely flexible solutions for automatic measurements in the physical chemistry research .
developed a labview - based software for the automation of a sequential injection analysis instrument for the determination of morphine .
the detection is based on chemiluminescence reaction with acidic potassium permanganate in the presence of sodium polyphosphate .
the authors reported excellent analytical characteristics of the developed labview - based software system to be achieved : the precision of the determination was 0.7% measured by the relative standard deviation for five replicate measurements of morphine standard , and the limit of detection was determined to be as low as 5  10  m. bowie et al .   reported a flow - injection- ( fi- ) based instrument under labview control for iron monitoring in marine waters
the instrument incorporates a miniature , low - power photomultiplier tube ( pmt ) , and a number of electric and solenoid actuated microvalves and peristaltic pumps .
the software allows full control of all flow injection components and the processing of the data from pmt .
the optimized system is capable of 20 injections per hour , including preconcentration and wash steps .
the analytical characteristics of the developed labview - based system are reported to be as follows : a detection limit of 21  pm at linear range of 212000  pm with a 60-second sample load time and average precision between replicate fi peaks of 5.9  3.2% ( n = 4 ) over the linear range .
the flexibility of the vis allows their application practically in any branch of the chemical technology .
for example , the quality control of the conversion coating on aluminum alloys requires the determination of the pits number appearing on the 3  10 inches control specimens after their testing in saline chamber at extreme conditions : high temperature , high relative humidity , and high saline concentration , according to the standard astm b117 . according to this standard , the number of the appearing pits is the measure of the corrosion resistance of the protective coating .
the pits counting however actually made by simple specimen observation results in subjective errors due to the bad distinction of the pits from some  pits - like  simple stains and hence false results about the corrosion resistance of the conversion coatings . that is why a rapid and subjective error - free method for pits counting is necessary .
thus , the purpose of the present work is to develop such a vi and to test it on real specimens for express and objective pits counting . 

such a vi must determine the pit centers coordinates , pit areas , their traverse lengths , and the densities using blobs analysis resulting in a map file which can be used further by a svet system [ 57 ] to perform a rapid ( one pass )  true / false  check of the probable pit containing zones only , without scanning of the entire specimen .
a vi fulfilling all these requirements using a particle analysis based on blobs analysis   included in imaq libraries   for labview 2010 called localized corrosion image analyzer ( lcia ) was developed and described in the present paper .
its hardware and software are presented together with some application for pit recognition on real metal samples .
the specimen optical scan performed by a digital microscope connected to a pc yields a database file ( a map file ) containing the coordinates of all the surface defects similar to pits , not only the ones caused by corrosion .
image analysis performed by labview 2010 was applied for preliminary image recognition and distinction of the pits .
true / false  svet test application allowing the distinction of the true corroded ( pit containing ) zones from the  corroded - like  ones to be used further from a svet system for corrosion rate determination .
the true / false test is a rapid single linear svet scan over the centers of the probable zones in which coordinates are saved in the created by the vi lcia map file .
the simple linear svet scan will result in a specific and easy recognizable peaks contained curve in coordinates : current intensity / coordinate .
the scanning vibrating electrode technique ( svet ) which was developed for biological applications   was adapted later by isaacs [ 6 , 7 ] for corrosion studies of pitting , intergranular , and galvanic corrosion .
svet allows the determination of the current distribution above the metal surface measuring the potential gradient ( voltage drop ) proportional to the ionic current density e = ( i1  i2)r that appears between the two levels of the electrode vibration ( from 1 to 100  m ) above the studied surface .
svet is a further development of the scanning reference electrode technique ( sret ) [ 8 , 9 ] but provides higher sensitivity due to a.c .
signal measurement allowing obtaining a higher signal to noise ( s / n ) ratio due to the better noise suppression .
for example , the minimal voltage drops levels measurable by sret are about 200  v [ 10 , 11 ] , while 5  v can be achieved by svet [ 1214 ] .
the labview - based vi subject of the present paper employs the first main point of the approach developed by the authors based on the following two main points : computer vision application for video inspection by digital microscope of the surface of interest and database ( map file ) creation of the probable pits containing areas;rapid  true / false  test by single linear svet scan for real pits distinction followed by a map file actualization .
computer vision application for video inspection by digital microscope of the surface of interest and database ( map file ) creation of the probable pits containing areas ; rapid  true / false  test by single linear svet scan for real pits distinction followed by a map file actualization .
additionally , a complete svet scanning of the recognized real pits areas can be performed if the corrosion rate determination is necessary .
the vi performing the video inspection and the creation of the map file only is the subject of the present work , while the svet vi is the subject of another publication .
three main devices were involved in the system hardware configuration : a video inspection mighty scope near infrared 10x200x , 1.3  mp , 1/4 cmos color , 6 led light type operating at 850  nm , usb 2.0 interfaced digital microscope with a homemade lineal stage focus controlling mechanism in the range from 8.5  mm to 112  mm , with stepper motor npm pf35 - 24c1 , a homemade svet device with x - y stages , stepper motors vexta model px245  m-01a , and a personal computer dell optiplex 7010 core i7 cpu @ 3.40  ghz , windows 8 pro operating system as illustrated in figure 1 .
the optical inspection by a digital microscope allows the capturing of full images from 4  mm to 1700  mm ( optical zoom in the range from 10x to 200x ) , respectively , of the studied surface with a resolution of 1600 to 1200 effective pixels at shot speed user controllable from 1 to 1/1000  sec . the focus adjusting mechanism ( y stage , figure 1 )
was driven by a stepper motor controlled by the lcia which controls also the real time image capturing and its transfer through the usb interface .
the white balance was carried out automatically employing the integrated 6 white led light ring around the lenses .  
the homemade svet device   which uses the map file produced by the vi subject of the present work consists of a vibrating electrode with edge diameter of approximately 1  m , 100  mv p - p , and frequency of the vibration of 60  hz at amplitude of the displacement adjustable in the range between 1 and 100  m over the specimen surface .
the vibrating electrode was mounted on x - y linear stages mechanism providing 5  m / step resolution .
the svet electrode x - y displacement and vibration were controlled by a separate vi instrument running its own software and communicating with the lcia , using the map file containing the pits coordinates previously obtained with the lcia .
the svet analog signal was amplified by a controlled gain high input impedance instrumentation preamplifier ( 10  ohm/100 fa ) , and after its digitalizing by national instruments , model usb 6009 data acquisition system ( daq ) digital signal was transferred to the pc through the usb port and processed by its vi lock - in amplifier labview tool .  
the lcia focuses , captures the image of the specimen surface , and analyzes it creating a database file in real time containing the exact coordinates , area , and transverse length of probable pits .
this file is employed by a svet system with its own control software , performing the true / false test to distinguish the true pits coordinates . in  true 
case , a complete svet scan of the probable area can be performed and the corrosion rate be determined , if preliminary chosen by the operator in the interface screen . in  false 
case , the svet electrode goes to the next probable area up to the last using optimized trajectory . in both cases , after the true / false test performance , an updating of the already existing database file takes place .
the flow diagram of vi lcia system shown in figure 2 is divided in two main subvirtual instruments : image digitizing sub - vi and image analyzing sub - vi , both executed to get the complete pits location information .
the image digitizing sub - vi creates the sample 's digital image by making a preview , focusing , image capturing , histogram display , and focus verification entirely synchronized in real time with the image analyzing sub - vi .
stacked sequence 1  structure where the image digitizing sub - vi is executed for frame 0 of stacked sequence 1 and the image analysis sub - vi is executed for frame 1 of stacked sequence 1 ( see figure 2 ) .
the image digitizing sub - vi is located in frame 0 of the stacked sequence 2 inside the stacked sequence 1 shown in figure 3 , where the functions : focus and image preview , are performed simultaneously within a  while loop execution control .
 the focus has two nested  case  structures . when the main  case  structure is true , the focus starts by the execution of  focus section 
sub - vi through a  case true substructure  ; this process calls up the node for writing via usb to control the driver of stepper motor mounted on the focus mechanism ; it focuses by using a  for  cycle and a structure type stacked sequence ( programming shown on figure 3 ) .
when the main case structure is false , however , it calls up through the usb port the writing node which indicates the motor driver to de - energize the motor , and by this way , the focusing process stops .
the previously mentioned procedure sets the forward or backward sequence to control the execution time , the speed of the focus mechanism stepper motor , and the focus termination through the control driver .
the image preview is made by using the labview ni imaqdx libraries , tools that allow the reading of camera or microscope through a usb port .
this job is performed within an  event  structure ( see figure 3 ) and allows simultaneous real - time image observation and focusing .
the image preview is taken by the application of the labview ni imaqdx tool   allowing automatic detection and camera(s ) selection by the user via the usb port .
this sub - vi is implemented outside the  while loop  and inside the  event  structure shown in figure 3 .
once the  capture  button , located on the sub - vi front panel is pressed , the frame 0 of stack sequence 2 terminates , and the frame 2 starts automatically , capturing the image and saving it in * .jpg format file ( the programming is shown in figure 4 ) . after saving
the generated file the sub - vi  content  generates the corresponding histogram for the image capturing .  
figure 5 shows the user graphic interface ( the front panel of vi lcia for the image digitizing ) , where the corroded surface image already captured is displayed together with the corresponding histogram . according to the histogram
values the user decides to keep the image for further analysis or to delete it and run the process again . in the image analysis applied by vi lcia to metal samples for pitting corrosion determination , described on this document , the blob analysis of imaq library from labview 2010  
this technique involves several vision operations and analytical procedures , which detect within the image any 2d object which could be a potential pit located on the studied corroded metal surface .
the image processing generates blobs and then works with them to calculate the area and perimeter of the pit , and the number of the generated blobs is an important characteristic for pits distinguishing .
blob ( binary large object ) is a group of interconnected pixels that have the same logic state and the same light intensity .
the basic structure of an image recognition vi by the application of blob analysis in imaq labview consists of image acquisition , histogram calculation , thresholding , and blob 's filtering and analysis .
the image recognition vi for pitting corrosion application has all these components as well as the morphology and particle labeling to improve the shape and definition of pits under investigation .
the programming diagram of the image analysis sub - vi is shown in figure 6 . by means of the icons imaq
create and imaq read file the precaptured images are acquired into the sub - vi for digitizing .
after that , the color threshold process is performed to turn the image into binary format in the first section .
once the threshold process is done , the desired morphology of pitting is predefined by imaq morphology , and then a filtering process is performed by imaq particle filter which can be used to clean up the image deleting the nondesired particles defined as noise .
the pitting spots in the already clean image are labeled and highlighted in different colors , by imaq label , so they can be easily distinguished . finally , the pitting spots which are pixels are counted to be converted in real metric units by imaq particle analysis , and saved together with the lcia generated parameters as : pit location , area , and transverse length . once the blob analysis is performed , the system proceeds to convert pixels to metric units for all the parameters determined by the blob analysis ( program process shown in figure 5 ) .
the conversion to square millimeters of the area is performed by the subarray from array subset area ; the conversion to millimeters of the length is performed by the subarray from array subset length , and finally the location by coordinates in the subarrays ( x , y ) performed by array subset for coordinate x and coordinate y , respectively .
the system vi lcia was applied for image recognition in localized corrosion studies of aluminum alloys aa6061-t3 specimens determining the number , density , and coordinates of probable pits areas together with their dimensions .
then , the created database file was employed for real - time scanning of the affected by the corrosion areas only employing svet improving thus the scanning time more than ten times compared with the time for complete svet scan of the entire surface . in figure 7(a ) left is shown the microscope image of a carbon steel uns g10180 sample obtained with vi lcia application . there , one of the pits is highlighted with a circle as an example , and in the right part of the same figure its identification by vi lcia is shown determining its area to be 0.041  mm and its transversal length to be 1.76  0.94  mm as displayed in the graphic interface of the image analysis sub - vi .
these values fit very well with those obtained by the svet device and the amf microscope application .
the total time for the svet scan of the 25  25  mm specimen with the lcia application was found to be about 4% only of the total time required for complete svet scan of the same specimen achieving an acceleration of about 25 times .
a virtual instrumentation system called vi lcia based on labview 2010 was developed allowing rapid determination of the pits number on large metal specimens .
the vi lcia controls synchronously the focus adjustment and the image taking by a digital microscope and the image analysis , resulting in detection and the mapping of the probable pits containing zones on the corroded metal specimen with their traverse length and density using blobs analysis .
the created map is further used by a homemade svet vi system with its own labview 2010 software to control a rapid performing ( one pass scan )  true / false  check of the probable pits containing zones and also is able to perform a complete svet scan of the already recognized  true  zones to determine the corrosion rate .
 a virtual instrumentation ( vi ) system called vi localized corrosion image analyzer ( lcia ) based on labview 2010 was developed allowing rapid automatic and subjective error - free determination of the pits number on large sized corroded specimens . 
 the vi lcia controls synchronously the digital microscope image taking and its analysis , finally resulting in a map file containing the coordinates of the detected probable pits containing zones on the investigated specimen . 
 the pits area , traverse length , and density are also determined by the vi using binary large objects ( blobs ) analysis . 
 the resulting map file can be used further by a scanning vibrating electrode technique ( svet ) system for rapid ( one pass )  true / false  svet check of the probable zones only passing through the pit 's centers avoiding thus the entire specimen scan . a complete svet scan over the already proved  
 true  
 zones could determine the corrosion rate in any of the zones . 
1. Introduction
2. System's Hardware Configuration
3. Programming
4. Applications
5. Conclusions