Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Moving Particle position and orientation into an image

Solved!
Go to solution

Hi,

I have a single particle in a binary image. I'd like to correct its position and orientation in the image and then saving it. I managed to change its orientation. However, I'd love to know if there is a direct approach to change its position other than cutting the particle and adding it to black image using OR method.

 

All help is appreciated.

 

P.S: I use VB.NET. However, LabVIEW solution can be converted easily as I use IMAQ for .NET which holds the same method names of the LabVIEW VIs. 

Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 1 of 6
(4,138 Views)

VBCoder,

 

Using the OR method that you described is likely the easiest way to translate position.  You could also convert the IMAQ image to a 2D pixel array and then process the array to move the object, but the OR image will likely be much easier.

 

Regards,

 

Sam K

Applications Engineer

National Instruments

0 Kudos
Message 2 of 6
(4,115 Views)

Thanks Sammy for your response. I guess it would be great if such a feature has been added to the new version especially since particle tracking has been already implemented in 2010.

 

I'll implement it and post it back on this thread for future referencing.

Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 3 of 6
(4,084 Views)

It sounds like IMAQ Shift and IMAQ Rotate would do what you want.  Do you want to operate on the entire image or just a section?  How about a sample image?

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 6
(4,081 Views)

Thanks Bruce for your concern,

I want to control the positioin and orientation of the single particle on the image. Aplying IMAQ rotation would either change the area (aspect ratio is reserved) or image size (aspect ratio is not reserved).

 

I managed to extract the particle using the extract method and by detecting the bounding rectangle of the particle. The only problem is to change the position and orientation of the particle over the black background.

 

I minimized the error in orientation by extracting the particle and changing its orientation with aspect ratio set to false (error is 0.2%).

Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 5 of 6
(4,063 Views)
Solution
Accepted by topic author wbadry

Hi,

Thanks all for your help. Since I'm totally crazy about my girlfriend where the project was related to her, I figured out a workaround that I'd love to share:

  1. I extracted the particle by getting its bounding rectangle.
  2. I then created black image of the same original image using the fill meethod.
  3. Thereafter, I control the orientation to correct the mask.
  4. Eventually I use overlay the bitmap of the extracted particle in the coorrect position.

I have attached a screenshot of the software developed.

 

Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 6 of 6
(4,007 Views)