mrthorncherry / Night-py

python code for my night vision goggles
13 stars 3 forks source link

camera image effect #1

Open euriahmoore4 opened 2 years ago

euriahmoore4 commented 2 years ago

everything in the code is good except for line 24 when it brings up the error where it says there are no attributes for image effect. it would be great if you told me how to fix it thanks, Eli

Vivalaetnies commented 2 years ago

everything in the code is good except for line 24 when it brings up the error where it says there are no attributes for image effect. it would be great if you told me how to fix it

thanks, Eli

I've got the same problem...

TechnologyRunner commented 1 year ago

I put this code into Chatgpt and the is what it said problem image effect is just the tip of the iceberg I see several issues with the script:

The variable 'clp' is not used in the script. The assignment mmal.MMAL_PARAM_IMAGEFX_COLOURPOINT = 0 is modifying a constant and it is not allowed. camera.image_effect = clp is not used, it should be camera.control.params[mmal.MMAL_PARAMETER_COLOUR_EFFECT].value = clp to set the color effect. The variable 'count' is defined but never used. p.dest_rect = mmal.MMAL_RECT_T(0,35,400,480) should be used before the assignment to render_l.inputs[0].params[mmal.MMAL_PARAMETER_DISPLAYREGION] instead of after. input_state=GPIO.input(3) is not used and can be removed pause() is not defined and it should be GPIO.cleanup() to release the resources used by the script. The script doesn't set the resolution of the camera. Additionally, in the while loop, the script is toggling the camera settings and the display properties on each press of the button, but it should only toggle between the two different camera settings on each press.