Hello ,
I have a Cam M7.
I’m trying to develop a program that can create a picture which is the average of 4 other pictures .
The Idea I had is to take 5 pictures, and modify the fifth one in order to get the average ( by adding pixels)
The program is as follows :
Untitled - By: marc - mer. avr. 18 2018
import sensor, image, time, pyb
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(2000)
clock = time.clock()
L = 320
l = 240
img1 = sensor.snapshot()
img2 = sensor.snapshot()
img3 = sensor.snapshot()
img4 = sensor.snapshot()
img_average = sensor.snapshot()
for i in range(L*l):
img_average = ( ( img1 + img2 + img3 + img4 ) // 4 )
img1.save(“/Image1”)
img2.save(“/Image2”)
img3.save(“/Image3”)
img4.save(“/Image4”)
img_average.save(“/Image_Average”)
But I noticed that it is not possible to declare 5 Image objects by using sensor.snapshot : It’s like I have one image object instead of 5.
Is there any other way to do that ?
Best regards