Ask Your Question
2

Bottle Detection

asked 2018-01-18 03:34:30 -0500

Werz gravatar image

updated 2018-01-19 01:56:28 -0500

Hello,

I have the following application: Attached you can see some Images, it is a White Container with some different bottles in it (I made 4 Pictures to see the structure of this). There are 6 positions for the bottles, and 2 different bottle types in it. In different applications, all of the 6 positions can have a big bottle (called "tube"), a small bottle (called "Cup") or be empty. In the example Images you can see 2 Tubes, 2 Cups and 2 Empty positions.

A Camera is looking from the front to this Container, like in Image IMG_0001.JPG. The Task is to detect one of the 3 Options for each of the 6 positions (Is there a tube, a Cup or empty).

  • Additional Infos: Please do not consider the data Matrix codes on the backside, just ignore them.
  • The red lid of the large tubes is not present, please also ignore them (I forgot to unplug them before making Pictures)

How would you solve this Problem with OpenCV? Would you suggest a Special Illumination?

Thank you for helping

image description

image description

edit retag flag offensive close merge delete

Comments

1

can you try again, with the images ?

berak gravatar imageberak ( 2018-01-18 03:38:47 -0500 )edit

hello, the Problem is that I am not able to upload an Image, how does this work?

Werz gravatar imageWerz ( 2018-01-18 04:13:53 -0500 )edit

image upload through the "picture" symbol does not work, nor in internet explorer, neither in firefox. Also Attachment via zip fil does not work

Werz gravatar imageWerz ( 2018-01-18 04:18:35 -0500 )edit

It works for me. Why do you mean "it does not work"? have you got an error message. Image size must be less than 1MB

LBerger gravatar imageLBerger ( 2018-01-18 04:23:49 -0500 )edit

when I click on the Picture Symbol, a diolog opens for a link and for browsing a Picture on the local drive. When brwosing an clicking ok, the link of the Picture on the local drive appears in the field near the browse tab, but then when clicking ok, Dialog disappears and nothing happen, the same for the attachment symbol

Werz gravatar imageWerz ( 2018-01-18 04:45:43 -0500 )edit

I think you have choose first time an image with more than 1Mb and system is blocked after? Why ? I don't know. Try to post a new question and we will delete question later. Don't delete it please

LBerger gravatar imageLBerger ( 2018-01-18 04:53:38 -0500 )edit

@Werz , try to remove site cookies and login again.

mshabunin gravatar imagemshabunin ( 2018-01-18 05:02:29 -0500 )edit

you are right, the poictures has been bigger than 1MB; now I have compressed them to <1MB, but still it does not work, even with a new question post. I also have deleted all Cookies, without succes, still not possible :(

Werz gravatar imageWerz ( 2018-01-18 05:22:52 -0500 )edit

would it be possible, that I mail someone the Images, that uploades them then?

Werz gravatar imageWerz ( 2018-01-18 06:36:10 -0500 )edit
1

post a download link from gdrive or similar

procton gravatar imageprocton ( 2018-01-18 06:52:45 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2018-01-19 02:30:32 -0500

VxW gravatar image

Hi,

the illumination is not so important, but they should be constant (avoid interfering light).

  • In a first step I would try to detect the box based on the outer contours, or place the box on a fixed position and define a mask
  • Second define a roi and calculate the profile for this roi, before you can apply a e.g. median filter to eliminate noise (see images below)
  • Third, for each tube, cup or empty there is a unique profile characteristics
  • Fourth, compare the unique characteristics with a current one based on a distance measure

Instead of comparing the profiles you can also try to do a template matching approach.

Image with ROI including background

image description

Image with ROI within box

image description

Image with applied median filter before

image description

Best

edit flag offensive delete link more

Comments

Hello, thank you very much for this proposal.

The good News is: The box is always on a fixed Position and is not moving during detection.

This is a very good idea, to Analyse the Profile. The Problem is, that this red Labels on the big tubes are not always present. But anyway, there should be a way to distinguish between this 2 types by this strategy.

Have you done this Analysis you posted above with open cv? Could you please tell me, which functions you have used?

I will try to Analyse this on the real System, thank you very much. If you have additional ideas, please let me know!

Thanks!

Werz gravatar imageWerz ( 2018-01-22 02:29:24 -0500 )edit

Hello,!

I have now uploaded a Picture from the real System with the real Background, see link here: https://photos.app.goo.gl/QeqVbXSfLUo...

(I am still not able to upload Images directly...)

As you can see, there are 4 different Containers, 3 of them are "Tubes", and one of them is a "Cup" (the Little one).

The Problem is, that they are overlapping in the worst case. Additionally, in one of the Images on of the tubes is positioned higher, this has also to be detected by the camera, has someone an idea how to detect this?

Thank you!

Werz gravatar imageWerz ( 2018-02-08 07:13:18 -0500 )edit

Hello,

the reduce function works very goog for this, but now Im looking for a possibility to draw a graph out of this vector i created with the reduce function, how have you done this with opencv?

Werz gravatar imageWerz ( 2018-02-09 05:03:11 -0500 )edit

are you working in c++ or python or...?

VxW gravatar imageVxW ( 2018-02-09 05:08:31 -0500 )edit

working with c++

Werz gravatar imageWerz ( 2018-02-09 05:10:38 -0500 )edit

I havn't tried it but there are lot of plotting frameworks in c++

looks simple: https://github.com/lava/matplotlib-cpp

is popular: https://directory.fsf.org/wiki/Plotutils

seems to be professional: https://root.cern.ch/

try it out

VxW gravatar imageVxW ( 2018-02-09 05:17:22 -0500 )edit

Thank you for this. I have downloaded the first one, but it seems that i Need python for this. Compiler complains that he does not find "Python.h" when compiling...

Werz gravatar imageWerz ( 2018-02-09 05:49:27 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-01-18 03:34:30 -0500

Seen: 668 times

Last updated: Feb 08 '18