@@ -17,13 +17,12 @@ namespace cv {namespace ximgproc {
17
17
CV_Assert (src.channels () == 1 );
18
18
CV_Assert ((end_angle - start_angle) * theta > 0 );
19
19
20
- Mat _srcMat = src.getMat ();
20
+ int _col_num = cvRound ((end_angle - start_angle) / theta);
21
+ int _row_num, _out_mat_type;
22
+ Point _center;
23
+ Mat _srcMat, _masked_src;
21
24
22
- int _row_num, _col_num, _out_mat_type;
23
- _col_num = cvRound ((end_angle - start_angle) / theta);
24
- transpose (_srcMat, _srcMat);
25
- Mat _masked_src;
26
- cv::Point _center;
25
+ transpose (src, _srcMat);
27
26
28
27
if (_srcMat.type () == CV_32FC1 || _srcMat.type () == CV_64FC1) {
29
28
_out_mat_type = CV_64FC1;
@@ -59,7 +58,10 @@ namespace cv {namespace ximgproc {
59
58
60
59
double _t;
61
60
Mat _rotated_src;
62
- Mat _radon (_row_num, _col_num, _out_mat_type);
61
+
62
+ // Initialize dst with appropriate size and type
63
+ dst.create (_row_num, _col_num, _out_mat_type);
64
+ Mat _radon = dst.getMat (); // Get reference to the output matrix
63
65
64
66
for (int _col = 0 ; _col < _col_num; _col++) {
65
67
// rotate the source by _t
@@ -74,8 +76,5 @@ namespace cv {namespace ximgproc {
74
76
if (norm) {
75
77
normalize (_radon, _radon, 0 , 255 , NORM_MINMAX, CV_8UC1);
76
78
}
77
-
78
- _radon.copyTo (dst);
79
- return ;
80
79
}
81
80
} }
0 commit comments