Repository navigation
Gear simulator ssg - #1464
Gear simulator ssg#1464bwdev01 wants to merge 4 commits into
Conversation
| bool LoadNonFitsImage(cv::Mat& img, bool preProcess, wxSize& fullSize); | ||
| bool LoadFitsImage(usImage& img, cv::Mat& matImage, bool preProcess, wxSize& fullsize); |
There was a problem hiding this comment.
Can we combine these into a single LoadImage method that does everything and remove the filename extension check from the caller (it's duplicated in the method and needn't be done twice).
We can also remove the preProcess argument since it is always true.
| bool LoadFitsImage(usImage& img, cv::Mat& matImage, bool preProcess, wxSize& fullsize); | ||
| void PreProcessImage(cv::Mat& img); | ||
| void GetSimDisplacements(double *pDeltaX, double *pDeltaY, double *pGearTime, bool TransformToCameraCoords); | ||
| bool ApplySimDisplacements(usImage *img, cv::Mat& matImage); |
There was a problem hiding this comment.
const since it does not modify matImage
| bool ApplySimDisplacements(usImage *img, cv::Mat& matImage); | |
| bool ApplySimDisplacements(usImage *img, const cv::Mat& matImage); |
| bool SimCamParams::allow_async_st4 = true; | ||
| unsigned int SimCamParams::frame_download_ms; // frame download time, ms | ||
| unsigned int SimCamParams::SimFileIndex = 1; | ||
| wxString SimCamParams::SimFileTemplate = _("C:\\Temp\\phd2\\sim_image.png"); |
| // simulating solar system guiding. The image will be pre-processed to create a | ||
| // 16-bit gray-scale version of the original. Acceptable image formats are fits or any of the usual | ||
| // image formats supported by OpenCV (jpg, tif, bmp, png...) | ||
| bool SimCamState::LoadImageFromFile(usImage& img, cv::Mat& matImage, wxSize& fullSize) |
There was a problem hiding this comment.
let's stick with the convention of using pointer arguments for output arguments (ok to use const references to pass objects that are not being modified). The helps make clear--especially in calling code--that the arguments are output arguments by passing them as pointers, not as references.
| bool SimCamState::LoadImageFromFile(usImage& img, cv::Mat& matImage, wxSize& fullSize) | |
| bool SimCamState::LoadImageFromFile(usImage *img, cv::Mat *matImage, wxSize *fullSize) |
| for (unsigned short *p = p0; p < end; p++) | ||
| *p = (unsigned short) (SimCamParams::noise_multiplier * | ||
| ((double) gain / 10.0 * offset * exptime / 100.0 + (rand() % (gain * 100)))); | ||
| dir.Open(wxf.GetPath()); |
There was a problem hiding this comment.
ReadFitImage does not use dir ... any idea why the dir.Open and CloseDir are being called here?
No description provided.