Skip to content

Commit c905a4d

Browse files
authored
Merge pull request #48 from Digitelektro/develop
Develop
2 parents 1367aa4 + e1f5cb3 commit c905a4d

4 files changed

Lines changed: 23 additions & 5 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ if(UNIX AND NOT APPLE)
151151
SET(CPACK_GENERATOR "DEB")
152152
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
153153
SET(CPACK_PACKAGE_VERSION_MINOR "4")
154-
SET(CPACK_PACKAGE_VERSION_PATCH "3")
154+
SET(CPACK_PACKAGE_VERSION_PATCH "4")
155155
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Digitelektro")
156156
SET(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/Digitelektro/MeteorDemod")
157157
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Russian Meteor M2 weather satellite data decoder")

common/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
#define VERSION_MAJOR 2
55
#define VERSION_MINOR 4
6-
#define VERSION_FIX 3
6+
#define VERSION_FIX 4
77

88
#endif // VERSION_H

imageproc/threatimage.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,25 @@ cv::Mat ThreatImage::irToRain(const cv::Mat &irImage, const cv::Mat &ref)
7979
}
8080
}
8181

82-
return rainImage;
82+
cv::Mat result = cv::Mat::zeros(irImage.size(), irImage.type());
83+
cv::Mat grayScale;
84+
cv::Mat alpha;
85+
86+
cv::cvtColor(irImage, grayScale, cv::COLOR_BGR2GRAY);
87+
std::vector<std::vector<cv::Point> > contours;
88+
cv::findContours(grayScale, contours, cv::RETR_TREE, cv::CHAIN_APPROX_SIMPLE);
89+
for (std::size_t i = 0; i < contours.size(); i++) {
90+
cv::drawContours(grayScale, contours, i, cv::Scalar(255, 255, 255), -1);
91+
}
92+
93+
//create alpha mask
94+
cv::threshold(grayScale, alpha, 0, 255, cv::THRESH_BINARY);
95+
96+
//apply mask
97+
cv::bitwise_and(rainImage, rainImage, result, alpha);
98+
99+
100+
return result;
83101
}
84102

85103
cv::Mat ThreatImage::invertIR(const cv::Mat &image)

main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,14 +649,14 @@ void searchForImages(std::list<cv::Mat> &imagesOut, std::list<PixelGeolocationCa
649649
fs::path fileJPG(folder + "/" + fileNameBase + "_" + channelName + ".jpg");
650650

651651
if(fs::exists(fileJPG)) {
652-
map[cftime] = std::make_tuple(entry.path().generic_string(), fileJPG);
652+
map[cftime] = std::make_tuple(entry.path().generic_string(), fileJPG.generic_string());
653653
break;
654654
}
655655

656656
fs::path fileBMP(folder + "/" + fileNameBase + "_" + channelName + ".bmp");
657657

658658
if(fs::exists(fileBMP)) {
659-
map[cftime] = std::make_tuple(entry.path().generic_string(), fileBMP);
659+
map[cftime] = std::make_tuple(entry.path().generic_string(), fileBMP.generic_string());
660660

661661
break;
662662
}

0 commit comments

Comments
 (0)