Loading...

Huge black lines

Support for GdPicture Light Imaging Toolkit and GdPicture Pro Imaging ActiveX/SDK.

Huge black lines

Postby IBazavan » Wed Feb 17, 2010 4:17 pm

Hi,

I'm evaluating "GdPicture ToolKit Pro Edition" and I’m trying to remove some black pixels on a black & white picture in order to clean it. I try to read a 1 pixel width vertical line, count the number of black pixels on that line and if this number is smaller than 5, I want to replace all the black pixels on that line with white pixels. I'm using the following code:

Code: Select all
Dim numero As Long
Dim culoare As Long
Dim i, j As Integer

culoare = Imaging1.argb(255, 0, 0, 0)

For j = 1 To 150
Call Imaging1.SetROI(j, 0, 1, 40)
numero = 0
For i = 1 To 40
culoare = Imaging1.PixelGetColor(j, i)
If culoare <> -1 Then numero = numero + 1
Next i
If numero< 5 Then Call Imaging1.AdjustRGB(255, 255, 255)
Next j

DrawPreview


The problem is that on the picture apears 3 vertical large black lines and i can't figure why.
First time, i try to use countcolor() and also i had this problem with huge black lines.
Can anyone help me?
Thank you in advance!
IBazavan
 
Posts: 5
Joined: Wed Feb 17, 2010 3:58 pm

Re: Huge black lines

Postby Tom Moran » Wed Feb 17, 2010 6:54 pm

Turn off Antialias and see if that makes a difference.

Tom
Tom Moran
 
Posts: 102
Joined: Thu May 24, 2007 9:41 am
Location: Phoenix, Arizona

Re: Huge black lines

Postby IBazavan » Thu Feb 18, 2010 9:41 am

Hi man and thank you for your answer!

Unfortunately, turning off antialiases didn't have any effect.

I'm attaching a testing picture to see what I'm talking about...
Attachments
testing.gif
testing.gif (15.94 KiB) Viewed 196 times
IBazavan
 
Posts: 5
Joined: Wed Feb 17, 2010 3:58 pm

Re: Huge black lines

Postby Loïc » Thu Feb 18, 2010 10:09 am

Hi there !

IBazavan, could you attach your original image for investigations ?

Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4430
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Huge black lines

Postby IBazavan » Thu Feb 18, 2010 11:02 am

Here you have my code (I change it today), my original picture and the result. As you can figure, when I read pixels on horizontal it works fine, but when I read them on verticals it just draws that black lines...

CODE in VB6:

Code: Select all
Private Sub test_img_Click()

Dim test As Boolean
Dim numar As Long
Dim culoare As Long
Dim i, j As Integer

Call Imaging1.ConvertTo1Bpp
DrawPreview

culoare = Imaging1.argb(255, 0, 0, 0)

 'on horizontal works fine:
For i = 1 To 40
Call Imaging1.SetROI(0, i, 150, 1)
numar = 0
numar = Imaging1.CountColor(culoare)
If numar < 5 Then Call Imaging1.AdjustRGB(255, 255, 255)
 DrawPreview
Next i

'on vertical:

For i = 1 To 150
Call Imaging1.SetROI(i, 0, 1, 40)
numar = 0
numar = Imaging1.CountColor(culoare)
If numar < 10 Then Call Imaging1.AdjustRGB(255, 255, 255)
 DrawPreview
Next i

DrawPreview

End Sub



Thank you for your help!
Attachments
result_image.jpg
result_image.jpg (2.34 KiB) Viewed 193 times
original_Image.jpg
original_Image.jpg (3.1 KiB) Viewed 193 times
IBazavan
 
Posts: 5
Joined: Wed Feb 17, 2010 3:58 pm

Re: Huge black lines

Postby Loïc » Thu Feb 18, 2010 11:48 am

Hi,

I copied your code and ran it: all is OK.

- Are you sure to run this code on the image you attached ??
- What OS are you using ?
- Are you using the latest GdPicture Pro SDK ?

With best regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4430
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Huge black lines

Postby IBazavan » Thu Feb 18, 2010 1:30 pm

Hi Loic,

I use Windows XP Professional with SP2. I downloaded the kit from here:
http://www.gdpicture.com/download/downl ... urepro.php

I'm also attaching a print screen from the application.
Attachments
aplication.gif
IBazavan
 
Posts: 5
Joined: Wed Feb 17, 2010 3:58 pm

Re: Huge black lines

Postby Loïc » Thu Feb 18, 2010 3:24 pm

OK thanks.

Please, send me the source code of the application at esupport (at) gdpicture (dot) com.

With best regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4430
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Huge black lines

Postby Loïc » Thu Feb 18, 2010 5:19 pm

Hi,

This code should provide expected result:


Code: Select all
Private Sub test_img_Click()
  Dim test As Boolean
  Dim numar As Long
  Dim culoare As Long
  Dim i, j As Integer


  Call Imaging1.FxBlackNWhite

  For j = 0 To 149
    Call Imaging1.SetROI(j, 0, 1, 40)
    numar = 0
    For i = 0 To 39
      culoare = Imaging1.PixelGetColor(j, i)
      If culoare <> -1 Then numar = numar + 1
    Next i
    If numar < 6 Then Call Imaging1.AdjustRGB(255, 255, 255)
  Next j
 
  DrawPreview
End Sub


Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4430
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Huge black lines

Postby IBazavan » Fri Feb 19, 2010 10:04 am

It works fine, thank you very much for your help!
IBazavan
 
Posts: 5
Joined: Wed Feb 17, 2010 3:58 pm

Re: Huge black lines

Postby Loïc » Fri Feb 19, 2010 10:25 am

You are welcome. Thank you for your feedback !

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4430
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdPicture [Pro] ActiveX

Who is online

Users browsing this forum: No registered users and 1 guest

cron