1 Introduction

As γ-rays penetrate the PN junction of a complementary metal–oxide–semiconductor (CMOS), electrons are produced [1, 2]. This makes a CMOS sensor serve as a γ-ray detector. With a simple camera in a cell phone, or video camera, experiments were carried out to study the possibility of using a common CMOS to measure the dose rate of γ-ray sources [3,4,5]. And it is interesting that a smartphone camera can be used to detect γ-rays [5, 6], making a smartphone an easy and portable γ-detector. Also, because of their large numbers, smartphones are considered as the ground detector array for ultra-high energy cosmic rays, despite their small size and low detection efficiency [6]. A smartphone application with a simple and fast algorithm designed by Wei et al. is developed to extract radiation events from video stream captured by the built-in camera. It can be performed in real time without requiring covering the camera lens [7]. Wang et al. [3, 4] also focused on image analysis via the neural networks, without modifying data processing of the cameras.

On recording γ-rays, the frame number of image is usually fixed. However, in many cases, a change in the frame number makes a better measurement of radiation. In this paper, OV7670 CAMERACHIP™ is used as the CMOS image sensor, which provides full-frame, sub-sampled or windowed 8-bit images in a wide range of formats, and is controlled through the Serial Camera Control Bus (SCCB) interface. The parameter settings, such as the frame number per second, image size, formatting and output data transfer, are realized by the writing program with the ARM microcontroller, for which the design functions are conducted to deal with the image data from the OV7670 CAMERACHIP™ firsthand. The image is shown on an LCD display for the online monitor. The gray value method proposed by Wang et al. [3] is used to treat the γ-ray dose.

2 Experimental setup

2.1 Hardware circuit

The detection system is shown schematically in Fig. 1. The OV7670 CAMERACHIP™ (Omnivision Technologies) is used as image sensor, with an image sensor array of 656 × 488 pixels, of which 640 × 480 pixels are active (307,200 pixels). Its functional device is composed of the analog signal processor, A/D converters, digital signal processor, image scalar, timing generator and digital video port. The STM32F103 is used as main control ship. Its main function service consists of the analog-to-digital converter (ADC), digital-to-analog converter (DAC), general-purpose timers (TIM), secure digital input/output interface (SDIO), debug support and universal synchronous asynchronous receiver transmitter (USART). The STM32F103 receives the data from the OV7670 CAMERACHIP™ and analyzes them by designing self-defined functions. The image data are sent to the LCD display instantly. During the measurement, an aluminum foil blocks visible lights to the CAMERACHIP™, to make it in dark. The aluminum foil also prevents α-particles and electrons emitted by the radioactive source [3]. The CAMERACHIP™ can conveniently be controlled by the STM32f103 to set suitable storage frame rate.

Fig. 1
figure 1

Schematic diagram of the system

2.2 Control of storage frame rate

Each byte of data storage has 8 bits (Fig. 2). The output signal of two bytes is transferred as RGB565, hence two bytes for a pixel. The first 5 bits of the high byte are denoted by R, the remaining 3 bits of the high byte and the first 3 bits of the low byte are denoted by G, and the remaining 5 bits of the low byte are denoted by B [8]. The image data output of OV7670 is controlled by the pixel clock (PCLK), vertical (VSYNC) and horizontal synchronization signals (HREF/HSYNC). The output sequence is shown in Fig. 2. Each PCLK sends a byte datum when the HREF is at the high level (Fig. 2). The frame can be adjusted by PCLK, VSYNC and HREF/HSYNC. In this work, the frequency of PCLK and HREF is used to adjust the frame rate of the output data.

Fig. 2
figure 2

Waveform of the output sequence

2.3 Data analysis methods

The STM32F103 provides the driving signal and controls the parameters for the CMOS sensor, compiles the program to find the congruent relationship between the pixel (or the cumulative pixel) and the cumulative γ-ray dose, realized by the designed functions, and sends the image data to the display screen. There are two methods to analyze the image data from the CMOS sensor. Method 1 is to search the maximum pixel and its coordinates in the images and to establish the correlation between the maximum pixel and the γ-ray dose. An ARM microcontroller controls the specific approach by changing the frequency of PCLK in OV7670 of the CMOS sensor, to set the frame rate (four or five frames per second) and to compare the pixel color value for the maximum color value and its coordinates. Then, the correlation between the γ-ray dose and the maximum value is constructed. The maximum color value and its coordinates are displayed below the image.

Method 2 is to acquire the correlation between the γ-ray dose and the accumulated pixel value, based on gray value of the figure. The gray value denotes brightness of an image, or degree of color shades [3]. The gray value method has been adopted in various image-processing applications for satellite images, aerial photographs, geophysical observations, etc. [9]. If the color values of a certain pixel in an original image are (Red, Green, Blue), the gray value is calculated by G = (30 Red +59 Green +11 Blue)/100 [10]. This analysis is controlled by the ARM microcontroller, with the PCLK frequency being four or five frames per second. The gray value of pixel is converted from color value. There are two maximum gray values, one with radiation and the other without radiation. A function for the two maximum gray values is calculated to obtain the threshold. The pixel of gray value being larger than or equal to the threshold is accumulated to acquire the correlation between the γ-ray dose and the gray value in radiation source of different doses. On the basis of the correlation, the dose of unknown γ-rays can be determined with the accumulated gray value obtained from the detector.

3 Results and discussion

The 152Eu (895.4 kBq calibrated on January 01, 2014) and 60Co (37.63 kBq calibrated on January 01, 2014), both from Shanghai Institute of Applied Physics, Chinese Academy of Sciences, are adopted to test the system. While 60Co emits 1.17 and 1.33 MeV γ-rays [11], 152Eu, as an important radionuclide for energy and efficiency calibration of γ-spectrometers, has a complex decay scheme emitting over 140 γ-rays ranging from 122 to 1408 keV [12].

The original image obtained from the 60Co source is shown in Fig. 3a, in which the bright spots and black background can be clearly distinguished. The insert in the top-right corner is magnified bright spots. The background is due to the electronic noise or other interference noise. The pixel value of background will be too large if the bright spots are not obviously shown for low-energy γ-rays. It is necessary to filter the noise in this case.

Fig. 3
figure 3

(Color online) The original images of 60Co (a) and 152Eu (c) and images of 60Co (b) and 152Eu (d) without background

An intervenient threshold value is to find between gray values of the background and a bright spot by statistical analysis. In order to get clearer spot of radiation, pixels of gray value being less than the threshold are filtered out. The image of 60Co without background is shown in Fig. 3b. The image data of 152Eu are shown in Fig. 3c and d. In Fig. 4, the images with and without background are compared in three-dimensional diagrams.

Fig. 4
figure 4

Three-dimensional diagrams for images with (a) and without (b) background

One γ-photon usually hits some adjacent pixels at the instant of imaging. Cross talks always happen between the adjacent pixels in the CMOS sensor [13]. By filtering out the background, Method 2 is adopted to analyze image data. For an image of the 60Co source, pixels in the dimensions of 3 × 3, 5 × 5 and 7 × 7 around the center of the maximum gray are summed. The histograms of color value and the gray value summation of the three windows are shown in Fig. 5. The counts of the max gray value and the summed gray value distribute a few peaks, being obvious in Fig. 5d. In theory, the distribution of peaks should correspond to 1.17 and 1.33 MeV, but due to poor efficiency of the CMOS sensor, the γ-ray counts are not enough to discriminate the two γ-rays. However, in the summation for the 7 × 7 pixels, the different peaks appear, indicating that the CMOS sensor can be used to detect 60Co γ-rays.

Fig. 5
figure 5

The gray values for bright spot obtained by CMOS sensor from the 60Co source. a The maximum values of the spot multiplied by 0.01; bd gray value summation multiplied by 0.01 for pixels of different sizes around the maximum spot

4 Conclusion

CMOS sensor and ARM microcontroller are used to detect γ-rays from 60Co or 152Eu source. STM32F103 is adopted as the main control platform to achieve real-time online analysis of the radiation image collected by OV7670 CAMERACHIP™. The data are sent to the LCD at desired frame rate. Due to the low activity of the γ-ray sources and the small perceptual area of the CMOS sensor, the detector has a low efficiency of collection, but the results indicate that the CMOS sensor can be used to discriminate the 60Co γ-rays.