Help to write importing cameras from Meshlab

Hello
I have a MLP scene https://yadi.sk/d/gRlhr5DZuAJtL
the code of meshlabProj.mlp loks like this

<!DOCTYPE MeshLabDocument>
<MeshLabProject>
<RasterGroup>
<MLRaster label="IMG_5681_fix.jpg">
<VCGCamera TranslationVector="4.25294 0.265655 0.754086 1" LensDistortion="-9.82373e-09 1.18087e-15" ViewportPx="1731 2598" PixelSizeMm="0.00881954 0.00881954" CenterPx="865.5 1299" FocalMm="29.3232" RotationMatrix="0.897992 0.140022 0.417139 0 -0.138469 0.989778 -0.0341543 0 -0.417657 -0.0270904 0.908201 0 0 0 0 1"/>
<Plane semantic="rgb" fileName="IMG_5681_fix.jpg"/>
</MLRaster>
<MLRaster label="IMG_5682_fix.jpg">
<VCGCamera TranslationVector="-0 -0 -0 1" LensDistortion="-9.82373e-09 1.18087e-15" ViewportPx="1731 2598" PixelSizeMm="0.00881954 0.00881954" CenterPx="865.5 1299" FocalMm="29.3232" RotationMatrix="1 0 0 0 0 1 1.22465e-16 0 0 -1.22465e-16 1 0 0 0 0 1"/>
<Plane semantic="rgb" fileName="IMG_5682_fix.jpg"/>
</MLRaster>
<MLRaster label="IMG_5683_fix.jpg">
<VCGCamera TranslationVector="-3.70261 0.220891 0.383875 1" LensDistortion="-9.82373e-09 1.18087e-15" ViewportPx="1731 2598" PixelSizeMm="0.00881954 0.00881954" CenterPx="865.5 1299" FocalMm="29.3232" RotationMatrix="0.916485 -0.115365 -0.383074 0 0.117311 0.992925 -0.0183656 0 0.382482 -0.0281067 0.923535 0 0 0 0 1"/>
<Plane semantic="rgb" fileName="IMG_5683_fix.jpg"/>
</MLRaster>
</RasterGroup>
</MeshLabProject>

I understand, that this is coords and vectors of 3 cameras in scene.
I need only cameras with names as of it images (IMG_*.jpg)
Now i start to research same importers, for example
http://koelzk.crispy-cow.de/file_download/18/import_bundler.py

ps: i already have this scene with fake cameras https://yadi.sk/d/CJSGWQ3GuAKor

Hello, Jacques Lucke.
Can you help me to create one step forward, please
You write to me how i can release matrix values in my script

myMatrix = Matrix([(a11, a12, a13, a14), (a21, a22, a23, a24), (a31, a32, 33, a34), (a41, a42, a43, a44)])

This is what i have now

import bpy


scene = bpy.context.scene


# Create new camera datablock
camera_data = bpy.data.cameras.new(name="IMG_5681_fix.jpg_data")


# Create new object with our camera datablock
camera_object = bpy.data.objects.new(name="IMG_5683_fix.jpg", object_data=camera_data)


# Link camera object to the scene so it'll appear in this scene
scene.objects.link(camera_object)


# Place camera to a specified location
camera_object.location = (-4.25294, -0.265655, -0.754086)


# Place camera to a specified rotation
#myMatrix = Matrix([(a11, a12, a13, a14), (a21, a22, a23, a24), (a31, a32, 33, a34), (a41, a42, a43, a44)])
#RotationMatrix="0.897992 0.140022 0.417139 0 -0.138469 0.989778 -0.0341543 0 -0.417657 -0.0270904 0.908201 0 0 0 0 1"

This script based on example from https://www.blender.org/api/blender_python_api_2_77_0/bpy.types.Object.html?highlight=object.matrix_world
This script create single camera with setted name and location
Help me add rotation from last line’s values? Please

Have you tried asking at Stack Exchange? There are many motivated responders there.


# ##### BEGIN GPL LICENSE BLOCK #####
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####


bl_info = {
    "name": "Save Cams",
    "author": "Couzar Michel",
    "description": "Store camera positions",
    "version": (0, 0, 1),
    "blender": (2, 7, 6),
    "location": "View3D > Properties > Save Cams",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": "Camera"}


import bpy


def apply_cam_settings(context):


    cam = context.scene.save_cam_collection[obj.save_cam]


def display_toggle_callback(self, context):
    apply_cam_settings(context)


class property_collection_save_cam(bpy.types.PropertyGroup):
    cindex = bpy.props.IntProperty(name='Index')
    name = bpy.props.StringProperty(name="Cam name", default="Cam"),
    camLocs = bpy.props.FloatVectorProperty(name = "Cam Location")
    camRots = bpy.props.FloatVectorProperty(name="Cam Rotation")
    bpy.types.Scene.save_cam_collection_index = bpy.props.IntProperty(
        name = "Cam Scene Index",
        description = "***",
        default = 0,
        min = 0,
        )


class cam_collection_UL(bpy.types.UIList):
    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):


        cam = item
        layout.prop(cam, "name", text="", icon_value=icon, emboss=False)
        icon_cam = 'CAMERA_DATA'


class VIEW3D_cam_panel(bpy.types.Panel):
    bl_label = "Stored Cams"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"
    bl_category = "Cams"
    bl_context = "objectmode"


    @classmethod
    def poll(cls, context):
        return context.active_object is not None and context.active_object.type == "CAMERA"


    def draw(self, context):
        layout = self.layout


        row = layout.row()
        col = row.column()
        col.template_list("cam_collection_UL", "", context.scene, "save_cam_collection", context.scene, "save_cam_collection_index")


        col = row.column()
        sub = col.column(align=True)
        sub.operator("add_cam_from_collection.btn", icon='ZOOMIN', text="")
        sub.operator("reassign_cam_from_collection.btn", icon="FILE_REFRESH", text='')
        sub.operator("remove_cam_from_collection.btn", icon='ZOOMOUT', text="")
        sub = col.column(align=True)
        sub.operator("assign_cam.btn", icon="CAMERA_DATA", text='')


class cam_add(bpy.types.Operator):
    bl_idname = "add_cam_from_collection.btn"
    bl_label = "Add"
    bl_description = "Add cam"


    def execute(self, context):
        cam = context.active_object
        item = context.scene.save_cam_collection.add()
        item.name = "Cam"+str(len(context.scene.save_cam_collection))
        item.camLocs = cam.location
        item.camRots = cam.rotation_euler
        context.scene.save_cam_collection_index = len(context.scene.save_cam_collection)-1
        return{'FINISHED'}


class cam_remove(bpy.types.Operator):
    bl_idname = "remove_cam_from_collection.btn"
    bl_label = "Remove"
    bl_description = "Remove cam"


    def execute(self, context):
        index = context.scene.save_cam_collection_index
        context.scene.save_cam_collection.remove(index)
        for cam in context.scene.save_cam_collection:
            if cam.cindex > index:
                cam.cindex = cam.cindex - 1
        return{'FINISHED'}


class cam_assign(bpy.types.Operator):
    bl_idname = "assign_cam.btn"
    bl_label = "Assign"
    bl_description = "Assign cam"


    def execute(self, context):
        cam = context.active_object
        item = context.scene.save_cam_collection[context.scene.save_cam_collection_index]
        cam.location = item.camLocs
        cam.rotation_euler = item.camRots
        return{'FINISHED'}


class cam_reassign(bpy.types.Operator):
    bl_idname = "reassign_cam_from_collection.btn"
    bl_label = "Reassign"
    bl_description = "Reassign selected cam"


    def execute(self, context):
        cam = context.active_object
        item = context.scene.save_cam_collection[context.scene.save_cam_collection_index]
        item.camLocs = cam.location
        item.camRots = cam.rotation_euler
        return{'FINISHED'}


def register():
    bpy.utils.register_module(__name__)
    bpy.types.Scene.save_cam_collection = \
        bpy.props.CollectionProperty(type=property_collection_save_cam)


def unregister():
    bpy.utils.unregister_module(__name__)
    del bpy.types.Scene.save_cam_collection


if __name__ == "__main__":
    register()

Follow this code brothermechanic


RotationMatrix="0.897992 0.140022 0.417139 0 -0.138469 0.989778 -0.0341543 0 -0.417657 -0.0270904 0.908201 0 0 0 0 1"
myMRot = RotationMatrix.split()
#Quaternion((1.0, 0.0, 0.0, 0.0))

#Look here :http://stackoverflow.com/questions/4870393/rotating-coordinate-system-via-a-quaternion

myMRot = [myMRot[0,4], myMRot[4,8], myMRot[8,12], myMRot[12,-1]]
camera_object.rotation_quaternion = myMRot