Image processing of a Rubiks cube

43 visualizaciones (últimos 30 días)
Conner Carriere
Conner Carriere el 1 de Feb. de 2021
Comentada: DGM el 7 de Oct. de 2024
I am currently working on a project that will solve a Rubiks cube. As of now, I am stuck on the image processing. I have installed the image processing toolbox for matlab. What I need to do is determine which colors are on a single face of a Rubiks cube. This informations will be pulled of of a .jpg image.
Any tips or pointers how to do this?
Thanks!

Respuestas (1)

Sameer
Sameer el 7 de Oct. de 2024
Hi Conner
From my understanding, you want to develop a method to identify and determine the colors present on a single face of a Rubik's Cube from a ".jpg" image.
Here's how you can achieve it:
1. Capture and Preprocess: Obtain a clear image of the Rubik's Cube face with consistent lighting. Convert the image from RGB to HSV color space to simplify color differentiation.
2. Color Segmentation: Use HSV thresholding to segment each color on the cube. Define HSV ranges for each Rubik's Cube color based on sample images.
3. Region Detection: Apply morphological operations to clean up the segmented areas. Use functions like "bwlabel" and "regionprops" to identify individual squares on the cube face.
4. Color Mapping:Calculate average HSV values for each detected region and map them to the closest known Rubik's Cube color.
Hope this helps!
  1 comentario
DGM
DGM el 7 de Oct. de 2024
Why not post an actual example?

Iniciar sesión para comentar.

Categorías

Más información sobre Get Started with Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by