Creato con Colab

This commit is contained in:
Christian
2025-03-20 16:46:32 +01:00
parent e453a8f4a2
commit 263808780d
+10 -8
View File
@@ -686,7 +686,8 @@
" return blurred"
],
"metadata": {
"id": "PoTzLauTQlHl"
"id": "PoTzLauTQlHl",
"cellView": "form"
},
"execution_count": null,
"outputs": []
@@ -745,7 +746,7 @@
"if test:\n",
" url = 'https://raw.githubusercontent.com/chri002/ComfyUI_depthMapOperation/refs/heads/main/assets/start.jpg'\n",
" image = Image.open(requests.get(url, stream=True).raw)\n",
" image = image.resize((int(image.size[0]/1.5), int(image.size[1]/1.5)))\n",
" image = image.resize((int(image.size[0]), int(image.size[1])))\n",
" print(image.size)\n",
"else:\n",
" image=initt.convert(\"RGB\")\n",
@@ -784,7 +785,8 @@
"points = transform_points(points, translate=(0, 0, 0), rotate=(0, 0, 0), scale=(1,1,0.5))"
],
"metadata": {
"id": "gEjBciYYldPF"
"id": "gEjBciYYldPF",
"cellView": "form"
},
"execution_count": null,
"outputs": []
@@ -794,7 +796,7 @@
"source": [
"#@title Local Rotation\n",
"rx=0#@param {\"type\" : \"number\"}\n",
"ry=-35#@param {\"type\" : \"number\"}\n",
"ry=0#@param {\"type\" : \"number\"}\n",
"rz=0#@param {\"type\" : \"number\"}\n",
"\n",
"mx, Mx, my, My, mz, Mz = points[:,0].min(), points[:,0].max(), points[:,1].min(), points[:,1].max(), points[:,2].min(), points[:,2].max()\n",
@@ -819,7 +821,7 @@
"#@title Translation\n",
"tx=0#@param {\"type\" : \"number\"}\n",
"ty=0#@param {\"type\" : \"number\"}\n",
"tz=200#@param {\"type\" : \"number\"}\n",
"tz=0#@param {\"type\" : \"number\"}\n",
"\n",
"points = transform_points(points, translate=(tx, ty, tz), rotate=(0, 0, 0), scale=(1,1,1))"
],
@@ -836,7 +838,7 @@
"#@title Scale\n",
"sx=1#@param {\"type\" : \"number\"}\n",
"sy=1#@param {\"type\" : \"number\"}\n",
"sz=0.75#@param {\"type\" : \"number\"}\n",
"sz=1#@param {\"type\" : \"number\"}\n",
"\n",
"points = transform_points(points, translate=(0,0,0), rotate=(0, 0, 0), scale=(sx,sy,sz))"
],
@@ -851,7 +853,7 @@
"cell_type": "code",
"source": [
"#@title Points interpolation\n",
"interpolate = 2 #@param {\"type\":\"number\"}\n",
"interpolate = 3 #@param {\"type\":\"number\"}\n",
"points = (interpolate_points(points, alpha=0.5, n_c=interpolate))"
],
"metadata": {
@@ -877,7 +879,7 @@
"scale = np.array([1,1,-1])\n",
"fov=45 #@param {\"type\" : \"number\"}\n",
"correction = True #@param{\"type\":\"boolean\"}\n",
"k_size =3 #@param{\"type\" : \"number\"}\n",
"k_size =2 #@param{\"type\" : \"number\"}\n",
"points_cop = transform_points(points.copy(), translate=translation, scale=scale)\n",
"translation = np.array([0,0, -(height/m.sin(m.radians(fov)))])\n",
"points_cop = transform_points(points_cop, translate=translation)\n",