Home > Back-end >  Master come in -- about a judgment problems in image processing.
Master come in -- about a judgment problems in image processing.

Time:10-22

The younger brother in learning image programming, this problem for a few days.
Please prawns for a look. Where is my code problem?
How to change, thanks.

Problem: there are a lot of lines in an image, judge empty lines of local images, to the direction of the X line the first blank behavior segmentation points, according to the number of lines divided into several pictures.

 procedure TMainForm. SpeedButton4Click (Sender: TObject); 
Var
I, j, x, W, H: Integer;
C: TColor;
IsWhite: Boolean;
The begin
W:=Image1. Picture. Width;
H:=Image1. Picture. Height;

ShowMessage (' Width: + IntToStr (W) + # 10 # 13 + + IntToStr 'Height:' (H));
//with the do
X:=0;
The begin
For I:=0 to do W - 1
The begin
IsWhite:=true;//assume that all first white
For j:=0 to do H - 1
The begin
C:=Image1. Picture. Bitmap. Canvas. The Pixels (I, j),
//Memo1. Lines. The Add (ColorToString (c));
If c<> ClWhite then//if you have any issue in a row is not white, the logo have not white.
IsWhite:=false;

Application. ProcessMessages;
end;
If IsWhite=true then//if all is white, the tag height coordinate value
The begin
Inc (x);
LineArry [x] :=H;
end;
end;
end;
ShowMessage (IntToStr (LineArry [2]));
//Image1. Refresh;
end;





CodePudding user response:

LineArry what is, as if just use it to record some of the value

CodePudding user response:

reference 1st floor sz_haitao response:
LineArry, seem to only use it to record some of the values


Just for a record coordinates int array

CodePudding user response:

Outer loop is width, inner circulation height, be opposite?
  • Related