# How to detect wide ball in cricket using MATLAB. What should be the simple code for it.

6 ビュー (過去 30 日間)
Muhammad 2023 年 1 月 3 日
コメント済み: Bjorn Gustavsson 2023 年 1 月 5 日
I have deficulty in writing matlab code for detection of wide ball in cricket.
##### 6 件のコメント表示非表示 5 件の古いコメント
Bjorn Gustavsson 2023 年 1 月 3 日
@Awais, as far as I understand it is necessary to know the ball's trajectory explicitly in 3-D in order to judge whether the ball is wide or not. To do that one would prefer to have at least bi-static videos with well known camera-parameters in order to do steroscopic triangulation. Lacking that you might get good enough estimate of the distance-from-camera from the known size of the ball - provided you have some very good image of a well known object (wicket should do, I think). If you have a video above from behind the bowler it should also work - but now we're starting to use domain-specific inferences, and my domain-specific knowledge on cricket is pretty much used up by writing "wicket" and "bowler".

サインインしてコメントする。

### 回答 (2 件)

Image Analyst 2023 年 1 月 3 日

@Muhammad and @Awais Qarni (are you working together on this project?)
You need to segment each video frame to detect the ball. If it's moving fast, then it will be blurred or faint/transparent and you probably can't get an accurate size, at least in the direction of motion.
If you have any more questions, then attach your one of your frames with the ball in it and code to read it in with the paperclip icon after you read this:
For an example of how to find a contrasting round object in an image, see my Image Processing Tutorial in my File Exchange:
where I find coins and get their location and diameter.
##### 1 件のコメント表示非表示 なし
Awais Qarni 2023 年 1 月 4 日

サインインしてコメントする。

Bjorn Gustavsson 2023 年 1 月 4 日
One thing you can (should) try is to look at the differences between frames, that is subtract the previous frame from the current frame. That will hopefully effectively remove everything that is not moving rapidly between frames (should be almost everything except the bowlers arm). In order to do this you better convert the frames from uint8 or whatever data-type you get the individual frames into doubles. That will make most of the difference-frame close to zero and the ball a positive-negative double-hump, positive where it is in the current frame and negative where it was in the previous frame. That way you can extract the position and trajectory of the ball along the video-sequence.
HTH
##### 3 件のコメント表示非表示 2 件の古いコメント
Bjorn Gustavsson 2023 年 1 月 5 日
@Image Analyst, true. In most cases where I typically don't know which direction things are moving, I have found it useful to have the positive-negative bumps as a Q-D indicator of what direction things move in. That might not be too important here when that is more or less given (right?).

サインインしてコメントする。

### カテゴリ

Find more on Computer Vision With Simulink in Help Center and File Exchange

R2020a

### Community Treasure Hunt

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

Start Hunting!

Translated by