####=========================================####
#### For CRAN time limitations most lines in the
#### examples are silenced with one '#' mark,
#### remove them and run the examples
####=========================================####
###########################################
### GiNA package ####
###########################################
# XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #
###########################################
### call library
library(GiNA)
### XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #
###########################################
### EXPLORE YOUR DATA FIRST TO DETERMINE THE 'minArea' AND 'cutoff' VALUES
### indicate folder where sample pictures are, i.e.
### folder <- "C:/Users/zalapalab/Desktop/examp"
### for demonstration purposes we will call a sample picture
### included in the package, run the following 4 lines
data(GINA.sample) # RUN
display(GINA.sample)
writeImage(GINA.sample, "gina_cran.JPG") # RUN
folder <- getwd() # RUN
### XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #
############################################
### check the best cutoff values for your pictures
?cutoff
cutoff(folder, cores=1) # RUN
### go to your working directory and analyze the segmentation
### results, you will agree with us than 0.5 is the best value
### for segmentation in the 'cutoff_vals' folder FOR THIS SAMPLE PICTURE
### XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #
############################################
### check the best minimum area (in pixels)
### to get rid of little trashes in the picture
### can be provided to the scanCRAN function if
### you don't like the default
?pixArea
#area <- pixArea(folder,cutoffvalue=0.5,cores=1) # RUN!!!
### XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #
###########################################
### RUN the scanCRAN function providing your
### cutoff and minimum area values found previously
?scanCRAN
#folder <- getwd()
#mydata <- scanCRAN(folder,cutoffvalue=0.5,cores=1, fact = 1) # RUN!!!
#str(mydata) # RUN!!!
### XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #
###########################################
### see colors of your fruits in each picture
#color.plot(mydata) # RUN!!!
#jet.scan(mydata, var=3) # RUN!!!
### XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX #
###########################################
Run the code above in your browser using DataLab