1
$\begingroup$

I'm moving the camera around an object all with python script. Now I want to get the image from the camera and work with it (some image processing) and then save it..Etc

Now I'm just rendering the view like so:

for po in positions:  
    scene.frame_set(number_of_frame)
    cam_ob.location = po
    cam_ob.keyframe_insert(data_path="location", index=-1)
    bpy.data.scenes["Scene"].render.filepath = '/home/shot_%d.jpg'%number_of_frame
    number_of_frame += 1

Anyone has done that before? I just want to get the image as a variable (matrix or array) to process it.

$\endgroup$
  • 1
    $\begingroup$ I'm working on it: blender.stackexchange.com/questions/128174/… $\endgroup$ – bluejayke Jan 10 '19 at 4:19
  • $\begingroup$ @user2016831 oh great I'll follow your post, please keep us updated Thanks $\endgroup$ – Ja_cpp Jan 10 '19 at 15:36
  • $\begingroup$ Hi, cool, yeah I've been looking for people to help out but almost no one is even seeing the post.. I almost got it working, though. In fact, the code posted in the question in the link at EDIT 4 actually does exactly this, if you keep the WIDTH and HEIGHT at 512 and 256, you can try it out (although you have to install PIL and for the numpy array thing to go faster you'd have to make a custom blender build for now), so the only problem is getting a better resolution.. you're able to use a scale_x variable in the calc_camera_matrix function then change the width and height, but it... $\endgroup$ – bluejayke Jan 10 '19 at 21:55
  • $\begingroup$ ...just pixelates it instead of actually getting a bigger image, like what the render function does.... SO there might be something to change in the source code, if we work together maybe we can figure it out (although seemingly there should just be a python way to do this), $\endgroup$ – bluejayke Jan 10 '19 at 21:57
  • $\begingroup$ check this out for starers, its where I based the basics of my code off: docs.blender.org/api/blender2.8/… $\endgroup$ – bluejayke Jan 10 '19 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.