Hi can any one help me.
I want to scan each pixel in a output image of sobel vertical edge image.
start from top-left, scan once i get a pixel i mark it a start pixel and go forward in same line by shifting the point to a MAX intervell that i give. (Eg : MaxIntervel = 30)
But i want scan back word after shifting the point to max intervel,to fix a end point.
To make it more clear see this.
Row pixel
1(starting point) 25 30(Maxintervel)
[code]
function new_image = fill_function(Image, start_row, start_col, interval)
if Image(start_row, start_col) == 1 && Image(start_row, start_col + interval + 1) == 1
for i = 1:interval
Image(start_row, start_col + i) = 1;
end
end
new_image = Image;
end
[/code]
I want to fix 25 as end point and fill 1 to 25 with a threshold value white pixel...
How to do it can any one help me
Thank You
Manoj
Comments
I suppose that 25 is "MaxInterval-5", you have the starting point, so, why you can't write, for example:
Image(start_row,start_col:start_col+MaxInterval-5)=1
In this way all the values from the starting column to the starting column + the interval -5 (?) are setted to 1.
Let me explain clearly.
I am doing this on a vertical soble edge image,which has only 0's and 1's. So starting opint is the first 1's fron left and move the point to 30 MaxIntervel. and from there come back towords starting point.
When u find a 1's in the same row again, fix it as end point, and fill the gap.But we have to do this baed on some threshold values.
But for any start and end pixel its intensity must be higher then the threshold value.
So i am not sure how to do it. Did u understood ?
Thank U.
[b]I am doing this on a vertical soble edge image,which has only 0's and 1's.[/b]
ok!
[b]So starting opint is the first 1's fron left and move the point to 30 MaxIntervel.
[/b]
"move the point"? in the sense that it fills all the pixels in the row from the starting point to the starting point + maxinterval?
[b]and from there come back towords starting point.[/b]
in what sense "came back"?
[b]When u find a 1's in the same row again, fix it as end point, and fill the gap.
[/b]
?
[b]But we have to do this baed on some threshold values.
[/b]
You are working with the black and white sobel image so I think that the threshold is set in the original image...
[b]But for any start and end pixel its intensity must be higher then the threshold value.
[/b]
ok
Sorry, i think it's only a problem with my english.
Then I think (hope) it could be all clear to me.
Some thing like this
if
{
Start_px > T
}
If above is true,Move the index to Maxintervel and scan backword, if a pixel > T mark it as end pixel. then fill the gap with a intensity (C).
I hope now its clear.
I did it in the following code, but i could not do it in full. Check the code.
[code]
function new_image = fill_function(Image, start_row, start_col, interval)
if Image(start_row, start_col) == 1 && Image(start_row, start_col + interval + 1) == 1
for i = 1:interval
Image(start_row, start_col + i) = 1;
end
end
new_image = Image;
end
[/code]
I think it could be something like this:
[code]
if OriginalImage(start_row,start_col)> T
for i=start_col+j:start_col
if OriginalImage(start_row,i)> T
end_col=i;
break
end
end
break
end
Image(start_row,end_col)=C;
%I don't know if you want to modify the original image or a new one
[/code]
Let me try this and if i have any doubt let me ask u ,
Thank u so much.