Why does this work? PixelMath Crosshairs part 2

edited July 2021 in PixInsight
In your fundamentals video "PixelMath Crosshairs Part Two you use this formula:
image

Your second line is: yc = trunc (width($T)/2);

I've ran it and it does indeed work but shouldn't it read: yc = trunc (height($T)/2); ??

I've tried it both ways and using height does indeed work as well and since we are talking about the Y axis I think the use of height is more appropriate. 
I only ask because I'm still learning and trying to figure out why using width works on height.

Comments

  • Also, as is, you cannot use this formula to create crosshairs over an existing image because it creates black everywhere except for the white crosshairs which would cover the image.
    There needs to be an additional bit of formula to tell it to not affect the other pixels. Since I'm a newbie I still haven't figured that out.
  • EDIT: I figured out how to place the white crosshair over the image! $T instead of 0.
    PixelMath is NOT Scary!  haha
  • But this is unfair!! lol
    If you look on the page I published the videos, you will see I have addressed both of your concerns. The first is the first is because I copy/pasted and forgot to edit the line completely. The second, as you discovered, I supply the complete formula with $T (I do this in the video as well).

    See:

    thanks,
    -the Blockhead
  • Sorry. I never read the description above the video links. I just directly clicked on the video to watch it.
Sign In or Register to comment.