Hello,
I have my own procedure for SeparateObjects. It uses this code below,
where some variables imported from hyiedefs are removed now, like gRedToGrayCoeff etc. How can they be replaced?
Sincerely
Peter
else
begin
_GetMediaContrastRGB(Bitmap, mR, mG, mB);
t := (mR * gRedToGrayCoef + mG * gGreenToGrayCoef + mB * gBlueToGrayCoef) div 100;
for i := 0 to Bitmap.Height-1 do
begin
pxrgb := Bitmap.Scanline[i];
pxb := mask.Scanline[i+1]; inc(pxb);
for j := 0 to Bitmap.Width-1 do
begin
with pxrgb^ do
c := (r * gRedToGrayCoef + g * gGreenToGrayCoef + b * gBlueToGrayCoef) div 100;
if c>=t then
pxb^ := 255
else
pxb^ := 0;
inc(pxrgb);
inc(pxb);
end;
end;
end;
end;
else
for i := 0 to Bitmap.Height-1 do
begin
pxb := mask.Scanline[i+1]; inc(pxb);
for j := 0 to Bitmap.Width-1 do
begin
with Bitmap.Pixels[j,i] do
c := (r * gRedToGrayCoef + g * gGreenToGrayCoef + b * gBlueToGrayCoef) div 100;
if c>=200 then
pxb^ := 255
else
pxb^ := 0;
inc(pxb);
end;
end;
end;
Sincerely
Peter