필터 지우기
필터 지우기

how to deal unsupporeted function in matlab??

조회 수: 1 (최근 30일)
yogesh nandurkar
yogesh nandurkar 2014년 11월 19일
댓글: Adam 2014년 11월 20일
... imshow inseershape imopen
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2014년 11월 19일
Yogesh - please provide some context/details on what you are attempting to do. What are you doing when the error (?) is being generated? If there is an error, then include the full error message in your question.
yogesh nandurkar
yogesh nandurkar 2014년 11월 20일
i am using code generation for motion detction programm.. when i used code generation ,there is error of unsupported function like "imopen"..sir how i solve this error.below is my programm
vidDevice = imaq.VideoDevice('winvideo', 1, 'YUY2_640x480', ...
'ROI', [1 1 640 480], ...
'ReturnedColorSpace', 'rgb', ...
'DeviceProperties.Brightness', 90, ...
'DeviceProperties.Sharpness', 90);
foregroundDetector = vision.ForegroundDetector('NumGaussians', 3, ...
'NumTrainingFrames', 50);
for i = 1:150 frame = step(vidDevice); % read the next video frame foreground = step(foregroundDetector, frame);
end
se = strel('square', 3);
filteredForeground = imopen(foreground, se);
blobAnalysis = vision.BlobAnalysis('BoundingBoxOutputPort', true, ... 'AreaOutputPort', false, 'CentroidOutputPort', false, ... 'MinimumBlobArea', 150);
bbox = step(blobAnalysis, filteredForeground);
result = insertShape(frame, 'Rectangle', bbox, 'Color', 'green');
numCars = size(bbox, 1);
videoPlayer = vision.VideoPlayer('Name', 'Detected Cars');
videoPlayer.Position(3:4) = [650,400]; % window size: [width, height]
se = strel('square', 3); % morphological filter for noise removal
nFrames = 0;
while (nFrames<100)
nframe = step(vidDevice); % read the next video frame
% Detect the foreground in the current video frame
foreground = step(foregroundDetector, nframe);
% Use morphological opening to remove noise in the foreground
filteredForeground = imopen(foreground, se);
% Detect the connected components with the specified minimum area, and
% compute their bounding boxes
bbox = step(blobAnalysis, filteredForeground);
% Draw bounding boxes around the detected cars
result = insertShape(frame, 'Rectangle', bbox, 'Color', 'green');
% Display the number of cars found in the video frame
numCars = size(bbox, 1);
step(videoPlayer, result); % display the results
nFrames = nFrames + 1;
end
thanks sir....

댓글을 달려면 로그인하십시오.

채택된 답변

Adam
Adam 2014년 11월 19일
편집: Adam 2014년 11월 19일
I assume from your tag (which ideally should just be a list of simple tags!) you are trying to use Matlab Coder.
What would you expect Matlab Coder to do with something like imshow though?
It requires graphics handling which is not part of porting code into C++ as far as I am aware. Matlab Coder is generally used for converting algorithmic code to C or C++ in order to run faster.
Matlab Compiler would allow you to build a standalone executable of your Matlab program if that is what you are wanting to do.
  댓글 수: 2
yogesh nandurkar
yogesh nandurkar 2014년 11월 20일
below is my programm...i have problem with imopen function .. thanks sir..
vidDevice = imaq.VideoDevice('winvideo', 1, 'YUY2_640x480', ... 'ROI', [1 1 640 480], ... 'ReturnedColorSpace', 'rgb', ... 'DeviceProperties.Brightness', 90, ... 'DeviceProperties.Sharpness', 90);
foregroundDetector = vision.ForegroundDetector('NumGaussians', 3, ... 'NumTrainingFrames', 50);
for i = 1:150 frame = step(vidDevice); % read the next video frame foreground = step(foregroundDetector, frame);
end
se = strel('square', 3);
filteredForeground = imopen(foreground, se);
blobAnalysis = vision.BlobAnalysis('BoundingBoxOutputPort', true, ... 'AreaOutputPort', false, 'CentroidOutputPort', false, ... 'MinimumBlobArea', 150);
bbox = step(blobAnalysis, filteredForeground);
result = insertShape(frame, 'Rectangle', bbox, 'Color', 'green');
numCars = size(bbox, 1);
videoPlayer = vision.VideoPlayer('Name', 'Detected Cars');
videoPlayer.Position(3:4) = [650,400]; % window size: [width, height]
se = strel('square', 3); % morphological filter for noise removal
nFrames = 0; while (nFrames<100)
nframe = step(vidDevice); % read the next video frame
% Detect the foreground in the current video frame
foreground = step(foregroundDetector, nframe);
% Use morphological opening to remove noise in the foreground
filteredForeground = imopen(foreground, se);
% Detect the connected components with the specified minimum area, and
% compute their bounding boxes
bbox = step(blobAnalysis, filteredForeground);
% Draw bounding boxes around the detected cars
result = insertShape(frame, 'Rectangle', bbox, 'Color', 'green');
% Display the number of cars found in the video frame
numCars = size(bbox, 1);
step(videoPlayer, result); % display the results
nFrames = nFrames + 1;
end
Adam
Adam 2014년 11월 20일
imopen is listed on
as supported by Matlab Coder. I don't use the Coder yet myself although we are currently trialling it in our team so I don't really know what type of errors get thrown up or how to deal with them specifically yet.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by