Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #28310
| From | ysr88 <yusragharbi@hotmail.fr> |
|---|---|
| Subject | need code java of RLSA - Run Length Smoothing Algorithm |
| Newsgroups | comp.lang.java.programmer |
| Message-ID | <DfidnXetRf5odsLOnZ2dnUVZ_q-dnZ2d@giganews.com> (permalink) |
| Date | 2014-04-29 13:14 -0500 |
this is a version of RLSA - Run Length Smoothing Algorithm in c++
int hor_thres = 22;
int one_count = 0;
int zero_flag = 0;
Mat tmpImg = Mat(Img.size(), CV_8UC1, Scalar(0, 0, 0));
for (int j = 0; j<Img.rows; j++){
for (int i = 0; i<Img.cols; j++){
if (Img.at<uchar>(j, i) == 0)
{
if (zero_flag == 1)
{
if (one_count <= hor_thres)
{
tmpText(cv::Range(j - zero_count, j), cv::Range(i, i+1)).setTo(cv::Scalar::all(255));
// I want to do the same thing in Matlab as this image(i,j-one_count:j-1)=0;
}
else
{
zero_flag = 1;
}
one_count = 0;
}
zero_flag = 1;
}
else
{
if (zero_flag == 1)
{
one_count = one_count + 1;
}
}
}
}
--
ysr88
http://compgroups.net//
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
need code java of RLSA - Run Length Smoothing Algorithm ysr88 <yusragharbi@hotmail.fr> - 2014-04-29 13:14 -0500 Re: need code java of RLSA - Run Length Smoothing Algorithm Arne Vajhøj <arne@vajhoej.dk> - 2014-04-29 21:10 -0400
csiph-web