Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Side fill opencv.I want to fill sides of a binary image.

I have a binary image.image description I want to fill its sides. like this- image description for it I wrote a code in opencv (here I am just mentioning code for that particular section only)

for (int j =dst.cols; j>=0; j--) {

for (int i =dst.rows; i>=0; i--) { if (dst.at<char>(i,j) == 0){ dst.at<char>(i,j)=255; }
if (dst.at<char>(i,j)>0){ for (int k =i; k>=0; k--) { dst.at<char>(k,j)=0; } }

} } //But I dont get the result.It shows "Segmentation fault(core dumped)" and sometimes it shows but it shows whole image black. Please help.

Side fill opencv.I want to fill sides of a binary image.

I have a binary image.image description I want to fill its sides. like this- image description for it I wrote a code in opencv (here I am just mentioning code for that particular section only)

for <pre><for (int j =dst.cols; j>=0; j--) {

for (int i =dst.rows; i>=0; i--) { if (dst.at<char>(i,j) == 0){ dst.at<char>(i,j)=255; }
if (dst.at<char>(i,j)>0){ for (int k =i; k>=0; k--) { dst.at<char>(k,j)=0; } }

} } }>

enter code here

//But I dont get the result.It shows "Segmentation fault(core dumped)" and sometimes it shows but it shows whole image black. Please help.

Side fill opencv.I want to fill sides of a binary image.

I have a binary image.image description I want to fill its sides. like this- image description for it I wrote a code in opencv (here I am just mentioning code for that particular section only)

<pre><for for (int j =dst.cols; j>=0; j--) {

for (int i =dst.rows; i>=0; i--) { if (dst.at<char>(i,j) == 0){ dst.at<char>(i,j)=255; }
if (dst.at<char>(i,j)>0){ for (int k =i; k>=0; k--) { dst.at<char>(k,j)=0; } }

} }>

enter code here
}

//But I dont get the result.It shows "Segmentation fault(core dumped)" and sometimes it shows but it shows whole image black. Please help.

Side fill opencv.I want to fill sides of a binary image.

I have a binary image.image description I want to fill its sides. like this- image description for it I wrote a code in opencv (here I am just mentioning code for that particular section only)

for (int j =dst.cols; j>=0; j--) {
for (int i =dst.rows; i>=0; i--) {
    if (dst.at<char>(i,j) == 0){
        dst.at<char>(i,j)=255;
    }  
    if (dst.at<char>(i,j)>0){
        for (int k =i; k>=0; k--) {
        dst.at<char>(k,j)=0;
      }
    }   


}
}

//But I dont get the result.It shows "Segmentation fault(core dumped)" and sometimes it shows but it shows whole image black. Please help.