hi my teacher ask me determind car's headlight in picture on matlab and draw circule on thoes and measure distance between thoes how can i do it ...please help me
In order to solve any problem, start by defining the problem and what's expected of a solution.
So far, your problem description is "find car headlight (presumed plural), and distance between them". That's incredibly vague. It's not clear what sort of images you expect, what distance metric is needed, or whether this process is even intended to be entirely automated.
I just searched for "headlights". Are these useful images? Would you hope to get any meaningful information from them? What are the expected conditions? Would you expect to be able to programmatically tell which lights belong to a particular vehicle? Does it matter which car they belong to? Would you expect to be able to tell the difference between headlights and streetlights? What if a car has auxillary fog lamps? Is there a distinction?
When you ask for the distance, what does that mean? Distance in pixels? Distance in centimeters? Do you expect to have spatial calibration information or to be able to correct for perspective?
hi first of all i appricate for answer my question .i try to found car's headlight that is 200 meter far away from my car..i know how to determine distance car that is far away from my car but i want to recognize headlight in picture and measure distance between of them.i wrote my code that did it but some noise exist on it that i could'not remove it . i attach my picture and result of my code ..please give guidline how to remove noise that distrubed me ...i need to circle that are up in image and smaller than are on floor
i = imread('C:\New folder\ahb27.jpg');
subplot(2,3,1),imshow(i);
title('image');
% %Convert the image to grayscale
grayImage = rgb2gray(i);
% %Display the grayscale image
subplot(2,3,2),imshow(grayImage);
title('gray scale image');
imhist(grayImage);
subplot(2,2,3),imshow(grayImage);
n = 2;
Idouble = im2double(grayImage);
avg = mean2(Idouble);
sigma = std2(Idouble);
K = imadjust(grayImage,[0.7 0.8],[]);
figure
se = strel('disk', 5); % Adjust disk size as needed
You might try a number of things. I can't think of anything that would be universal, though.
You might try sorting bright spots based on their y-position, but that would get fooled by streetlights, clearance lights, and other cars.
You might try some sort of clustering to associate bright spots with their own reflections and then sorting within those groups to exclude the reflections. That could probably be defeated by a little rain or fog.
inpict = imread('ahb27.jpg');
% create a mask somehow
% i'm going to use HSV only because there is some
% color information which might help subdue the penumbra
% but S information is extremely damaged due to the downsampled chroma
[~,S,V] = rgb2hsv(inpict);
mask = S < 0.05 & V > 0.98;
% get blob area and position
% include an index list, so that it gets transformed during sorting
PS = regionprops(mask,'area','centroid');
A = vertcat(PS.Area);
C = vertcat(PS.Centroid);
roiblobs = (1:numel(PS)).';
% discard small objects
% i'm just going to use the median
% but there's not universally appropriate
junkblobs = A<median(A);
C(junkblobs,:) = [];
roiblobs(junkblobs) = [];
% sort blobs by y-position
[~,idx] = sort(C(:,2));
C = C(idx(1:2),:);
roiblobs = roiblobs(idx(1:2));
% if we want to truncate PS or A, we can
% similarly, the excluded objects could be removed from mask
yes your anwser is correct. i surface web and i understood i need to impelemetation of neural network like semantic segmentation and use it in my task ..because of change in some parameter can affect on my progaram and won't ork properly like viberation and etc...what do you make of my opinion ...are you agree this progaram won't work...???thanks for effort and helping...
No se puede completar la acción debido a los cambios realizados en la página. Vuelva a cargar la página para ver el estado actualizado.
Translated by
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.