ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 identify area

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
AndNit Posted - Jun 14 2024 : 10:09:07
Good afternoon

I need help. How to identify the end of the last line typed in an image, and identify exactly the starting point of the next line?

In the attached image, I put an example of what I need. Identify exactly the area in red, with the aim of creating a text box and sequencing the texts starting from the last line found.

I thought about scanning the document from beginning to end (vertical and horizontal), calculating the Histogram to know the starting point, but would there be a less laborious solution?

thanks

5   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jun 17 2024 : 18:54:02
Hi

The current version does not support selections for GetDominantColor(), but you can email me for an updated method that does.

Nigel
Xequte Software
www.imageen.com
AndNit Posted - Jun 17 2024 : 14:07:45
Thanks for the help Nigel, but the way you put it, I couldn't understand or advance the solution lol... would we be able to work with GetDominantColor only in the area selected in the image? I think this way I can progress better, considering that all my images will be black and white
xequte Posted - Jun 15 2024 : 18:10:12
No, i think you would be better to write your own method using TIEBitmap.Scanline:

http://www.imageen.com/help/TIEBitmap.Scanline.html

Something like (untested)...

// Search the image for consecutive rows of mostly white
function FindConsecutiveWhiteRows(MinWhiteValue: Integer; MinConsecutiveWhiteRows: Integer; out WhiteRowsStart: Integer; out WhiteRowsEnd: Integer): Boolean; 
var
  x, y: Integer;
  pPix: PRGB;
  Gray: Byte;
  rowIsWhite: Boolean;
  consecutiveWhiteRows: Integer;
begin
  Result := False;
  WhiteRowsStart := 0;
  WhiteRowsEnd   := 0;

  consecutiveWhiteRows := 0;
  for y := 0 to ImageEnView1.IEBitmap.Height - 1 do
  begin
    pPix := ImageEnView1.IEBitmap.ScanLine[ y ];
    rowIsWhite := True;
    for x := 0 to ImageEnView1.IEBitmap.Width - 1 do
    begin
      if (pPix^.R < White_MinWhiteValue ) or (pPix^.G < MinWhiteValue ) or (pPix^.B < MinWhiteValue ) then
      begin    
        rowIsWhite := False;
        Break;
      end;
      inc( pPix );
    end;
    if rowIsWhite then 
      inc( consecutiveWhiteRows )
    else
      consecutiveWhiteRows := 0;

    if consecutiveWhiteRows >= MinConsecutiveWhiteRows then
    begin
      Result := True;
      WhiteRowsStart := y - consecutiveWhiteRows + 1;
      WhiteRowsEnd   := y;
      exit;
    end;
  end;
end;


Nigel
Xequte Software
www.imageen.com
AndNit Posted - Jun 15 2024 : 07:26:58
in this case I would use GetDominantColor, correct? How to do this, in an area x of the image? in this case, only in the selected area of the image.

thanks
xequte Posted - Jun 14 2024 : 18:21:02
Hi

I'm not sure if there is a better solution other than parsing the scanlines, calculating the percentage of "White/blank" and then stop once you locate n consective rows of > z% "White/blank"

Nigel
Xequte Software
www.imageen.com