I have been coding a python 3 program which allows a user to easily take pictures with the raspberry pi camera. The program works up to the Camera_Capture method which takes the picture. When it is run I get this error:
if self.shutter_speed_settings_store == True:
AttributeError: 'Camera' object has no attribute shutter_speed_settings_store
the Camera_Capture method is:
def Camera_Capture(self):
if self.name_setting == 1:
self.picture_name = "".join((self.user_name, self.final_format))
if self.name_setting == 2:
self.picture_name = "".join((self.automatic_name, self.final_format))
if self.shutter_speed_settings_store == True:
camera.shutter_speed = self.final_shutter_speed
if self.white_balance_setting_store == True:
camera.white_balance = self.final_white_balance
if self.white_balance_setting_manual_store == True:
camera.awbgains = self.manual_white_balance
if self.iso_setting_store == True:
camera.iso = self.final_iso
if self.exposure_mode_settings_store == True:
camera.exposure_mode = self.final_exposure_mode
if self.metering_mode_settings_store == True:
camera.metering_mode = self.final_metering_mode_settings
camera = picamera.PiCamera()
camera.capture(self.picture_name)
print("Took the picture")
What is causing the attribute error?
If you need to see more of my code to provide a solution please leave a comment below
Camera
object (which contains yourCamera_Capture
method) doesn't have any attribute namedshutter_speed_settings_store
. Judging from the name of the other attributes, might you have meantshutter_speed_setting_store
? – Dave Jones Apr 11 at 14:16white_balance_setting_store
which I'm assuming is initially set in the same function). – Dave Jones Apr 11 at 17:37