patmo141 / odc_public

Addon for Blender meant to streamline dental CAD and design workflows
96 stars 43 forks source link

New question for Blender video #66

Open wangmyde opened 4 years ago

wangmyde commented 4 years ago

Hi, I followed your steps in your video, but I didn't get the expected result. https://www.youtube.com/watch?v=Edk9uA5Yl5k&feature=youtu.be

I am not sure whether my steps were correct because I can't see what you typed on your keyboard. I have some questions w.r.t. your operation:

  1. In your video from 8:23 to 8:25, which key did you press on the keyboard to step out the "registration image to object" process? I asked it because I typed 'ESC' on the keyboard to be out of the process. But it seems that the program can catch nothing after this operation.

  2. I would like to know the whole process of how to use your program. Please correct the process I describe below:

  3. Open the blend file you upload

  4. import image_object_registration module

  5. deactivate the 'test camera' (I'm not sure whether it is necessary to do this step. I watched from your video)

  6. run 'Run me!' script

    
    import sys

sys.path.append(r'I:\Blender_old\blender-2.78-windows64\2.78\scripts\modules\image_object_registration.py')

import image_object_registration image_object_registration.register()

4. call out the panel of "registration image to object"
5. select 6 pairs of points in images and 3D model
6. Here I DON'T KNOW what to input to be out of the selecting points process, but I pressed 'Esc' on keyboard.
6. active the 'test camera'  (I'm not sure whether it is necessary to do this step)
7. run the script 'Camera matrix test'

import bpy import image_object_registration as IOR C = bpy.context

these functions are useful!!

get_blender_camera_from_3x4_P

get_calibration_matrix_K_from_blender

get_3x4_RT_matrix_from_blender

get_3x4_P_matrix_from_blender

if C.object.type != 'CAMERA': print('not a camera')

else:

P, K, RT = IOR.get_3x4_P_matrix_from_blender(C.object)

print(P)

IOR.get_blender_camera_from_3x4_P(P, 1)

8. activate the 'CamFrom3x4PObj' camera
9. view through the 'CamFrom3x4PObj' camera, then I would have seen the aligned image of 3D model as same as the 2D image. But nothing changed.  Here is the images:
![捕获](https://user-images.githubusercontent.com/23552421/81239859-3add3300-9006-11ea-843d-fc0b9de831aa.PNG)

Could you let me know where I am wrong? I have taken one night to explore your program.  I would be really grateful if you could correct me. Thanks.
patmo141 commented 4 years ago

I am glad you were able to get the code running! The results I could get were never perfect. I actually made this video to ask for help from other programmers since my results were not what I wanted. I have not been able to advance beyond the results you have. With extremely careful placement of your 3d and image points it can be decent.

On Wed, May 6, 2020 at 7:58 PM My Wang notifications@github.com wrote:

Hi, I followed your steps in your video, but I didn't get the expected result. https://www.youtube.com/watch?v=Edk9uA5Yl5k&feature=youtu.be

I am not sure whether my steps were correct because I can't see what you typed on your keyboard. I have some questions w.r.t. your operation is:

1.

In your video from 8:23 to 8:25, which key did you type to step out the "registration image to object" process? I asked it because I typed 'ESC' on the keyboard to be out of the process. But it seems that the program can catch nothing with this operation. 2.

I would like to know the whole process of using your program. Please correct the process I describe below: 3.

Open the blend file you upload 4.

import image_object_registration module 5.

deactivate the 'test camera' (I'm not sure whether it is necessary to do this step) 6.

run 'Run me!' script

import sys

sys.path.append(r'I:\Blender_old\blender-2.78-windows64\2.78\scripts\modules\image_object_registration.py')

import image_object_registration

image_object_registration.register()

  1. call out the panel of "registration image to object"
  2. select 6 pairs of points in images and 3D model
  3. Here I DON'T KNOW what to input to be out of the selecting points process, but I press 'Esc' on keyboard.
  4. active the 'test camera' (I'm not sure whether it is necessary to do this step)
  5. run the script 'Camera matrix test'

import bpy

import image_object_registration as IOR

C = bpy.context

these functions are useful!!

get_blender_camera_from_3x4_P

get_calibration_matrix_K_from_blender

get_3x4_RT_matrix_from_blender

get_3x4_P_matrix_from_blender

if C.object.type != 'CAMERA':

print('not a camera')

else:

P, K, RT = IOR.get_3x4_P_matrix_from_blender(C.object)

print(P)

IOR.get_blender_camera_from_3x4_P(P, 1)
  1. activate the 'CamFrom3x4PObj' camera
  2. view through the 'CamFrom3x4PObj' camera, then I would have seen the align image of 3D model as same as the 2D image. But nothing changed. Here is the images: [image: 捕获] https://user-images.githubusercontent.com/23552421/81239859-3add3300-9006-11ea-843d-fc0b9de831aa.PNG

Could you let me know where I am wrong? I have taken one night to explore your program. I would be really grateful if you could correct me. Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/patmo141/odc_public/issues/66, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWIK33ETF3FV7LTMUPVWLLRQH2S7ANCNFSM4M23ZLDA .

patmo141 commented 4 years ago

Regarding between #5 and #6 in your question

5 run the operator from the spacebar menu and select 6 (or more) corresponding points

5a press "M" on the keyboard to generate the matrix

6 press "Enter" to confirm or "Esc" to get out of the points operator