Alignment of rice grains

i want a code that aligns rice grains in a straight line. the image shows that the rice kernels are scattered around in different position. i want to change orientation of the kernels so that they appear in same position and also they are placed according to their size.

3 Comments

DGM
DGM on 24 May 2021
Edited: DGM on 24 May 2021
Start with:
  1. binarize the image
  2. use regionprops() to get bounding box, orientation, and area of all objects in the binary image
  3. bounding box information to extract the objects
  4. use orientation and imrotate() to orient the sub-images
  5. use area to arrange them as you see fit
or something like that.
thank you so much for this but it would be great if you help me with the code with it.
DGM did help you. Now it is your turn: show what you have tried and which specific step is giving you trouble implementing it.

Sign in to comment.

Answers (0)

Categories

Find more on Biotech and Pharmaceutical in Help Center and File Exchange

Asked:

on 24 May 2021

Commented:

Rik
on 2 Jun 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!