# Social Distance in Interactions between Children with Autism and Robots
## 2 Methodology  
This study aims to explore the tendencies of social distance when autistic children interact with robots and to verify the accuracy of a skin-color-detection program by automatically detecting the social distance in the interaction. There are numerous pixel-based skin-color-detection techniques, and one was modified and used for this study [38]. In the skin-color-detection program, when the background is close to skin color, it is detected as \"the skin color\" and the error is large. It is hypothesized that the error can be reduced by specifying the range of skin-color-detection and extracting it for processing. Here, we consider the accuracy of distance measurement with Program B and measure the difference between this and Program A by processing the skin-color detection that specifies and extracts the range. From this, we examine if there is a difference in the distance between the robot and the participant depending on the extent of the autism traits. The distances between the robot and the children were estimated from video footage. The software (called ESD version 2.0) was programmed based on Python language and used OpenCV, particularly the cvtColor function, to create a mask for extracting the skin color of children. The images were read as BGR and converted to HSV. As for inRange function, the mask tracks the target object and extracts the HSV values, and the output is saved in the csv form. We attempted another method (ESD version 1.0) that calculated the area of the target color over the image but found errors because of the similar shades in the environment (e.g., wall, tables). ESD version 2.0 created a frame to track the face and calculated the target colored area inside the frame. The program that estimated the distance ran on Python and OpenCV, using the cvtColor function for masking to extract only the specified color from the image input from the camera. BGR is a color index based on blue, green, and red components. The image captured in this format was converted into an HSV model image in which the hue (color), saturation (vividness), and brightness were separated. The inRange function masks H (hue) from 0 to 20, S (saturation) from 10 to 140, and V (brightness) from 60 to 210 acted as thresholds close to the skin color. The area of the extracted skin color part is stored as a score in a variable prepared for each frame. After the program ended, the score in the variable was output in a csv file format that can be used by a spreadsheet software and then analyzed. We modified the program and named it Program B. The basic skin-color-detection component was the same as in Program A, but the range for skin-color detection was specified by the upper left of the image as a reference, and the specified range was extracted and detected. In addition, to reduce measurement errors caused by the background of the laboratory room, a low-pass filter was applied to the image to smooth the image before the skin-color detection. Figure 2 shows the flowchart of the distance measurement in Programs A and B. Distance estimation was performed using video or images from the camera. The video was read as an image for each frame, and the images were grayscaled. Facial recognition was performed by the cascade judgment device. Further, the same image was converted into an HSV model, and only colors close to skin color were masked. Next, the number of pixels recognized as skin color by mask processing, in the part estimated to be the location of the face, was recorded. This was performed frame by frame to estimate the distance. For distance estimation from pixels, the number of pixels of the skin color of the face-recognized component of the participant, at about 0.5 m, 1 m, and 1.5 m before the experiment, were recorded. The quadratic function was then approximated from the recorded three points, and the distance was estimated from the approximate expression. Next, the distance was measured, using the video footage.