Skip to content

Instantly share code, notes, and snippets.

@krisoft
krisoft / calc_perseverance_zhurong_distance.py
Created May 15, 2021 09:01
Calculating the distance between perseverance and zhurong rovers.
import math
MARS_RADIUS = 3389.5 # https://en.wikipedia.org/wiki/Mars
# source https://spacenews.com/chinas-zhurong-mars-rover-lands-safely-in-utopia-planitia/
ZHURONG_LONGITUDE = 110.318
ZHURONG_LATITUDE = 24.748
# source https://www.jpl.nasa.gov/news/press_kits/mars_2020/launch/mission/landing_site/
@krisoft
krisoft / align.py
Created September 18, 2012 18:43
Image alignment with pyramids ( http://www.youtube.com/watch?v=nQ0WyrOBLwg )
import cv,sys
cv.NamedWindow("pic")
def compare(frameA,frameB,offsetX,offsetY,show=False):
rects = intersect_rects([
rect(0,0,frameA.width,frameA.height),
rect(offsetX,offsetY,frameB.width,frameB.height),
])
assert frameA.depth==frameB.depth