"MiMaMori Alert" is automatic security camera for your home. Automatic learning without teacher images, and notify if something is visitor. You're not at home, but you can see your visitors and thieves.
IntroductionWorry about home while on the go! Have you experienced this?
- For example, on an absent day, someone was pushing the intercom!
- Or a thief has come into your house!!
- Or the "Nameko" was stolen by my family!!!
In such a case, if there is MiMaMori Alert, it will be solved. MiMaMori Alert is an automatic security camera. If network settings are required, you need only install the camera. No teacher image is required.
If there is any suspicious movement in front of the camera, the camera will automatically take a picture and notify you. MiMaMori Alert is very compact. And is very low cost.
HardwareMiMaMori Alert is two configration.
・M5StickV + M5StickC
・M5UnitV + M5StickC
M5StickV and M5UnitV include Kendryte K210. The Kendryte K210 is a very powerful device. Compute neural networks.M5StickC is a portable network device. This can be connected with Internet.
M5StickV/UnitV and M5StickC are connected by Grove. Communication is by UART.Communication is performed using a proprietary protocol. Send data in 10-bit units.
AlgorithmThe algorithm is as follows.
①First, feature vectors are calculated using Mobilnet's neural network. Mobilnet has created a V1 weight of 0.5 with Keras and NNcase. NNCASE is a Kendryte tool.
task = kpu.load(0x200000)
fmap = kpu.forward(task, img)
new_data = np.array(fmap[:])
②The feature vector obtained by the neural network is filtered in the time series direction, and a weighted average is obtained. Vector operation uses Numpy
#Feature Vector Update
def update(capture,new_data,weight):
new_data= new_data*weight+capture*(1.0-weight)
return new_data
new_data=update(capture,new_data,cap_weight)
③The distance between the average vector and the feature vector at the current time is calculated. This is equivalent to finding motion. The distance is large if moving, and small if static.
#Feature Vector Compare
def get_dis(new_data,master_data):
dist = np.sum((new_data-master_data)*(new_data-master_data))
return dist
dist=get_dis(new_data,master_data)
④Detects rising edge of waveform and sends data by UART. The rising edge is compared with the previous data in time series
if dist > dist_thresh:
if dist_old <= dist_thresh:
img_buf = img.copy()
img_buf.compress(quality=70)
img_size1 = (img_buf.size()& 0xFF0000)>>16
img_size2 = (img_buf.size()& 0x00FF00)>>8
img_size3 = (img_buf.size()& 0x0000FF)>>0
data_packet = bytearray([0xFF,0xF1,0xF2,0xA1,img_size1,img_size2,img_size3,0x00,0x00,0x00])
uart_Port.write(data_packet)
uart_Port.write(img_buf)
time.sleep(1.0)
print("image send,data_packet")
⑤M5StickC sends images and messages to LINE by notification from UART. M5StickC is developed with ArduinoIDE.
This application can detect dynamic ones. Installation is also very easy. Only just keep in front of things. Various applications are possible.
Here is defence technique for Japanese traditional food "nameko". "MiMaMori Alert" is set behind the nameko. If a nameko is taken, notify your LINE, soon.
Demo instructionThis source code requires the MixPy option configration Numpy. Custom binaries is stored within Github. And, Neural networks require a MobileNetV1 with a weight of 0.5. This Kmodel file is also stored in Github. Write to M5StickV / UnitV with Kflash GUI Tools.
PuddingAlert-V
https://m5stack.hackster.io/anoken2017/puddingalert-v-34c560
Cheering Watch of M5StickC&V
https://m5stack.hackster.io/anoken2017/cheering-watch-of-m5stickc-v-34f0cc
Comments