I’m currently working on an online experiment in PsychoPy, and I’ve added a credit card calibration at the beginning of the task to ensure consistent stimulus sizes across participants with different screens and resolutions.
In the calibration step, participants adjust an on-screen image of a credit card to match their real-world credit card. This allows PsychoPy to calculate a scaling factor based on how the participant sees the image (in terms of height units per centimeter or pixels). My understanding is that this scaling factor represents how many height units or pixels correspond to one real-world centimeter on the participant’s screen.
. Height Units vs. Pixels: I’m seeing the scaling factor expressed in terms of height units per centimeter. Could someone clarify the difference between height units and pixels in this context? My current understanding is that height units are relative to the screen, while pixels are tied to the screen’s resolution. How should I handle this difference when applying the scaling factor?
Applying the Scaling Factor: To ensure all participants see stimuli at the same real-world size, I understand I need to multiply the intended size (in centimeters) by the scaling factor derived from the credit card calibration. For example, if I want a stimulus to appear as 10 cm long in the real world, and the scaling factor is 0.8, I would adjust the size to 8 cm on their screen. Is this approach correct? (10cm*0.8=8?)
In my experiment, I have pre-determined line lengths in pixels. I want these lines to appear in consistent real-world sizes across all participants. I assume I’ll need to convert these line lengths in pixels to centimeters and then multiply them by the scaling factor. Where in my PsychoPy code should I make these adjustments, and how can I ensure I’m correctly converting the line lengths?
I would greatly appreciate any feedback or suggestions on how to handle this process correctly!
Height is a normalized size unit where 1 = the number of pixels in the y dimension of the window. In other words if you have a window that’s 1920x1080, “1” in height units corresponds to 1080 pixels, .5 corresponds to 540, and so on. It will always adjust to the number of pixels of the screen it’s currently running on so that everything is the same relative size, and if the experiment runs in full-screen, then it will depend on the screen resolution of that particular participant exactly how many pixels that corresponds to.
I think @wakecarter built this algorithm and knows it better than I would, but my understanding is that if you have a stimulus that’s 10cm on your own screen when it renders at Y height units, you multiply the size in height units by the scale factor after they complete the credit card calibration and it will be 10cm on the participants’ screen even if their screen is a different size.
The best option is to use height units, figure out the Y in height units that you need for it to appear the size you want on your own screen, and then use the scaling factor as described.
Blind spot task is useful if you care about the participants’ distance from the screen in addition to the real-world size of the objects on the screen. If you’re trying to match your stimuli for degrees of visual angle that takes a few extra steps.
Thank you, but I’m interested in showing participants exact line lengths instead of proportional values. So I think in this case I should change the height units in screen scale to pixels per centimeters. Then I have predetermined line lengths in pixels like from 32 pixels to 300 pixels. ( at first we thought pixels would work online too) And then I need to convert these values to centimeters somehow.
At this point I’m not sure how to proceed from there. I mean credit card scale just gives me like how many pixels participant screen makes up per centimeter or height units, right? And then the adjustment I need to make-I’ll add the blind spot task since this is going to be an online study.
You multiply the length that you want in cm by the variables x_scale (horizontal) or y_scale (vertical) which are the numbers of pixels per cm or the number of height units per cm depending on whether your experiment is set to pixels or height units.
Sizes will need to be set to update each repeat instead of constant since the scaling factor is not known until after the credit card task has run.
Beyond this it’s difficult to support you unless you show what you are trying and what’s going wrong for you.
So I have predetermined line lengths in pixels from 32 pixels to 384. And now that I cannot use pixels in online studies, I’m interested in showing participants exact line lengths I determined before in pixels. This is what I’m trying to do, basicall;Convert them to cms
If your experiment uses pixel units, then all you need to do is multiply the length by x_scale in the horizontal direction and y_scale in the vertical direction and they should appear to participants at the same length (in cm) that they appear on your computer.
To say that you want those pixel values in cm doesn’t really make sense because that depends on what monitor you were using originally. There is no absolute conversion factor for going from pixels to cm, it depends on the pixel density of the specific monitor. For example my monitor is running at 1920x1080 pixel resolution, so it has 1920 pixels in the horizontal dimension. It’s about 53cm wide in physical space. That means that a line that is 384 pixels long in the horizontal dimension on my monitor would be about 10.6cm long. However, if I went to another monitor with the same 1920x1080 resolution but it’s 70cm wide, the same 384 pixels would be 14cm long. Or, if I ran my 53cm wide monitor at 1280x720 pixel resolution, then 384 pixels would be 15.9cm long.
These are all relative values, there is no “true” distance in cm for any given length in pixels, it’s just however long it was on the specific monitor you were using at the specific resolution you were using. The point of the credit card calibration is to give you a scaling factor that lets you match distance in cm for the particular resolution and size of the monitor that the participant is using.
@wakecarter Could you please add annotations to your screen scale credit card? Because I’m sure it’s confusing for most people to comprehend how it really works and what are the next steps should be in terms of converting, etc.