Announcements

Announcement: We’re aware of an issue affecting starting a new topic from category pages and creating new blog posts. New topics can still be started directly from the relevant board. Learn more here.

Size of the pixel in world units.

Size of the pixel in world units.

Anonymous
Not applicable
5,373 Views
15 Replies
Message 1 of 16

Size of the pixel in world units.

Anonymous
Not applicable

hi there,

I am new to the forum so forgive me if I am posting my question in the wrong place.

 

I wanted to know how to change/what is the size of the pixel in world units of the images acquired from a free camera or physical camera in 3d max 2019. These parameters are important when working on 'Camera Calibration'  subject, particularly the intrinsic matrix as explained in the link below:

 https://uk.mathworks.com/help/vision/ug/camera-calibration.html

. I tried to look for that info and always get posts about pixel dimension which is basically the size of an image in pixels and not the size (width and height) of the pixel itself

 

0 Likes
Accepted solutions (2)
5,374 Views
15 Replies
Replies (15)
Message 2 of 16

brentscannell
Autodesk
Autodesk

Hi @Anonymous

 

That's a very interesting subject, and I won't even pretend to be a subject matter expert on the topic but I do have a question for you: does Camera Calibration by pixel actually apply to virtual or artificial environments? I'd have to imagine that the "pixel" is something constructed purely to visualize the virtual object in "real" world scale, and that there is no pixel size built into the virtual object. 

Message 3 of 16

Anonymous
Not applicable

@brentscannell 

I just posted the camera calibration topic in case someone wanted to know why would I look into this 'pixel size' problem specifically. Let me borrow the definition from Mathworks: estimates the parameters of a lens and image sensor of an image or video camera. You can use these parameters to correct for lens distortion, measure the size of an object in world units, or determine the location of the camera in the scene. These tasks are used in applications such as machine vision to detect and measure objects. They are also used in robotics, for navigation systems, and 3-D scene reconstruction'. In my case, I am looking into locating the pixel in the image of a certain scenery that belongs to a 3d point in the scenery. For example, how could we find the pixel(s) that represent the door of a house in the image of the house taken by a camera on let's say 2 meters from the house?

0 Likes
Message 4 of 16

brentscannell
Autodesk
Autodesk

In that sense, couldn't you find those parameters by setting a fixed final render size in pixels, and use the prior knowledge of the actual size of the objects based on scene examination/model definition?

Message 5 of 16

Anonymous
Not applicable

unfortunately no, I couldn't because it's not that simple.

here is a sample image from  https://www.cc.gatech.edu/classes/AY2016/cs4476_fall/results/proj3/html/agartia3/index.html 

what I am interested in are Fy and Fx, if I wanted to go around it, I must be able to know the exact pixel position (u,v) in the image that belongs to a certain point (X, Y, Z) which is extremely difficult or impossible .

hope now you have a clear idea about the problem 

 

ProjectionMatrix.jpgProjectionMatrix.jpg

0 Likes
Message 6 of 16

hagen.deloss
Autodesk
Autodesk

Hi @Anonymous

 

I wanted to bring the conversation back to this original thread, it looks like you posted in a few threads about contacting someone who can answer this question. This thread is your best bet at getting an answer to this question.

 

At least personally, I do not have that advanced of understanding of the mathematical calculations that go into the pixel dimensions of a 3D Render.

 

I am planning on sending out a few emails hoping that the developers behind 3DS Max can offer some further insight; but I can guess they will be curious on what you plan on doing with this information? Is this for a research paper? 

 

Thanks for your patience while we work towards answering this rather complex question 😄

 

 



Hagen Deloss
Community Manager | Media & Entertainment
Installation & Licensing forums | Contact product support | Autodesk AREA


 

0 Likes
Message 7 of 16

Anonymous
Not applicable

@hagen.deloss thanks for your reply, I really appreciate it and hope you get the answer soon.

I am a Ph.D. student and that problem is an obstacle that I am facing in my research ( haven't thought about it to hold me back this way ). please let me know if that wasn't sufficient enough as an answer to your question and I will be more than happy to elaborate.

in 3d max, there are different types of cameras, with different sensors to choose from. working on the camera projection required some information regarding the physical dimensions of the sensor (width and height) as well as the pixel size in order to get the correct math.  I use MAXScript where you have access to the width and height of the chosen sensor but not the pixel size (width and height). I Tried to go around the problem by applying the basics of sensors and image relationship but there was another problem which is the size of the sensor output image which is not available. for example, there is one sensor named APS-C (Canon) but in the market, there are many cameras who have the same sensor but with different image resolution. please have a look at the following link and under the category Physical camera rollout to check for the sensors types and sizes:

https://help.autodesk.com/view/3DSMAX/2017/ENU/?guid=__files_GUID_14D75437_7ED8_46D9_9A74_2C495A7BAF....

 

also please have a look at the  following link to see the relationship between the sensor and pixel size:

https://www.ephotozine.com/article/complete-guide-to-image-sensor-pixel-size-29652#Full-frame.

 

basically, assume you have a sensor with 20mm*15 mm size and the resolution of the image is 4000*3000 pixels. pixel width will 20mm/4000 = 5 micrometre. pixel length will be = 15mm/3000 = 5 micrometer. for my case, I know the sensor size from MAXSript help but don't know the image resolution or the pixel size.

 

I hope I didn't confuse you but that info is passed on to someone in the software developing team will, hopefully, make sense.

 

thanks again

 

0 Likes
Message 8 of 16

Swordslayer
Advisor
Advisor

@Anonymous wrote:

I must be able to know the exact pixel position (u,v) in the image that belongs to a certain point (X, Y, Z) which is extremely difficult or impossible .


How so? Depending on the exact use-case, there're built-in functions for world-viewport mapping (gw.transPoint) and there's also an example in help How To ... Develop a Vertex Renderer.

Message 9 of 16

Anonymous
Not applicable

thanks, @Swordslayer for your reply. I went through the example, However, if I should use the camera matrix ( which has the pixel size two parameters) I still need the coordinate of the camera as part of the equation. in the example, you suggested there is no camera and so no coordinate. Another problem is, identifying a certain point (xyz) in order to find its corresponding pixel wasn't easy with the help of the script's function.

0 Likes
Message 10 of 16

Swordslayer
Advisor
Advisor

@Anonymous wrote:

thanks, @Swordslayer for your reply. I went through the example, However, if I should use the camera matrix ( which has the pixel size two parameters) I still need the coordinate of the camera as part of the equation. in the example, you suggested there is no camera and so no coordinate. Another problem is, identifying a certain point (xyz) in order to find its corresponding pixel wasn't easy with the help of the script's function.


What do you mean, I never suggested that (the underlined part). Each time you get viewport transfromation matrix or camera transformation matrix, it comes with that. Identifying certain world point to find its corresponding pixel will be always hard because you'd need all the info on how the renderer works, what type of antialising was used, whether you want to trace refractions/reflections and so on. If that was your original goal, don't bother with algebra and render a 32bit zdepth pass instead to get the depth info. 

0 Likes
Message 11 of 16

Anonymous
Not applicable

@Swordslayer I am sorry if I didn't understand your point, that is because I am not experienced enough in 3d Max. Things you suggested in your last reply was quite complicated for me to handle. My understanding is using the camera to capture an image of scenery (3d max model) is a perfect simulation of using a real-life camera to capture an image for same but real-life scenery (assuming all dimensions and coordination are the same). please correct me if I am wrong. Thanks for your patience 

 

 

0 Likes
Message 12 of 16

Swordslayer
Advisor
Advisor

@Anonymous wrote:

@Swordslayer I am sorry if I didn't understand your point, that is because I am not experienced enough in 3d Max. Things you suggested in your last reply was quite complicated for me to handle. My understanding is using the camera to capture an image of scenery (3d max model) is a perfect simulation of using a real-life camera to capture an image for same but real-life scenery (assuming all dimensions and coordination are the same). please correct me if I am wrong. Thanks for your patience 


Perfect? No, but good enough for a given purpose (also depending on the choice of a renderer, there are renderers that follow laws of optics, that are completely different from our everyday renderer that will go with useful approximations instead because a perfect simulation is not the point). But if you're determined, you can simulate a lot of that, together with lens flaws and distortions, too. Again, depends on what you're after in the end. But ultimately, when you render stuff, you have lots of of extra info that the renderer can give you (like the zdepth - just remember to check the notes on antialiasing and zdepth) and it makes sense to use that.

0 Likes
Message 13 of 16

hagen.deloss
Autodesk
Autodesk

@Anonymous

 

I would say sticking with the default Scanline and physical camera would be best to start with to test things out, here is the main article for Cameras in 3DS Max on the Autodesk Knowledge Network.

 

I would say either taking this question to the lighting and rendering channel on the 3DS Max forums, or looking into the Autodesk Developer Network for further answers is your best bet for further information on this topic 😄

 

Please select the Accept as Solution button if a post solves your issue or answers your question.

 

 

 



Hagen Deloss
Community Manager | Media & Entertainment
Installation & Licensing forums | Contact product support | Autodesk AREA


 

0 Likes
Message 14 of 16

Anonymous
Not applicable

@hagen.deloss thanks for your reply I really appreciate it. I have tried to follow your advice by going to ADN but got lost because there were so many blogs and forums and some I don't have access to . would please recommend me a specific forum in the ADN.

 

 

0 Likes
Message 15 of 16

hagen.deloss
Autodesk
Autodesk
Accepted solution

Hi @Anonymous

 

I wanted to post back here and add to what @Swordslayer suggested, which is a 32bit zdepth render pass. What render engine are you using currently?

 

I found a post on the forums here that walks through how to use the Arnold render engine to get the zdepth from a render, hoping it may prove helpful.

 

You would first need to add an AOV, here is a more in depth article from Solidangle explaining how to set up a Z Depth AOV.

 

The more mathematical side of the problem you are trying to solve is outside the scope of support, but I'm hoping this tool will provide you some further insight into how you can answer the issue yourself 😄

 

Thanks for your patience!

 

 



Hagen Deloss
Community Manager | Media & Entertainment
Installation & Licensing forums | Contact product support | Autodesk AREA


 

0 Likes
Message 16 of 16

Anonymous
Not applicable
Accepted solution

Hi all,

 

I wanted to let you know that I have solved the problem after a great help from Chaos Group because they were the developer of the camera plugins for 3ds Max.

The sensor length is derived from the used aspect ratio. assume we have 900*600 px image with 36 mm width sensor then the length is 24 (i.e. 36mm width with an aspect ratio of 3:2 = 24mm). pixel width or length then is calculated from 

sensor width or length( normally in micrometers) / image width or length.

0 Likes