Home Image-Pro General Discussions

Can we convert or remove the black background from the image after the rotation?

 I am interested to count the black pixel of the image. But as we can see, after rotating the image, we are getting a black background and I do not want to count those black background pixels. Can we somehow get white background instead of black in the Image pro ?

Best Answers

  • Accepted Answer

    Yuri --

    Thank you for the reminder about the ORIGIN OPTION and ROTATION OPTION in the SPATIAL CALIBRATION.

    That would resolve the entire issue.

    A copy of the SPATIAL CALIBRATION UI with the ORIGIN CONTROLS and ROTATION CONTROL highlighted is below.

    Thanks again.

    -- Matt

  • Accepted Answer
    There is also an easy way to create such calibration: just draw a measurement line, select it, click right mouse button and select "Set as X Axis" from the context menu: a new calibration will be created and all object coordinates recalculated. The screenshot below shows objects classified (color-coded) by X coordinate:



  • Hi Raviraj,

    You can put a ROI on your image excluding background and count inside the ROI. If you rotate an image, the ROI should be created automatically, it looks like you already have it on your screenshot, so just count.


  • 2020-07-15-163411

    Raviraj --

    I am curious about why you are rotating your image and then analyzing it.

    If you are counting and measuring features, everything should be the same except measurements related to LOCATION or ANGLE.  If you know that the ROI is 55 degrees from a reference, would it not make sense to just correct the FEATURE ANGLE (by adding or subtracting the ROTATION ANGLE) rather than investing the time to rotate the entire image?

    I hope this information is helpful.

    -- Matt

  • Yes, Matt, good point!

    You can create a spatial calibration with given origin and angle (Image-Pro supports it), and then measure XY position of the objects in that system of coordinates.


Sign In or Register to comment.