Skip to content

Commit 73da7dd

Browse files
committed
fix: fix images channels error
1 parent ab67950 commit 73da7dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cpp/FOCV_Function.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1844,14 +1844,17 @@ jsi::Object FOCV_Function::invoke(jsi::Runtime &runtime, const jsi::Value *argum
18441844

18451845
Mat src1 = *src;
18461846

1847+
// we compute the histogram from the 0-th and 1-st channels
1848+
int channels[] = {0};
1849+
18471850
const int bins[1] = {256};
18481851
float hranges[2] = {0, 255};
18491852
const float *ranges[1] = {hranges};
18501853

18511854
// 计算灰度图像的直方图
18521855
cv::calcHist(&src1,
18531856
1,
1854-
0,
1857+
channels,
18551858
cv::Mat(),
18561859
*dst,
18571860
1,

0 commit comments

Comments
 (0)